Living in Emacs

April 13, 2009    emacs gnu gnus org-mode

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:

(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.