Pine & Alpine

Before you begin configuring Pine (or Alpine) to access a user's Google Mail Account, you must first Enable IMAP Access on the account. Once this is done, you should also identify the user as an Archiver or Deleter. This is important because how they choose to handle messages when they are marked for deletion (i.e. archive, move to Trash, or expunge immediately) will impact how they manage their mail across other IMAP client(s) they may use, and how the client(s) should be configured.

We have provided the recommended Pine settings for both Archivers and Deleters below. These were configured and tested on the CAEN Linux login serverlogin.engin.umich.edu.

Configuring Pine for Archivers

Use the settings listed below to configure Pine for an Archiver. Make sure to leave Auto-Expunge on when enabling IMAP Access.

Connecting to Google Inbox
  1. Start pine.
  2. Press s for Setup, then c for Config.
  3. Use the down arrow key to highlight Inbox Path, and press c for Change Val.
  4. Enter the following, where uniqname is the user's U-M uniqname, and press Enter:  {imap.gmail.com:993/ssl/user=uniqname@umich.edu}Inbox
  5. Press e for Exit, and y to commit changes.
Now, each time the user starts pine, they will be prompted to log in with their UMICH.EDU Kerberos password. Note that when the user is prompted to enter their password, the server will now have a name similar to yx-in-f108.1e100.net. This is normal.

Connecting to Google IMAP Folders
  1. From the pine main menu, press s for Setup, then L for collectionLists.
  2. Press a to add a collection.
  3. Enter something in the Nickname to designate it as the U-M Google Account.
  4. Enter the following for the Server, where uniqname is the user's U-M uniqname: imap.gmail.com:993/ssl/user=uniqname@umich.edu
  5. Leave Path blank.
  6. The View field is where you will designate how many levels of nested labels the user has. This is done using the * symbol, separated by the / symbol. For example, if they had three levels of nested folders, you should set this to: */*/*
  7. Press Ctrl-X to exit and save changes, and e to return to the main menu.
Setting Default IMAP Folders
  1. From the pine main menu, press for Setup, then for Config.
  2. Change the following values to match the default values for Google, where uniqname is the user's U-M uniqname:
  • SMTP Server (for sending)          = smtp.gmail.com:587/tls/user=uniqname@umich.edu
  • Default Fcc (File carbon copy)    = {imap.gmail.com:993/ssl/user=uniqname@umich.edu}Sent Mail
  • Default Saved Message Folder    = {imap.gmail.com:993/ssl/user=uniqname@umich.edu}All Mail
  • Postponed Folder                      = {imap.gmail.com:993/ssl/user=uniqname@umich.edu}Drafts
  • Trash Folder                              = {imap.gmail.com:993/ssl/user=uniqname@umich.edu}Trash
Note: Setting Default Saved Message Folder to All Mail is the equivalent of archiving a message; all labels are removed.

Configuring Pine for Deleters

Deleters should use the same settings listed above for Archivers, with a few changes depending on how they want to delete:
  • Move to Trash: Make sure to set Auto-Expunge off and select Move the message to the Trash when enabling IMAP Access.
  • Expunge Immediately: Make sure to set Auto-Expunge off and select Immediately delete the message forever when enabling IMAP Access.
In addition, Deleters will need to hide the All Mail folder from Pine. All Mail is always the "last visible IMAP folder" since it is where one views archived messages (i.e. messages with no labels):
  1. In the Google Mail settings, click Labels.
  2. Next to the All Mail label, uncheck the Show in IMAP box:

Now the user will not be able to archive messages via Pine. All Mail is now invisible, so they can't move messages to it via IMAP. This also means they will need to choose a different Default Saved Message Folder. All Mail will still be accessible via the web interface.



Appendix: Settings as listed in the ~/.pinerc file

# List of SMTP servers for sending mail. If blank: Unix Pine uses sendmail.
smtp-server=smtp.gmail.com:587/tls/user=uniqname@umich.edu

# Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox
# Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER).
inbox-path={imap.gmail.com:993/ssl/user=uniqname@umich.edu}Inbox

# Over-rides default path for sent-mail folder, e.g. =old-mail (using first
# folder collection dir) or ={host2}sent-mail or ="" (to suppress saving).
# Default: sent-mail (Unix) or SENTMAIL.MTX (PC) in default folder collection.
default-fcc={imap.gmail.com:993/ssl/user=uniqname@umich.edu}Sent Mail

# Over-rides default path for saved-msg folder, e.g. =saved-messages (using 1st
# folder collection dir) or ={host2}saved-mail or ="" (to suppress saving).
# Default: saved-messages (Unix) or SAVEMAIL.MTX (PC) in default collection.
default-saved-msg-folder={imap.gmail.com:993/ssl/user=uniqname@umich.edu}All Mail

# Over-rides default path for postponed messages folder, e.g. =pm (which uses
# first folder collection dir) or ={host4}pm (using home dir on host4).
# Default: postponed-msgs (Unix) or POSTPOND.MTX (PC) in default fldr coltn.
postponed-folder={imap.gmail.com:993/ssl/user=uniqname@umich.edu}Drafts

# If set, specifies where trash is moved to in Web Alpine.
trash-folder={imap.gmail.com:993/ssl/user=uniqname@umich.edu}Trash

# List of directories where saved-message folders may be. First one is
# the default for Saves. Example: Main {host1}mail/[], Desktop mail\[]
# Syntax: optnl-label {optnl-imap-hostname}optnl-directory-path[]
folder-collections=U-MGoogle {imap.gmail.com:993/ssl/user=uniqname@umich.edu}[*/*/*]