Harry Putnam <***@newsguy.com> writes:
[...]
Post by Harry PutnamPerhaps 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.