From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85009 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: separate smtps for my accounts Date: Wed, 24 Sep 2014 11:24:56 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <874mvxm46v.fsf@lifelogs.com> References: <87tx4dodsj.fsf@skimble.plus.com> <87egvhsi8y.fsf@ericabrahamsen.net> <87k357qiug.fsf@skimble.plus.com> <87wq97m036.fsf@ericabrahamsen.net> <874mw7s894.fsf@skimble.plus.com> <87iokn0z4t.fsf@ericabrahamsen.net> Reply-To: ding@gnus.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1411572309 21050 80.91.229.3 (24 Sep 2014 15:25:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2014 15:25:09 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33253@lists.math.uh.edu Wed Sep 24 17:25:02 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XWoR5-0002hQ-Jy for ding-account@gmane.org; Wed, 24 Sep 2014 17:24:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1XWoQx-0005hh-Ik; Wed, 24 Sep 2014 10:24:47 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XWoQw-0005hW-AO for ding@lists.math.uh.edu; Wed, 24 Sep 2014 10:24:46 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XWoQu-0004Ls-U7 for ding@lists.math.uh.edu; Wed, 24 Sep 2014 10:24:46 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XWoQt-0002UB-8m for ding@gnus.org; Wed, 24 Sep 2014 17:24:43 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XWoQo-0002PS-Uy for ding@gnus.org; Wed, 24 Sep 2014 17:24:38 +0200 Original-Received: from c-98-229-61-72.hsd1.ma.comcast.net ([98.229.61.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Sep 2014 17:24:38 +0200 Original-Received: from tzz by c-98-229-61-72.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Sep 2014 17:24:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-61-72.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:DcEK6HE2X0x5ZkxG8WgP1psO2ug= X-Spam-Score: -3.6 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85009 Archived-At: On Wed, 17 Sep 2014 10:17:06 +0800 Eric Abrahamsen wrote: EA> A unified or built-in solution for this would be pretty nice... 1) in my ~/.authinfo.gpg #+begin_src text machine smtp.gmail.com login ted@px.com port 587 password "pass1" machine smtp.gmail.com login ted@lifelogs.com password "pass2" #+end_src 2) I use this function, original author unknown: #+begin_src lisp (defun tzz-change-smtp () "Change the SMTP server according to the current from line." (save-excursion (save-restriction (message-narrow-to-headers) (let* ((from (message-fetch-field "from")) (from-px (string-match "px" from)) ) (cond (from-px (setq smtpmail-smtp-service 587 smtpmail-smtp-user "ted@px.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-default-smtp-server smtpmail-smtp-server)) (t (setq smtpmail-smtp-service 587 smtpmail-smtp-user "ted@lifelogs.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-default-smtp-server smtpmail-smtp-server))))))) (add-hook 'message-send-hook 'tzz-change-smtp) #+end_src So basically the `smtpmail-smtp-user' and `smtpmail-smtp-server' are matched against ~/.authinfo.gpg. This is essentially what posting-styles is designed for. Does it look robust enough to add support for it to the posting styles? Or is it already supported? Sorry, I'm a bit out of date on this stuff :) If we find a solution that works out of the box, we can add it to the auth-source manual and tell people about it: (info "(auth) Help for users") Ted