SMTP/STARTTLS support for Emacs

RFC2595 describe how TLS support can be added to SMTP. The following patch implement this in Emacs' smtpmail.el. It was developed for Emacs 21 but should apply to Emacs 20 too.

How to use:

  1. Make sure the new smtpmail.el is in your load path and loaded.
  2. Make sure your MUA uses smtpmail, this usually works:
    (setq message-send-mail-function 'smtpmail-send-it     ;; for gnus/message
          send-mail-function 'smtpmail-send-it)            ;; for `mail'
  3. Configure smtpmail to send mail to your server:
    (setq smtpmail-smtp-service 25
          smtpmail-debug-info t
          smtpmail-smtp-server "")
  4. Install starttls.
  5. M-x customize-variable RET smtpmail-starttls-credentials RET and add the server name, server port, and filenames pointing to files containing keys and certificate.
  6. Now smtpmail.el should use STARTTLS whenever you send mail. Look in the *trace of SMTP session to* buffer for details.

The patch.

Emacs 21 users: Do not use the patch, just fetch the latest smtpmail.el version from Emacs CVS instead. It is much more complete.

XEmacs users: Just get the latest "mail-lib" package.

Credits: This patch was developed against the, thanks to Gregory Neil Shapiro.