From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16994 Path: news.gmane.org!not-for-mail From: W. Greenhouse Newsgroups: gmane.emacs.gnus.user Subject: Re: chosing among many smtp servers Date: Sun, 27 Jul 2014 05:53:47 +0000 Message-ID: <87ppgr2vpw.fsf@motoko.kusanagi> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1406440463 8394 80.91.229.3 (27 Jul 2014 05:54:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2014 05:54:23 +0000 (UTC) To: info-gnus-english-mXXj517/zsQ@public.gmane.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Sun Jul 27 07:54:18 2014 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XBHPU-00011L-TI for gegu-info-gnus-english@m.gmane.org; Sun, 27 Jul 2014 07:54:17 +0200 Original-Received: from localhost ([::1]:33977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBHPU-0005hI-GG for gegu-info-gnus-english@m.gmane.org; Sun, 27 Jul 2014 01:54:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBHPN-0005gC-97 for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sun, 27 Jul 2014 01:54:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBHPH-0001bc-1R for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sun, 27 Jul 2014 01:54:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBHPG-0001bJ-Qn for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sun, 27 Jul 2014 01:54:02 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XBHPE-0000sP-LF for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sun, 27 Jul 2014 07:54:00 +0200 Original-Received: from 46.20.46.152 ([46.20.46.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Jul 2014 07:54:00 +0200 Original-Received: from wgreenhouse by 46.20.46.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Jul 2014 07:54:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet-dbVV3NMTNubNLxjTenLetw@public.gmane.org X-Gmane-NNTP-Posting-Host: 46.20.46.152 X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:wqz2YB2oOgv4x8iyq/T/0kDPUiA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.gnus.user:16994 Archived-At: Hi there, Le TeXnicien de surface 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