Using Stanford IMAP with Mutt and Pine
This document covers the basic steps on how to get two UNIX text-based mail clients, Mutt and Pine, to work with the Stanford IMAP system. This document does not cover in-depth IMAP usage and client functionality.
The Stanford IMAP server supports a number of authentication mechanisms, one of which is Kerberos 5 (or GSSAPI). As a result, mail clients such as Mutt and Pine that support Kerberos 5 can connect to IMAP servers without any other password prompts.
Before You Begin
For both clients, you must disable the mail server from downloading mail to your AFS space every time you log in.
Currently, UNIX mail clients are configured to download mail from the mail servers to the your AFS space upon launch and then delete the mail from the server. This behavior is not right for IMAP so it has to be disabled. Otherwise, your email could not be read with other email clients, and on other computers.
To disable the mail server from downloading the mail to your AFS space on launch, run the following command:
hedge06:~> unsetenv LELAND_ENV
This disables the trigger that downloads your mail via KPOP. You don't have to do this step if you are not using a cluster machine.
Note: You can avoid having to run the unsetenv command manually during each login by adding it to the .cshrc shell configuration file located in your AFS home directory. Simply append the unsetenv LELAND_ENV command to the end of the file. After editing the file once, the command will be run automatically at the beginning of each new login session.
At this point, client configuration files need to be edited to get them to connect to the right IMAP server.
Configuring Pine for IMAP
Open the text file .pinerc, located in your AFS home directory, and find the following lines:
inbox-path=
folder-collections=
Edit these lines, replacing occurrences of sunetid with your own SUNet ID, to read:
inbox-path={sunetid.pobox.stanford.edu/ssl/novalidate-cert/user=sunetid}Inbox
folder-collections={sunetid.pobox.stanford.edu/ssl/novalidate-cert/user=sunetid}[], ~/Mail/[]
If you would like to use your Zimbra Sent and Drafts folders for sent and postponed messages in Pine, also locate the following lines:
default-fcc=
postponed-folder=
Edit these lines, as above, to read:
default-fcc={sunetid.pobox.stanford.edu/ssl/novalidate-cert/user=sunetid}Sent
postponed-folder={sunetid.pobox.stanford.edu/ssl/novalidate-cert/user=sunetid}Drafts
After changing the configuration, Pine's new default inbox will be your Zimbra Inbox, but existing local folders will still be accessible from the folder list.
Configuring Mutt for IMAP
Open the text file .muttrc, located in your AFS home directory. If .muttrc, does not exist, create it. Add the following lines, replacing occurrences of sunetid with your own SUNet ID:
set spoolfile=imaps://sunetid.pobox.stanford.edu/Inbox
set folder=imaps://sunetid.pobox.stanford.edu/
set imap_user=sunetid@stanford.edu
If you would like to use your Zimbra Sent and Drafts folders for sent and postponed messages in Mutt, also add the following lines, as above:
set record=imaps://sunetid.pobox.stanford.edu/Sent
set postponed=imaps://sunetid.pobox.stanford.edu/Drafts
After changing the configuration, Mutt's new default inbox will be your Zimbra inbox; please note that it is difficult to access existing local folders with Mutt while using this configuration.


