Gnus configuration example

About Gnus

Quick presentation

Gnus is a message reader included in Emacs. It is obviously written in Lisp and its configuration must also be written in Lisp.

As message, Gnus refer to every kind of messages: news, rss, and emails.

It is a full featured mail user agent with some extensible capabilities that leads you to a more efficient message manager than any other existing MUA.

Of course, it is interfaced with many external Lisp and non-Lisp programs like org-mode, web browsers, encryption tools, … etc.

About credentials

The problem with configuration files is that they are readable if an access to your account is stolen or provided by error (please, lock your machine when you go away, even for a few seconds).
Even if you set some hardened permissions on the file, if someone has access to your terminal, a simple cat command will display your credentials.

Gnus relies on a file that list all credentials for your accounts so they are not written in your email client configuration.
But the problem still exists because that credential file is still there.

We will rely on the fact that Emacs has a powerful inteface with GPG tools and allows to create/edit encrypted files directly in Lisp. Therefore, if we store our credentials in an encrypted file, Gnus (via Emacs) will be able to decrypt that file and use the content to authenticate you on your IMAP/SMTP accounts. And that file stays secure for a (bad) human.

To do so, just create a ~/.authinfo.gpg file from Emacs and let Emacs store your credentials here automatically (it will be asked once).

The configuration example

Prerequisites

In order to use Gnus, you must create a ~/.gnus file and add all the following configuration here. Simple as that.