Bill Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

August 2007
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Jul  Sep

Gnus and Gmail Setup for Dummies

Monday, August 13, 2007

A while back, I wrote a post titled VM and Gmail Setup for Dummies. As I mentioned in that post, my first choice for an Emacs/Gmail mail client was Gnus; however, at that time, I would have had to do a (relatively) large number of customizations in order to get Gnus working with Gmail on my Mac PowerBook. In the end, I decided to setup VM with Gmail so that I could at least have some Emacs-based Gmail solution working.

But, after upgrading to Aquamacs Emacs 1.1, I realized that I had eliminated a number of the custom installation steps that would have been previously required; so I decided to have a go at configuring Gnus as my mail client. Luckily, setup was really easy (actually, it was even easier than setting up VM had been). So, for those people who would like to use Gnus to read Gmail mail, I'll list the steps I had to do to get things working. But, first of all, here are some caveats:

So, with those caveats and without further ado, here's what I did:
  1. Enabled POP in Gmail.
  2. Downloaded and installed starttls (actually, starttls is required for sending mail, not receiving it, but Gmail requires it and I use the Emacs SMTP library that comes with Emacs 22.1 to send mail). There are various ways you can get starttls - I used Fink.
  3. Downloaded ssl.el and put it in a directory that is in the Emacs load path.
  4. Downloaded pop3.el and put it in a directory that is in the Emacs load path.
  5. Created a .gnus file in my home directory with the following contents:
    (require 'pop3)
    (add-to-list 'gnus-secondary-select-methods '(nnml ""))
    (setq gnus-permanently-visible-groups "mail")
    (setq gnus-posting-styles '((".*" (name "Bill Clementson"))))
    (setq mail-sources '((file :path "/var/mail/bc") (pop :server "pop.gmail.com" :port 995 :user "billclem" :connection ssl :leave t)))
    ;; Configure outbound mail (SMTP) (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) smtpmail-smtp-server "smtp.gmail.com" smtpmail-default-smtp-server "smtp.gmail.com" send-mail-function 'smtpmail-send-it message-send-mail-function 'smtpmail-send-it smtpmail-smtp-service 587 smtpmail-auth-credentials '(("smtp.gmail.com" 587 "billclem@gmail.com" nil)))
    Of course, if you want to replicate what I did, you'll need to replace the following values:
    • "Bill Clementson": with your name (duh)
    • "/var/mail/bc": with your default mail spoolfile location
    • "billclem": with your gmail userid
That's all there was to it!

Update-2007-08-24: Looks like there may be a couple more steps for some people (I don't remember having to do these steps myself):

emacs Copyright © 2007 by Bill Clementson