How do I set up Emacs on Linux to read/send mail from Gmail?

6

4

I generally like Gmail, but there's something about well formatted, color highlighted plain text over a black background that appeals to me a lot. I'd like to be able to use Emacs to read/send email using my Gmail account, but setting it up is infuriatingly difficult. I tried a bunch of extensions and tutorials, but none of them gave me a fully working email setup for Emacs.

This is going to be my last try before I give up. I'm on Ubuntu 11.10, standard Unity shell, using Emacs 23.3. Please tell me once and for all how to get this to work.

EpsilonVector

Posted 2011-12-07T19:05:42.687

Reputation: 640

Answers

2

Gnus seems to have some instructions for GMail. Using IMAP is probably best since it leaves mail accessible with other clients and the web interface if something goes wrong locally.

Brian

Posted 2011-12-07T19:05:42.687

Reputation: 8 439

2

I use offlineimap + dovecot for having the mails localy.

My .offlineimaprc is:

[general]
accounts = Locals, Gmail
maxsyncaccounts = 2

[Account Gmail]
localrepository = Local
remoterepository = Remote
autorefresh = 5

[Repository Local]
type = Maildir
localfolders = ~/Maildir

[Repository Remote]
type = Gmail
remotehost = imap.gmail.com
remoteuser = my.email@gmail.com

My /etc/dovecot.conf contain:

default_mail_env = maildir:%h/Maildir

and my .gnus have:

(setq imap-shell-program "/usr/lib/dovecot/imap")

(setq gnus-secondary-select-methods
      '((nndraft "")
        (nnimap "localhost"
         (nnimap-stream shell)))))

For outgoing mail I use:

(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
(setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "my.email@gmail.com" nil)))
(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 587)

And it just work.

Rémi

Posted 2011-12-07T19:05:42.687

Reputation: 1 300

I installed dovecot and it warned me that its "conf file does not belong to the current user". Not sure what to do with this. Also, I couldn't find the imap shell program. There's no imap file in /usr/lib/dovecot – EpsilonVector – 2011-12-08T06:52:54.030

I don't know how you installed dovecot. I use Debian, and the dovecot package from debian unstable (package dovecot-imapd) – Rémi – 2011-12-08T18:57:19.537

0

wl does the job too

Wanderlust http://www.gohome.org/wl/

rzr

Posted 2011-12-07T19:05:42.687

Reputation: 232