From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nix Newsgroups: gmane.emacs.devel Subject: Re: Default for the envelope From in smtpmail.el Date: Tue, 04 Sep 2012 14:13:24 +0100 Message-ID: <87a9x6lymj.fsf@spindle.srvr.nix> References: <0xwr16rzz5.fsf@fencepost.gnu.org> <83zk62c56n.fsf@gnu.org> <1usjbt9uzm.fsf@fencepost.gnu.org> <87628pj727.fsf@uwakimon.sk.tsukuba.ac.jp> <19713425-C419-4A09-8D66-24717D761FE8@mit.edu> <2962EC94-1044-47A5-A111-F4CBACFDCA0B@mit.edu> <87obmgtaq2.fsf@uwakimon.sk.tsukuba.ac.jp> <79D4B58B-FFCA-42E0-AD13-48B1C0879ADC@mit.edu> <87r4rbmp7u.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346764424 30322 80.91.229.3 (4 Sep 2012 13:13:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 13:13:44 +0000 (UTC) Cc: chad , "emacs-devel@gnu.org discussions" To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 15:13:46 2012 Return-path: Envelope-to: ged-emacs-devel@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 1T8swp-0006I7-9e for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 15:13:43 +0200 Original-Received: from localhost ([::1]:59637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8swm-0008SK-D3 for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 09:13:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8swg-0008FW-65 for emacs-devel@gnu.org; Tue, 04 Sep 2012 09:13:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8swf-0001tF-30 for emacs-devel@gnu.org; Tue, 04 Sep 2012 09:13:34 -0400 Original-Received: from icebox.esperi.org.uk ([81.187.191.129]:43279 helo=mail.esperi.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8swe-0001s7-Jr for emacs-devel@gnu.org; Tue, 04 Sep 2012 09:13:33 -0400 Original-Received: from spindle.srvr.nix (nix@spindle.srvr.nix [192.168.14.15]) by mail.esperi.org.uk (8.14.5/8.14.5) with ESMTP id q84DDOMr010409; Tue, 4 Sep 2012 14:13:24 +0100 Emacs: because extension languages should come with the editor built in. In-Reply-To: <87r4rbmp7u.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Mon, 13 Aug 2012 12:43:17 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-DCC-URT-Metrics: spindle 1060; Body=3 Fuz1=3 Fuz2=3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 81.187.191.129 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152987 Archived-At: On 13 Aug 2012, Stephen J. Turnbull stated: > I suppose it would be possible to enhance user-mail-address to > something like user-mail-configurations, which would be a list of > lists like (ADDRESS FULLNAME LOGIN AUTHENTICATION EXTRA-HEADERS). Of > course Gnus already supports this kind of thing (I forget the Gnus > name for the feature, as does VM ("personality crisis"). By coincidence I just had to do exactly that: ,---- | (defvar nix-overriding-smtp-servers '(("nick.alcock@oracle.com" "[work.mailserver.host.censored]" 465 ssl)) | "List of SMTP servers to override the default with. | | An alist with each element of the form (EMAIL-ADDRESS SMTP-SERVER SMTP-PORT STREAM-TYPE).") | | (defun nix-get-overriding-smtp-servers () | (save-excursion | (loop with from = (save-restriction | (message-narrow-to-headers) | (message-fetch-field "from")) | for (addr server port stream-type) in nix-overriding-smtp-servers | when (string-match addr from) return (list server port stream-type) | finally return (list smtpmail-smtp-server smtpmail-smtp-service smtpmail-stream-type)))) | | (defadvice smtpmail-via-smtp | (around change-smtp-by-message-from-field (recipient buffer &optional ask) activate) | (with-current-buffer buffer | (progv '(smtpmail-smtp-server smtpmail-smtp-service smtpmail-stream-type) | (nix-get-overriding-smtp-servers) | ad-do-it))) `---- Not killingly difficult, but something it would be nice if we didn't have to do every time. > IIRC, Glenn was specifically referring to Gnus. So if he rephrases > slightly to specify that MUA "personality" customizations should offer > this option and documentation explaining when it makes sense, I think > everybody would be happy. Yes. As seen above, you can do it yourself, but you shouldn't need to, not really: like gnus-posting-styles, this should be something Gnus (or message mode) does for you. -- NULL && (void)