Living in Emacs
E-Mail, News, Editing, Writing, Programming,… Since a few year now I use GNU Emacs for almost everything i do regularly on my computer. But there is still so many to discover and learn. The last few weeks I started to use org-mode for notes, ToDo lists, etc and i really love it. Especially the feature to link from your ToDo list or note directly to an mail in Gnus. Just copy (C-c l) the link to the mail in Gnus and insert (C-c C-l) it into the note. Now I can click on the link in my ToDo list and Emacs will show me directly the corresponding mail/thread in my mail client. Great!
As already said, for mails and news I use Gnus. Until now I always set up postfix as my Mail Transport Agent (MTA). Only today I learnt that Gnus is able to send e-mails directly without an external MTA. The only pitfall, you have to install gnutls-bin and starttls to use SSL/TLS. Otherwise it will not work and you will not get a meaningful error message. After that it is fairly easy. I just had to enter this into my ~/.gnus:
1 2 3 4 5 6 7 8 9 10 11 | (setq smtpmail-smtp-server "smtp-server") (setq smtpmail-smtp-service 25) (require 'smtpmail) (setq message-send-mail-real-function 'smtpmail-send-it) (setq smtpmail-auth-credentials '(("smtp-server" 25 "user" "passwd"))) (setq smtpmail-starttls-credentials '(("smtp-server" 25 nil nil))) (setq starttls-use-gnutls t) (setq starttls-gnutls-program "gnutls-cli") (setq starttls-extra-arguments nil) |
That’s it. Now I can apt-get remove postfix and have one service less in the background of my daily computing.




I made this switch from a local postfix to smtpmail many years ago, in my case using VM. At the time, my place of work (a relatively large organization) was having some trouble with their SMTP server. Everyone was complaining, but I hadn’t even noticed, because my local postfix was queuing the outgoing mail in the background and retrying sending it until it succeeded. Switching to smtpmail made me painfully aware of all the problems. Anyway, it was still the right thing to do, since I was and am using a laptop which is not guaranteed to have a network connection, so it was never guaranteed that postfix got the mail delivered before the machine was disconnected. With smtpmail you knew immediately if there was a problem. Eventually the SMTP service was fixed and I’ve been a happy VM and smtpmail user.
I currently use smtpmail, but I’ve actually thought about switching back to a local postfix. Mostly because of the very slight delay it takes to get a tls connection to the send the mail.
Having a smtp server running locally has two major advantages:
(1) Emacs will not freeze while the message are sent, wich may take some time with a bad line and a big mail sent to several people
(2) you can work with the connection off, for instance when travelling, and let the smtp server take care of the queueing.