Alpine

From Peyton Hall Documentation

Revision as of 17:47, 8 May 2007 by Huston (Talk | contribs)
Jump to: navigation, search
This article is actively undergoing a major edit for the afternoon -- huston 12:25, 8 May 2007 (EDT).

As a courtesy, please do not edit this page while this message is displayed. The person who added this notice will be listed in its edit history or has placed their signature above.

If this page has not been edited recently (several hours!), please remove this template (or replace it with {{underconstruction}}).

This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to improve this page.

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


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.


Exporting email

So you're leaving the department, or going somewhere and you want to bring all your mail with you? Not a problem. While you cannot login to the mail server and copy the files off (and if you could, they would do you no good as they're in an indexed database), you can export your folders to text files for transport. Here's how:

Start by opening a folder in Pine. Then press ';' to select messages, and 'a' to select all. Then, press 'a' to apply a command to the selected messages, and 'e' to export the messages. Lastly, type a filename to export the messages to. All the messages in the folder will be exported to the file you named, in 'mbox' text format. While this may be large, it's easily compressable, so once you've done this for all your mail folders you can use 'tar' to compress them all to a rather small size.

Repeat this for your other mail folders, including your inbox, and you'll have all your email in an easily-importable text format that you can take with you wherever you go! A good idea if you're leaving the department is to have your mail forwarded to the new location *before* you do this, and make sure it works. This way no new mail will arrive in your mailbox, so once you've done the above steps you can guarantee that all your mail is at your new location, between what was saved on the server and what has arrived since you started the export.

Another good trick, after you've verified that the mail has been exported, is to (while still in the same window with all messages flagged with an X) press 'a' to apply, and 'd' to delete. This will remove all the messages from the server. Make sure they have been properly exported to the text file, though, as they may not be recoverable after this action!

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.

Personal tools