I’ve been trying out the GNUS program within Emacs for the past few days. It can do a lot of stuff: reading email (locally, IMAP, POP3), RSS feeds, Usenet, and probably more. I am just using it for email right now, but I could see myself getting it set up as an RSS reader as well. Getting it set up for email with IMAP was relatively simple. Here’s my basic configuration:
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq gnus-select-method '(nnnil "") ; No primary GNUS server
gnus-secondary-select-methods '((nnml "")
(nnimap "mail.privateemail.com"))
; Archive outgoing email in sent folder
gnus-message-archive-method '(nnimap "mail.privateemail.com")
smtpmail-default-smtp-server "mail.privateemail.com"
gnus-message-archive-group "Sent"
message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-service 587
user-full-name "Nathaniel Wright"
user-mail-address "nathan@nathanieljwright.com")
The actual login info for my email hosting provider is stored in a .authinfo file. I don’t know if both are strictly needed, but as far as I understand things, the first line is the login information for IMAP (i.e., reading email) and the second line is the login information for sending mail:
machine mail.privateemail.com login nathan@nathanieljwright.com port imaps password ***
machine mail.privateemail.com login nathan@nathanieljwright.com password ***
I wasn’t super comfortable just having a plaintext file on my machine with passwords inside them, but Emacs has another built-in feature that allows it to implicitly append a .gpg extension to files and attempt to read/write them as encrypted files. So I ended up putting this login info inside a .authinfo.gpg, encrypt it, and everything just magically works. I get prompted for my private key’s password when opening GNUS as it tries to read the authinfo file and only afterwards is it able to connect to IMAP and grab any mail.
Leave a Reply