From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85216 Path: news.gmane.org!not-for-mail From: W. Greenhouse Newsgroups: gmane.emacs.gnus.general Subject: Re: Any way to captuer smtp output when sending mail? Date: Sun, 02 Nov 2014 23:55:14 +0000 Message-ID: <878ujtkvj1.fsf@motoko.kusanagi> References: <87wq7yllo0.fsf@reader.local.lan> <874mv2nzro.fsf@reader.local.lan> <874muiahwq.fsf@reader.local.lan> <87h9yilp6d.fsf@motoko.kusanagi> <87zjca8m5k.fsf@dv.local.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414972617 5266 80.91.229.3 (2 Nov 2014 23:56:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2014 23:56:57 +0000 (UTC) To: ding-smP1P7uqpqc@public.gmane.org Original-X-From: ding-owner+M33460-qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org Mon Nov 03 00:56:52 2014 Return-path: Envelope-to: ding-account-Uylq5CNFT+jYtjvyW6yDsg@public.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 1Xl50r-0004Qa-0z for ding-account-Uylq5CNFT+jYtjvyW6yDsg@public.gmane.org; Mon, 03 Nov 2014 00:56:49 +0100 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 1Xl4zk-0003sz-MH; Sun, 02 Nov 2014 17:55:40 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Xl4zh-0003sl-Pn for ding-qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org; Sun, 02 Nov 2014 17:55:37 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Xl4zf-0001Vz-Tj for ding-qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org; Sun, 02 Nov 2014 17:55:37 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Xl4zd-0006sx-UE for ding-smP1P7uqpqc@public.gmane.org; Mon, 03 Nov 2014 00:55:33 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xl4za-00041v-3X for ding-smP1P7uqpqc@public.gmane.org; Mon, 03 Nov 2014 00:55:30 +0100 Original-Received: from arachnidefr94.torproxy-readme-arachnide-fr-35.fr ([62.210.206.25]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2014 00:55:30 +0100 Original-Received: from wgreenhouse by arachnidefr94.torproxy-readme-arachnide-fr-35.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2014 00:55:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 78 Original-X-Complaints-To: usenet-dbVV3NMTNubNLxjTenLetw@public.gmane.org X-Gmane-NNTP-Posting-Host: arachnidefr94.torproxy-readme-arachnide-fr-35.fr X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:PkFQpBO4pfOTV8p8oQEL0Mn2zLU= X-Spam-Score: -3.5 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85216 Archived-At: Harry Putnam writes: [...] > Perhaps there are good reasons to do it and I would be better off > spending my time getting setup for that. > > Any speed or cpu differences of note? > > Any other points infavor of all smtpmail.el? As I see it, the pros of smtpmail.el are: 1. Fewer moving parts--sometimes following the "UNIX philosophy" to the extreme for a problem like email means that it's hard to know what has failed when you change something in your delivery pipeline and it stops working: Is your MTA using the right smtp server for each of your outgoing mail addresses? Is mail getting stuck in a queue somewhere and you'd never know unless you poked around in your logs? ...etc, etc. 2. Emacs can store SMTP authentication credentials in an encrypted file, instead of leaving them sitting in plaintext on the disk (I know that some MTAs can store them as salted and hashed values after which you can delete the plaintext original, but Emacs with authinfo.gpg is even better). 3. Fairly tuneable behavior as far as TLS usage. Emacs unfortunately has nasty "fail open" behavior as a TLS client per default, and there are a couple of bug reports open about this, but it is possible to tune it to implement a "Trust on First Use" or certificate pinning scheme, which will "fail closed" if an unfamiliar certificate is seen (similar to the behavior of openssh when seeing a new host). See https://blogs.fsfe.org/jens.lechtenboerger/2014/03/23/certificate-pinning-for-gnu-emacs/ for an example. The cons are: 1. Delivery through smtpmail.el is synchronous, blocks your Emacs, and can be slow. Normally when using the /usr/sbin/sendmail binary on a *nix system, you are only copying standard output to a queue file, and delivery happens separately in the background when the mailserver flushes the queue, so this can be faster (and more importantly feels faster because you aren't sitting there waiting for your Emacs to return control to you :-) ). John Wiegley's async.el library comes with an example which works around the smtpmail blocking problem: https://github.com/jwiegley/emacs-async but because that library relies on using a second Emacs instance to do the background work, there can be issues with error reporting to the "master" Emacs, and getting this to work with encrypted auth credentials is pretty painful. 2. There is no easy recipe built into Gnus and smtpmail.el for the very common modern case of having several mail identities and needing to use a different outgoing smtp server for each. For that you need to figure out (info "(gnus) Posting Styles") and (info "(message) Mail Variables") and the care and feeding of the "X-Message-SMTP-Method" header, or else use an addon library like http://www.emacswiki.org/emacs/GnusAlias to make it easier to switch ougoing servers. Most MTAs have some example configuration for the "sender dependent smarthost" problem and it just works transparently after you set it up. Or people use a special tiny remote-client-only MTA like msmtp, which handles this multiple-outgoing-servers case brilliantly using just the -f flag to /usr/sbin/sendmail.