Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* chosing among many smtp servers
@ 2014-07-25 16:04 Le TeXnicien de surface
  2014-07-25 19:18 ` Anssi Saari
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Le TeXnicien de surface @ 2014-07-25 16:04 UTC (permalink / raw)
  To: info-gnus-english

Hello all

I'm preparing my .gnus.el to, at last, go to gnus to read and write news
and mails.

I can collect my mails from different pop and imap boxes.

What I would like to achieve now is to chose among some smtp servers
which one to use to send a mail (I'm currently using 3 servers with 6
identities).
I don't want too subtle a solution but I would be greatly happy if
there was a way of picking one server from a pre-declared list.

all hints will be appreciated

many thanks in advance

-- 
Le TeXnicien de surface

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chosing among many smtp servers
  2014-07-25 16:04 chosing among many smtp servers Le TeXnicien de surface
@ 2014-07-25 19:18 ` Anssi Saari
  2014-07-26  8:17 ` Clemens Schüller
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Anssi Saari @ 2014-07-25 19:18 UTC (permalink / raw)
  To: info-gnus-english

Le TeXnicien de surface <le.texnicien.de.surface@chezmoi.invalid>
writes:

> I don't want too subtle a solution but I would be greatly happy if
> there was a way of picking one server from a pre-declared list.

There's a longish solution in the Emacs wiki at
http://www.emacswiki.org/emacs/MultipleSMTPAccounts

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chosing among many smtp servers
  2014-07-25 16:04 chosing among many smtp servers Le TeXnicien de surface
  2014-07-25 19:18 ` Anssi Saari
@ 2014-07-26  8:17 ` Clemens Schüller
  2014-07-26 11:44 ` Damien Wyart
  2014-07-27  5:53 ` W. Greenhouse
  3 siblings, 0 replies; 5+ messages in thread
From: Clemens Schüller @ 2014-07-26  8:17 UTC (permalink / raw)
  To: info-gnus-english

Hello!

Le TeXnicien de surface <le.texnicien.de.surface@chezmoi.invalid>
writes:

> Hello all
>
> I'm preparing my .gnus.el to, at last, go to gnus to read and write news
> and mails.
>
> I can collect my mails from different pop and imap boxes.
>
> What I would like to achieve now is to chose among some smtp servers
> which one to use to send a mail (I'm currently using 3 servers with 6
> identities).
> I don't want too subtle a solution but I would be greatly happy if
> there was a way of picking one server from a pre-declared list.
>
> all hints will be appreciated
>
> many thanks in advance

You can try it with the code from here[1] (exal-change-smtp).

The actual SMTP server refers on the from line in the header.



Footnotes: 
[1]  http://exal.0x2.org/conf/gnus.html
-- 
Best Regards, Clemens Schüller

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chosing among many smtp servers
  2014-07-25 16:04 chosing among many smtp servers Le TeXnicien de surface
  2014-07-25 19:18 ` Anssi Saari
  2014-07-26  8:17 ` Clemens Schüller
@ 2014-07-26 11:44 ` Damien Wyart
  2014-07-27  5:53 ` W. Greenhouse
  3 siblings, 0 replies; 5+ messages in thread
From: Damien Wyart @ 2014-07-26 11:44 UTC (permalink / raw)
  To: info-gnus-english

* Le TeXnicien de surface <le.texnicien.de.surface@chezmoi.invalid>
  in gnu.emacs.gnus:
> What I would like to achieve now is to chose among some smtp servers
> which one to use to send a mail (I'm currently using 3 servers with
> 6 identities).

Gnus is not (yet :) a full SMTP server, so maybe it would be more
flexible to rely on the local SMTP server and have it forward the mail
to another server based on some criteria.

-- 
DW

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chosing among many smtp servers
  2014-07-25 16:04 chosing among many smtp servers Le TeXnicien de surface
                   ` (2 preceding siblings ...)
  2014-07-26 11:44 ` Damien Wyart
@ 2014-07-27  5:53 ` W. Greenhouse
  3 siblings, 0 replies; 5+ messages in thread
From: W. Greenhouse @ 2014-07-27  5:53 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Hi there,

Le TeXnicien de surface <le.texnicien.de.surface-OD3UL9XbF+DB8XbDibcijQ@public.gmane.org>
writes:

[...]

> What I would like to achieve now is to chose among some smtp servers
> which one to use to send a mail (I'm currently using 3 servers with 6
> identities).
> I don't want too subtle a solution but I would be greatly happy if
> there was a way of picking one server from a pre-declared list.
>
> all hints will be appreciated
>
> many thanks in advance

Have a look at the small examples in (info "(gnus) Posting Styles") and
(info "(gnus) Group Parameters"). By using posting styles, group
parameters, or a mix of the two, you can choose outgoing SMTP server
based on which Gnus group is currently open, to whom you are replying,
or from which server the message was received. You need to match the
newsgroup name or some header in the message being replied to, and
arrange for the Gnus posting style or group parameter to set the
appropriate "From" line and the "X-Message-SMTP-Method" line.

This last header is eaten by Gnus message-mode during preparations to
send the message, to determine whether to use the external "sendmail"
command or the elisp `smtpmail' package with some altered server
settings, e.g.:

X-Message-SMTP-Method: sendmail

or

X-Message-SMTP-Method: smtp smtp.mail.foo.net 465

In the latter case, you'll get badgered for auth info unless this
matches one of the hosts in your `auth-sources' file or files. I have no
idea what will happen if you want to use two different logins at the
same SMTP host, which you hint at.

Another option is to (setq message-send-mail-function
'message-send-mail-with-sendmail), and set `sendmail-program' to point
to the wonderful "msmtp" which will guess the right SMTP identity to use
based on the From header contents. Then your posting styles and/or group
parameters will only need to get the From header right.

(I'm not sure if this is more or less complicated than the suggestion of
setting up the system MTA to route the mail across these different
hosts, but at least it keeps sending config nicely contained to your own
user. I tend to be uncomfortable about putting my own SMTP usernames and
passwords in the site-wide MTA config, even if it's basically a
single-user system in practical terms. I don't know why. :) )

Good luck!
-WGG



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-27  5:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-25 16:04 chosing among many smtp servers Le TeXnicien de surface
2014-07-25 19:18 ` Anssi Saari
2014-07-26  8:17 ` Clemens Schüller
2014-07-26 11:44 ` Damien Wyart
2014-07-27  5:53 ` W. Greenhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).