More posts about: emacs, geek Tags: dovecot, emacs, gnus, highlight, imap, mail, offlineimap // 35 Comments »
- Make sure you’ve set up Postfix or some other mail server that can send mail. I’m not going to cover that because my configuration for outgoing mail doesn’t use Gmail.
- Install dovecot (IMAP server) and offlineimap (IMAP synchronization). You can probably find binaries for your distribution.
- Edit /etc/dovecot.conf and set the following:default_mail_env = maildir:%h/Maildir
- Put the following in ~/.offlineimaprc, changing your_local_username, your_username, and your_gmail_password:[general] accounts = Gmail maxsyncaccounts = 1 [Account Gmail] localrepository = Local remoterepository = Remote [Repository Local] type = IMAP remotehost = localhost port = 143 remoteuser = your_local_username [Repository Remote] type = IMAP remotehost = imap.gmail.com remoteuser = [email protected] remotepass = your_gmail_password ssl = yes maxconnections = 1 realdelete = no folderfilter = lambda foldername: foldername in ['INBOX']
If you feel comfortable specifying your password for your local account in your ~/.offlineimaprc, you can do so by adding a remotepass line under the remoteuser line in the [Repository Local] section.
- 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 gnus-select-method '(nnimap "Mail" (nnimap-address "localhost") (nnimap-stream network) (nnimap-authenticator login))) (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).
Hope that helps. Have fun!
- 28 October 2008 at 7:10pm
- Surely it can’t be so hard to be a better (Emacs and Docbook) geek? « Alec the Geek 22 May 2011 at 2:05am
- 在gnus里阅读Gmail邮件(续) | Freeland | 逍遥郡 19 August 2013 at 9:08am
- Emacs & Email Revisited | Bills Blog 30 July 2014 at 12:07pm
- How to use isync and the dovecot mail server to read your Gmail in Emacs efficiently | life
[...] 29/Aug/08: Sacha Chua has some great advice to share on using Gnus for ...
[...] Sacha Chua 的这篇文章 Geek: How to use offlineimap and the dovecot mail server ...
[…] how to use offlineimap and the dovecot mail server to read your gmail in emacs ...
[…] have been using using Sacha Chua’s how to on using offlineimap and ...