From Peyton Hall Documentation
Jump to navigation Jump to search

Pine is a text-based email client which is supported in Peyton Hall. Though there is no GUI, it has features which make it perfectly acceptable for daily use (and many use it exclusively).

Current event marker.svg This article or section needs to be updated.
Parts of this article or section have been identified as no longer being up to date.
Please update the article to reflect recent events, and remove this template when finished.


What is Pine?

Pine (which either stands for "Pine Is Not Elm" or "Program for Internet News and E-mail" depending on who you ask) is a full-featured text-based email client. It supports IMAP and POP3 Internet mail protocols, as well as mbox and #mh style local folders. As configured in Peyton, just running pine at a prompt will ask for your user name and password, and connect you to your IMAP mailbox on mail.astro. Pine is configured to run on every Unix/Linux machine in the building.

If you have a Unix laptop that is not administered by us, or a Windows PC and wish to run Pine on it, you can install Pine there as well.

Where to get Pine

If you wish to download and install a copy of Pine (for example, on your laptop or home computer), the University of Washington Pine information center is where you need to get it. Their web page is


Pine has its own FAQ at its homepage, What follows are some FAQs pertaining specifically to Peyton Hall.

Can I use a different editor?

While 'pico' has a few features, it's sometimes nice to use your own editor instead. Here's how you set that up:

  1. Go to the Configuration Menu (Setup -> Config from the Main Menu).
  2. Turn on the options "enable-alternate-editor-cmd" and "enable-alternate-editor-implicitly" (The first to allow the use of an alternate editor, the second to use it without asking).
  3. At the bottom, select the "editor" config option and type the name of the editor you wish to use.
    NOTE: The editor should not return a command line until you're actually done editing the message (ie, 'gvim' should be called with the '-f' option to keep it from fork()ing to the background).

A trick that I use is to tell Pine to run the command '~/bin/'. I then created this shell script which contains:

if [ "$DISPLAY" == ":0" ] || [ "$DISPLAY" == ":0.0" ] ; then
   gvim -rv -f -geometry 100x50+0+0 $1
   vim -f $1

This way, if I'm running Pine on the local computer, 'gvim' will open as the editor; but if I'm running it remotely ($DISPLAY will not be equal to :0) then 'vim' will be the editor instead.

Can I send Blind Carbon Copies?

Yes! To send a Blind Carbon Copy in Pine (meaning someone will get a copy of the message, but the other recipients will not be aware of it), press Ctrl-R (for "Rich Headers"). One of the additional headers now displayed is "BCC". Enter the address in this line as you would "To" or "CC".

How can I perform actions on attachments?

A common issue with Pine (and any other mailer for that matter) is how it reacts to attachments. Attachments are handled based on their MIME-type, and how they're handled is defined in a mailcap file. One copy of this file is usually in /etc/mailcap, while another can reside in your home directory as a dotfile (~/.mailcap). The mailcap file tells pine that if it sees an attachment of type X, it should execute Y on it. For example:

application/postscript ; gv %s

This will tell Pine that if it sees a file of type "application/postscript", and you tell Pine to open the file, it will do so by calling 'gv' with the name of the file (Pine will have saved a copy to /tmp and pass that as the parameter '%s'). For another example:

application/msword ; /usr/peyton/bin/soffice %s \; echo Displayed via OpenOffice ; description="Display via OpenOffice"

Add this to your ~/.mailcap file, and when you hilight a MS Word document in Pine and select "open", Pine will save the file to /tmp and run OpenOffice to open it.

You can adapt this method to open any kind of file with any particular program. Have a look in /etc/mailcap for some examples. Also, see the Pine FAQ entry regarding MIME association.

Selecting and pasting doesn't work

Most Unix people are used to using the mouse to highlight any text on the screen, and paste it with a middle mouse click (or left and right buttons simultaneously for 2 button mouse users). You *can* still do this in Pine, however you must hold down the Shift key first. This is because Pine can handle receiving mouse clicks within an xterm (so you can click on the "buttons" at the bottom, where the key options are listed). Pressing shift first tells Pine you mean to highlight text, not click on it.

You can turn off the behavior of having to hold Shift to copy text (and also turn off the ability to use the mouse to click on objects in Pine) by turning off the config option "enable-mouse-in-xterm".

How do I send email in the background?

If you'd like Pine to appear to run faster, you can turn on the option "enable-background-sending" in the Main -> Setup -> Config screen. This will not actually make things faster, just appear that way - Pine will send the message in the background while you do other things.

While you're hovered over the option, press '?' once or twice to bring up the help for the option, and read the caveats there. There's a few issues which could bite you later by turning this on (mostly with seeing error messages, since Pine isn't sending the mail in real-time where it can show you the error).

When turning on this option, all it does is make available one new keystroke in the send dialog. When you press Ctrl-X to send, and get the "Send message?" prompt, you can then press Ctrl-R to send in the background. If you have "send-without-confirm" turned on, this option does nothing.

Configuring additional collections

Adding another IMAP server

You can easily configure Pine to access multiple IMAP servers so that you can read mail from more than one place at a time. Starting from the main menu screen:

  1. Go to "S"etup.
  2. Collection "L"ists.
  3. "A"dd collection.
    1. Type a nickname for this collection; perhaps "home" or "personal".
    2. Enter the name of the IMAP server you wish to add.
    3. The "Path" is where the folders for this mail server are located - Pine should fill in a sensible value for you.
    4. You can likely leave "View" blank; press Ctrl-G to see what it does.
  4. Ctrl-X to save changes

Now when you go to the "L"ist of folders, you'll be asked which collection you wish to view. You can also change collections while saving messages, so you can save emails across IMAP servers (or transfer them from one to the other).

Adding a local collection (mbox files)

Just like adding another IMAP server, but leave the server field blank and fill in the directory where the mbox files live:

  1. Go to "S"etup.
  2. Collection "L"ists.
  3. "A"dd collection.
    1. Type a nickname for this collection; perhaps "home" or "personal".
    2. Leave the server field blank.
    3. The "Path" is where the mbox files live; if they are in ~/old-mbox/ for example, fill that value in for this field.
    4. You can likely leave "View" blank; press Ctrl-G to see what it does.
  4. Ctrl-X to save changes

Exporting email

If you want to export your mail - for example, if you're leaving the department - there's a few ways to do it. Since you cannot login to the mail server to get to your messages (and it wouldn't do much good if you could due to how they're stored), you can use Pine to retrieve them for you.


If you're exporting your email because you're leaving, you may wish to have your mail forwarded first so that no new messages appear while you're trying to clean out your mailbox. See this article for more information.

Exporting mbox files

If you want to save your emails into a flat file ('mbox' format, readable by most mail clients), do the following:

  1. Open a folder in Pine
  2. Press ';' to select messages, and 'a' to select all.
  3. Press 'a' to apply a command to the selected messages, and 'e' for export.
  4. Supply a filename to store the messages.
  5. Repeat for your other mail folders, including the inbox.

Another method for doing the same thing is to use the program Fetchmail to pull all your mail off the server in one shot. One advantage to this is you can tell it to do multiple folders simultaneously. Please see Fetchmail for more information on this.

Transferring email

Instead of saving the messages to flat files, if both the source mail server and destination server have IMAP capabilities, you can have Pine transfer the mails for you.

  1. Configure Pine to access both mail systems (see above)
  2. Open a folder on the source system
  3. Press ';' to select messages, and 'a' to select all.
  4. Press 'a' to apply a command to the selected messages, and 's' to save
  5. Choose the destination folder

I ran pine but got alpine instead; why?

The University of Washington, who originally developed and maintained pine, has completely rewritten it from the ground up. Due to trademark and licensing changes, they have called the new product alpine. While under the hood it's been changed significantly, the UI should function similarly to pine.

How do I see literal dates (May 5) instead of relative dates (Today, Yesterday)?

As of the transition from pine to alpine, you may have noticed the date display in the message index has gotten prettier. If you prefer the old-style formatting, do the following:

  1. From the pine main menu, hit for setup
  2. Hit C for configuration
  3. Find the line beginning with "Index Format" (hint: use "W" to search for it!).
  4. Hit Enter to edit the field, and paste the following into it:
  5. Hit Enter
  6. Hit E to exit
  7. Hit Y to save the changes.