Starter Kit Gnus – IMAP
Based on the instructions at emacswiki:GnusGmail.
to use this file:
- personal information in this file (specifically in the code blocks which will be tangled in the next step) globally replace “your-name” with your gmail username, and “your-password” with your gmail password.
- tangle this file Run the
org-babel-tanglecommand to extract the code embedded in this file into a
starter-git-gnus-imap.elfile which can be added to your configuration, and a
~/.authinfofile which will be used by gnus.
- load this configuration If you have a recent version of Org-mode
(i.e. after 7.0) or are using the literate Emacs Starter Kit, then
this file can be loaded directly using the
org-babel-load-filefunction, or by placing it in your load path (if you’re using the starter kit).
Alternately ensure that the
gnus-gmail.elfile generated by the previous step is loaded by your configuration.
- fire up gnus This can be done with the command
- view your mail After gnus boots up you will see the “Group
Buffer” (see Group-Buffer). Each line is a mail “Group”, hit
ENTERon a group to view it’s contents. You should see an “INBOX” group which contains the mail in your gmail account. If not, you can jump to the “INBOX” group by
- tab completing the name “INBOX”
Ufor “unkill” meaning this will now always be displayed in your Group buffer when you have new mail
- customize Gnus has unrivalled capacity for customization. Once your comfortable with basic usage, take some time to browse through the very readable Gnus Manual to learn untold tricks (see also Starter-kit-gnus:Customizations).
saving mail locally
Where your mail will be saved locally default value will be
(require 'gnus) (setq nnml-directory "~/gmail") (setq message-directory "~/gmail")
All Gmail groups will be ignored by the default value of
gnus-ignored-newsgroups, so let’s change that default value.
(setq gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\”]\”[#’()]")
Set Gmail as the primary source for incoming mail (Gnus can aggregate many email and/or newsgroup sources).
(setq gnus-select-method '(nnimap "gmail" (nnimap-address "imap.gmail.com") (nnimap-server-port 993) (nnimap-stream ssl)))
Place a line like the following in
machine imap.gmail.com login firstname.lastname@example.org password your-password port 993
and make sure that no-one else can read it with
chmod 600 ~/.authinfo
Requirement: gnus uses the gnutls tool for encrypted sending of email to the Gmail SMTP server. This is easily installed on modern Debian (including Ubuntu) systems with
apt-get install gnutls-bin
The following configures gnus to use the Gmail SMTP server for sending email.
(setq message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) smtpmail-auth-credentials '(("smtp.gmail.com" 587 "email@example.com" nil)) smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 587 starttls-use-gnutls t)
If you don’t want to be prompted for a password on every mail sent,
you can add the following line to your
machine smtp.gmail.com login firstname.lastname@example.org your-password secret port 587