2015-12-24: Updated with config changes now that I'm back to using Gnus+dovecot+offlineimap+Gmail
2014-04-09: This post is from 2008. =) I think I used dovecot+offlineimap because Gnus and maildir weren't getting along properly and directly connecting with IMAP to Gmail's server was slow, but things have probably changed a fair bit since then. I eventually moved to using the Gmail web interface for most things, but I still miss my Gnus setup!
Hope that helps. Have fun!
- Make sure you've set up Postfix or some other mail server that can send mail.
- Install dovecot (IMAP server) and offlineimap (IMAP synchronization). You can probably find binaries for your distribution.
- Edit /etc/dovecot/conf.d/10-mail.conf and set the following:
mail_location = maildir:~/Maildir:LAYOUT=fs
- Use the instructions from http://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password to set up GPG-encrypted passwords. (optional)
- Put the following in ~/.offlineimaprc, changing the details as needed.
accounts = SachaGmail
pythonfile = ~/bin/offlineimap-password.py
localrepository = Local
remoterepository = Gmail
status_backend = sqlite
type = Maildir
localfolders = ~/Maildir
type = Gmail
maxconnections = 2
remoteuser = [email protected]
realdelete = no
folderfilter = lambda foldername: foldername in ['INBOX', '[Gmail]/All Mail', '[Gmail]/Sent Mail', '[Gmail].Starred', '[Gmail].Drafts', '[Gmail].Important']
nametrans = lambda folder: re.sub('^INBOX$', '[Gmail].Inbox', folder)
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
remotepasseval = mailpasswd("gmail")
If you feel comfortable specifying your password in your ~/.offlineimaprc, you can do so by changing remotepasseval to remotepass. If so, you don't need the pythonfile line.
- chmod go-rwx ~/.offlineimaprc for a little bit of safety.
- Type offlineimap to start synchronizing.
- While that's synchronizing, use something like this as your ~/.gnus:
(setq user-mail-address "[email protected]")
(setq gnus-ignored-from-addresses "youruser")
- Start Emacs. Start Gnus with M-x gnus. If you don't see the INBOX group, press ^ (gnus-group-enter-server-mode), open nnimap:Mail, move your cursor to the INBOX, and either press RET to go into the group or press u (gnus-browse-unsubscribe-current-group) to toggle the subscription status until you're subscribed to the group. Then it should show up on the group screen (M-x gnus).