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:
- These steps worked for me with Aquamacs Emacs 1.1 and will probably work on any Mac that is running Emacs 22.1 or higher; however, all I'm really saying is that the following steps worked for me!
- I won't list any of my custom Gnus configuration as everyone has their own little Gnus configuration peculiarities and that really doesn't have anything to do with getting Gmail working in Gnus; however, the .gnus file listed below will probably work fine "as-is" once you've replaced my values with yours.
- My email volumes are pretty low so I can afford to get my emails with Gnus rather than using postfix/fetchmail to download the mail. If your volumes are heavier, you might want to look at different options for downloading your mail locally before accessing it with Gnus.
- Enabled POP in Gmail.
- 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.
- Downloaded ssl.el and put it in a directory that is in the Emacs load path.
- Downloaded pop3.el and put it in a directory that is in the Emacs load path.
- Created a .gnus file in my home directory with the following contents:
(require 'pop3)Of course, if you want to replicate what I did, you'll need to replace the following values:
(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 "email@example.com" nil)))
- "Bill Clementson": with your name (duh)
- "/var/mail/bc": with your default mail spoolfile location
- "billclem": with your gmail userid
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):
- You may need to create a "~/.emacs.d/url/" directory.
- You may need to create a mail spool file doing
sudo touch /var/mail/bc sudo chmod 600 /var/mail/bc(substituting your login id for "bc")