info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chosing among many smtp servers


From: W . Greenhouse
Subject: Re: chosing among many smtp servers
Date: Sun, 27 Jul 2014 05:53:47 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi there,

Le TeXnicien de surface <le.texnicien.de.surface@chezmoi.invalid>
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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]