Alpine

From Peyton Hall Documentation

(Difference between revisions)
Jump to: navigation, search
m (Categorizing)
Current revision (17:41, 20 April 2010) (view source)
m (Pointed the mail forwarding question to the new mail forwarding section of the SmartSieve article.)
 
(8 intermediate revisions not shown.)
Line 1: Line 1:
Pine is a text-based [[Email|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).
Pine is a text-based [[Email|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).
 +
{{update}}
Line 65: Line 66:
==== Campus address book ====
==== Campus address book ====
-
You can access the campus-wide address book by adding the Princeton LDAP server to your address book lists:
+
You can access the campus-wide address book by adding the Princeton [[LDAP]] server to your address book lists:
# Go to the (M)ain Menu, then (S)etup.
# Go to the (M)ain Menu, then (S)etup.
# Press (D) for Directory
# Press (D) for Directory
Line 78: Line 79:
#*: Enables you to add "Steve Huston" in your local address book, aliased to "sysman", and when you type "sysman" in the To field it'll perform an address lookup on "Steve Huston".
#*: Enables you to add "Steve Huston" in your local address book, aliased to "sysman", and when you type "sysman" in the To field it'll perform an address lookup on "Steve Huston".
#* <tt>save-search-criteria-not-result</tt>
#* <tt>save-search-criteria-not-result</tt>
-
#*: When you save an LDAP-looked-up entry into your local address book, it saves the criteria you used to find that address instead of the result of the lookup.  Both this and lookup-addrbook-contents cover the case when someone's email address might change, by looking it up every time instead of keeping a static entry you're guaranteed to have the right address.
+
#*: When you save an [[LDAP]]-looked-up entry into your local address book, it saves the criteria you used to find that address instead of the result of the lookup.  Both this and lookup-addrbook-contents cover the case when someone's email address might change, by looking it up every time instead of keeping a static entry you're guaranteed to have the right address.
==== Department address book ====
==== Department address book ====
-
To setup the department LDAP server for address book lookups, follow the same procedure as above with these changes:
+
To setup the department [[LDAP]] server for address book lookups, follow the same procedure as above with these changes:
* <tt>ldap-server = ldap.astro.princeton.edu</tt>
* <tt>ldap-server = ldap.astro.princeton.edu</tt>
Line 89: Line 90:
==== Using Both ====
==== Using Both ====
-
If you add both directories to Pine, you should probably set the Astro LDAP server as the first in the list (using the $ (shuffle) command). This way, Pine will check your local ~/.addressbook first, followed by the department LDAP directory, and then the Princeton LDAP directory last.
+
If you add both directories to Pine, you should probably set the Astro [[LDAP]] server as the first in the list (using the $ (shuffle) command). This way, Pine will check your local ~/.addressbook first, followed by the department LDAP directory, and then the Princeton LDAP directory last.
-
 
+
Line 99: Line 99:
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.
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:
 +
# Go to "'''S'''"etup.
 +
# Collection "'''L'''"ists.
 +
# "'''A'''"dd collection.
 +
## Type a nickname for this collection; perhaps "home" or "personal".
 +
## Enter the name of the IMAP server you wish to add.
 +
## The "Path" is where the folders for this mail server are located - Pine should fill in a sensible value for you.
 +
## You can likely leave "View" blank; press Ctrl-G to see what it does.
 +
# 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:
 +
# Go to "'''S'''"etup.
 +
# Collection "'''L'''"ists.
 +
# "'''A'''"dd collection.
 +
## Type a nickname for this collection; perhaps "home" or "personal".
 +
## Leave the server field blank.
 +
## The "Path" is where the mbox files live; if they are in ~/old-mbox/ for example, fill that value in for this field.
 +
## You can likely leave "View" blank; press Ctrl-G to see what it does.
 +
# Ctrl-X to save changes
Line 105: Line 132:
'''NOTE:'''
'''NOTE:'''
-
: 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 [[Websieve#Forwarding email|this article]] for more information.
+
: 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 [[SmartSieve#Forwarding_mail_to_another_account|this article]] for more information.
Line 120: Line 147:
==== Transferring email ====
==== Transferring email ====
-
{{cleanup|May 2007}}
 
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.
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.
-
# Configure Pine to access both mail systems
+
# Configure Pine to access both mail systems ([[#Configuring additional IMAP servers|see above]])
# Open a folder on the source system
# Open a folder on the source system
# Press '<tt>;</tt>' to select messages, and '<tt>a</tt>' to select all.
# Press '<tt>;</tt>' to select messages, and '<tt>a</tt>' to select all.
# Press '<tt>a</tt>' to apply a command to the selected messages, and '<tt>s</tt>' to save
# Press '<tt>a</tt>' to apply a command to the selected messages, and '<tt>s</tt>' to save
# Choose the destination folder
# Choose the destination folder
 +
 +
 +
=== I ran pine but got alpine instead; why? ===
 +
The [http://www.washington.edu/ University of Washington], who originally developed and maintained [http://www.washington.edu/pine/ pine], has completely rewritten it from the ground up. Due to trademark and licensing changes, they have called the new product [http://www.washington.edu/alpine/ 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:
 +
# From the pine main menu, hit <tt></tt> for setup
 +
# Hit <tt>C</tt> for configuration
 +
# Find the line beginning with "Index Format" (hint: use "W" to search for it!).
 +
# Hit Enter to edit the field, and paste the following into it:
 +
#: <tt>STATUS MSGNO DATE FROMORTO(33%) SIZE SUBJKEY(67%)</tt>
 +
# Hit Enter
 +
# Hit <tt>E</tt> to exit
 +
# Hit <tt>Y</tt> to save the changes.
[[Category:Email]]
[[Category:Email]]
[[Category:Software]]
[[Category:Software]]
 +
[[Category:Unix Commands|pine]]

Current revision

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).

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.


Contents

Introduction

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 http://www.washington.edu/pine/.


FAQ

Pine has its own FAQ at its homepage, http://www.washington.edu/pine/faq/index.html. 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/pineedit.sh'. I then created this shell script which contains:

#!/bin/bash
if [ "$DISPLAY" == ":0" ] || [ "$DISPLAY" == ":0.0" ] ; then
   gvim -rv -f -geometry 100x50+0+0 $1
else
   vim -f $1
fi

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 access the campus/department address book?

You may have noticed when you type a local email address in Pine and move off the "To" field, it will look up and find the person's full name to fill in the field nicely. But what if you're not sure about someone's email address? You can have Pine look it up in the campus or department address books.


Campus address book

You can access the campus-wide address book by adding the Princeton LDAP server to your address book lists:

  1. Go to the (M)ain Menu, then (S)etup.
  2. Press (D) for Directory
  3. (A)dd a new directory.
  4. Set the following options:
    • ldap-server = ldap.princeton.edu
    • search-base = o=Princeton University,c=US
    I like to turn on the first three features there also:
    • use-implicitly-from-composer
      If you type a name in the To, CC or BCC fields that doesn't resolve to a local user it'll look up that name in the address book (handy when you can't remember someone's email address, or the spelling of their last name, "Bill" will return all kinds of Bills in the address book and you can select which one you want).
    • lookup-addrbook-contents
      Enables you to add "Steve Huston" in your local address book, aliased to "sysman", and when you type "sysman" in the To field it'll perform an address lookup on "Steve Huston".
    • save-search-criteria-not-result
      When you save an LDAP-looked-up entry into your local address book, it saves the criteria you used to find that address instead of the result of the lookup. Both this and lookup-addrbook-contents cover the case when someone's email address might change, by looking it up every time instead of keeping a static entry you're guaranteed to have the right address.


Department address book

To setup the department LDAP server for address book lookups, follow the same procedure as above with these changes:

  • ldap-server = ldap.astro.princeton.edu
  • search-base = ou=People,dc=astro,dc=princeton,dc=edu


Using Both

If you add both directories to Pine, you should probably set the Astro LDAP server as the first in the list (using the $ (shuffle) command). This way, Pine will check your local ~/.addressbook first, followed by the department LDAP directory, and then the Princeton LDAP directory last.


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.

NOTE:

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:
    STATUS MSGNO DATE FROMORTO(33%) SIZE SUBJKEY(67%)
  5. Hit Enter
  6. Hit E to exit
  7. Hit Y to save the changes.

Personal tools