Deflexion.com blog >> 
Join the conversation >>
 

[Infinite Ink logo]

POWER PINE®
Getting the Most Out of Unix-, Mac-  & PC-Pine

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright © Nancy McGough & Infinite Ink
Last modified 10-Dec-2007

 

MetaNote   I wrote this Power Pine page for someone who wants to really understand the inner workings of Pine, the multi-platform POP, IMAP, NNTP, & ESMTP client, and take advantage of its power features. A lot of the instructions in this article depend on discussion that comes earlier, so if you are having trouble following the instructions, please go back and read the earlier parts of the article.

Version MetaNote   The current released version, Pine 4.64, was released 28 September 2005. The current testing version, Alpine 0.999999, was released 6 December 2007.

Searching MetaNote   You can use this form to search the web, the Infinite Ink site, or the Deflexion.com site (my blog) for more information about Alpine or Pine (or about anything!).

 
Web
Infinite Ink
Deflexion.com

 

 

[New!] News MetaNote   The Alpine- and Pine-related news items that used to be posted here are now posted on my Deflexion.com blog with the label ALPINE. (Alpine is Pine's new name.)

 

 


 On This Page 

 

 

What is PC-Pine?

PC-Pine is Unix Pine that the University of Washington Pine team ported to Microsoft's platforms. Versions 4.0 and later — the latest version is 4.64 — are 32-bit and run on Windows 95 and later (98, Me, NT, 2000, XP, etc). Versions 3.96 and earlier are 16-bit and run on all versions of Microsoft Windows and on DOS. In addition to supporting the Unix keyboard shortcuts, PC-Pine has a menu bar with drop-down menus, dialog boxes, clickable buttons, clickable key-menu commands, clickable messages in the Message Index, clickable URLs & web-hostnames, clickable attachments, right-click pop-up menus, scroll bars, and supports cutting, copying, & pasting using the Windows clipboard.

 

Why Use PC-Pine

PC-Pine versus Other Windows Mail Clients

In addition to the many reasons to use Pine that I list on the Infinite Ink main Pine page, MS Windows users have the additional reason that there is no other Windows mail client that I know of that is as powerful and customizable as PC-Pine is. The area that Pine really shines — compared to other MS Windows mail clients — is:

 

 Security and Privacy 

 

Unlike Unix mail clients, most MS Windows mail clients do not give users a lot of control over how message headers, message bodies (plain, enriched, or HTML), and attachments are displayed. This lack of control makes you vulnerable to attachments containing viruses and “bugged” HTML messages. I discuss these in Security and Privacy Features on the Infinite Ink main Pine page.

Some ways to secure Pine and your system are described in the Privacy and Security section below. I describe some areas where I think Pine needs to be improved in the Pine Security-Enhancement Wishes section of my main Pine page.

 

PC-Pine versus Unix Pine in an SSH Window

Many people have an account on a Unix system and happily use Pine by SSH'ing from their Windows machine to a Unix machine and running Unix Pine in an SSH window. If your machine is running Windows 95 or higher, there are many reasons you might want to use PC-Pine rather than Unix Pine in an SSH window.

 

Advantages of PC-Pine

With PC-Pine you can:

  1. avoid typing your server passwords by storing them on your PC (you should do this only if your PC is not accessible to spies)
  2. double click (or press the ENTER key) on a URL or web-hostname and have it open in a web browser on your PC (details are in Step 6E, url-viewers, below)
  3. use your mouse to run Pine commands
  4. easily attach a file that is on your PC to a message that you are sending
  5. easily view an attachment using a program that runs on your PC (for example, view a Microsoft Word attachment using Word Viewer)
  6. easily export an attachment to your PC's file system
  7. type your messages in a local text editor without having to wait for the delay caused by your ssh client transporting your keystrokes to the editor running on your Unix host
  8. postpone a message to a folder on your local PC and work on it when you are not connected to the Net
  9. read and process messages and attachments that you've saved to your local PC
  10. use the Windows clipboard and PC-Pine's Select, Select All, Cut, Copy, Copy Append, and Paste to move text between PC-Pine and other windows open on your PC
  11. have multiple instances of PC-Pine running and switch between them using the Windows Taskbar
  12. get notification about new messages in the Windows Taskbar
  13. have better international character-set handling
  14. right click on a message in the Pine MESSAGE INDEX and choose from a list of message-specific commands, for example you can flag the message or open the message in a separate window

 

Disadvantages of PC-Pine

Disadvantages of using PC-Pine rather than using Unix Pine in a telnet/ssh window include the following.

  1. The PC-Pine default folder format is c-client MBX, which means that you can't easily use tools and other messaging clients that are designed to use Unix mail spool mailbox format (mbox). For more about this see my #4 Pine Wish: Let Pine Users Choose Their Default Local Mailbox Format on the Infinite Ink main Pine page.
  2. Starting with Pine 4.0, the PC-Pine source code is not available to general users so you cannot patch the code or use the Pine patches that other people create.
  3. Your PC needs to have access to SMTP and NNTP servers that let you send messages using all your roles. AOL, for example, does not give their users direct access to the AOL SMTP server, the AOL NNTP server, or to any port 25 SMTP server (because they hijack outbound port 25 requests). You may be able to get around this by either using SSH port forwarding to tunnel your SMTP requests to another ISP or by reading the Unofficial AOL Email FAQ, especially the part about using a third-party email program.
  4. If you like to multitask and you have a machine with a slow processor, not much memory, and a slow connection to the Net, you are probably better off using Pine in an ssh window and saving your sytem's resources and bandwidth for your other tasks, such as surfing the web.

In the next section, I describe how you can get many of the advantages of PC-Pine and not have the first two disadvantages that I list above.

 

PC-Pine versus Pine on “Unix on Windows”

With Pine running on one of the Unix-on-Windows packages, such as Cygwin, you can run Pine on your PC and not have disadvantage #2 above, i.e., you can view and patch the Pine source code. The disadvantages of Pine on Unix on Windows are that 1) you need to install a Unix-on-Windows package and 2) you don't get all the GUI-ness that you get with PC-Pine. Depending on your needs, this might be the right option for you. I have links to Cygwin Pine, U/Win Pine, & more on the Infinite Ink main Pine page.

Note     According to this 2004-Dec-10 comp.mail.pine message by Mark Crispin, “No mailbox format except for [c-client] mbx works in Cygwin.”

 

 

Before You Begin

PC Requirements

This article describes how to set up PC-Pine 4.64 on a system running Microsoft Windows 95 or higher. These instructions do not work for earlier versions of PC-Pine and need to be modified for Windows NT, 2000, and XP (this is noted below).

Server Requirements and Server Information Needed

Pine was designed to be an IMAP client so if your mail is not delivered to an IMAP server, you probably do not want to use PC-Pine as your primary mail client.

Tip     If you are looking for an ISP that supports IMAP, see my IMAP Service Providers page, which includes lots of IMAP tips, a growing lists of reasonably-priced & free IMAP service providers, and instructions for setting up Pine to access the INBOX and mailstore at each of these providers.

In order to set up PC-Pine you need the following information:

If you will use Pine as an NNTP client, you also need to know:

And finally it is useful to know:

If you can not find the answer to these questions on your ISP's web pages, ask in an appropriate local discussion group, i.e., a discussion group that is for discussion among users of your ISP. If you can't find the answers in your ISP's web pages or in their local discussion groups, send these questions to your ISP's technical support. Be forewarned that some ISPs do not (yet) understand IMAP and do not know that PC-Pine exists.

 

Terminology and Typographic Conventions Used in This Article

I use a fixed-width font for text that is displayed on your computer, text that is meant to be typed, and names of files. Variables and names that depends on your settings are formatted in italics.

Most Pine commands are not case sensitive so if I say “To go to the Main Menu, type M,” you can type either M or m. Some non-alphabetic characters work without holding down the SHIFT key. For example, if I say “To go to the parent screen, type <” you can type either < (less than) or ,(comma). Some non-alphabetic characters do require the SHIFT key. For example, to use the flag command you need to type * (SHIFT-8). Just typing 8 will not invoke the flag command.

Some Pine commands are issued by pressing the CTRL key and while holding it down, typing a character. For example, to get Pine context-sensitive help, type CTRL-G. CTRL-G is abbreviated ^G and in general CTRL-X is abbreviated ^X. Usually you do not need to hold down all three keys (the CTRL key, the SHIFT key, and the character); just the CTRL key and the unshifted character will do. For example, to set a mark in Pico you can type either CTRL-6 or CTRL-^ (“control caret”). And to get Pine context-sensitive help you can type either CTRL-G or CTRL-g. An exception is CTRL-_ (“control underscore”), which launches an alternate editor. For this command you need to press CTRL-SHIFT-_.

Often there are many ways to issue a Pine command. I usually give only one way but you can sometimes find another equivalent command by looking at the key menu at the bottom of the Pine screen or by consulting Pine's context-sensitive Help by typing ^G.

If I am writing about the Microsoft Windows world, I use %HOME% to mean whatever is specified by the HOME environment variable. If I am writing about the Unix world or about many worlds (e.g., Unix and MS Windows), I use $HOME to mean whatever is specified by the HOME environment variable.

I use the word directory for a place on a computer disk where files and possibly other directories, called subdirectories, are stored. I use mailbox, folder, or message folder for a place on a computer disk where Pine stores messages. I hope the following paragraph illustrates the use of these terms.

PC-Pine was created back in the days when the name of a DOS or MS-Windows file was limited to eight characters followed by a period and a three-character extension. Because of this, the PC-Pine default folder names contain eight characters or fewer. For example, the PC-Pine default is to put a message that you postpone into a folder named “postpond.” The default location for this folder — and all PC-Pine default folders — is your %HOME%\mail directory.

A special folder name is INBOX. You might not have a folder that is actually named INBOX. INBOX is an abbreviation for whatever you or your system administrator has specified as your primary incoming folder on the IMAP server. When the name INBOX is used in an IMAP client, it is case-insensitive so it is fine to write INBOX, inbox, Inbox, or any other combination of lower and upper case.

 

See Also

For more about these and other email-related terms, see:

 

 

Configuration Overview

Default Files and Directories

The easiest way to set up PC-Pine is to unzip pmxxxw32.zip into a directory, double click on pine.exe, and leave all Pine-related files and directories in their default locations. The defaults, which are discussed in the Pine man page and Support Files, Environment Variables, and Registry Settings: PC-Pine, are as follows.

File Default Location
all local mailboxes (aka “folders”)
sentmail mailbox
savemail mailbox
postpond mailbox
intruptd mailbox

the primary folder collection, which defaults to %HOME%\mail

(if %HOME% is not defined, the root of the current drive, for example C:\, is considered to be %HOME%)

remote IMAP-accessible mailboxes not set; to specify this, see Setting IMAP, NNTP, and Local Collections below

pinerc
spell32.dll

pine.exe directory
dict.u

spell32.dll directory

pinercex (pinerc exceptions; available in 4.30+)
addrbook
*.lu
(addrbook lookup)
a*
(abook hash files?)
.ab*
(more abook hash files?)
pine.sig
pinedebg.txt
pineDBGN.txt

mailcap (cannot be created from within pine)
mimetype (cannot be created from within pine)
PASSFILE, e.g. pine.pwd (cannot be created from within pine)
newsrc (if it does not exist in %HOME%)

pinerc directory
deadletr
newsrc
(if it already exists in this directory)
%HOME%
newsrc.old newsrc directory
mailbox.lock files

mailbox directory

C!!MyHome!Msgs!mailbox (lock file for C:\MyHome\Msgs\mailbox) %WINDIR%\Temp (4.31 and later)
%WINDIR% (4.30)
%TEMP% (4.21 and earlier)
mapi_debug.txt (needs to be created by user; new in 4.30) %TEMP%

pi* (pico temp files)
msgNN (??)

%TMP%
aeN.txt (alternate editor temp files) %TMPDIR%

 

After a lot of experiments, I have decided that I like to keep the Pine program files and my Pine user-specific files in separate directories; and I like my user files to go in a subdirectory of my “home” directory. In the next five sections I discuss Pine configuration files and explain why I set things up the way I do.

Trivium     The rc in pinerc and newsrc is a Unix naming convention that stands for either runtime configuration, runlevel change, or run commands (take your pick!). Thanks to Richard Smith, the maintainer of geekrave.org, for telling me he thinks of rc as runtime configuration; Elmar Hinz for telling me he thinks of it as runlevel change; and Imperial College for FOLDOC, the Free On-Line Dictionary Of Computing, and its definition and history of rc.

 

How PC-Pine Finds User Files

As you can see in the table above, most Pine user files reside in the directory that the pinerc file is in. PC-Pine finds the pinerc file by looking at:

  1. the -p command-line argument
  2. The PINERC environment variable (%PINERC%)
  3. %HOME%\Pine\pinerc
  4. pine.exe directory\pinerc
  5. the Windows registry value in HKEY_CURRENT_USER\Software\University of Washington\PC-Pine\4.0\PineRC (see Checking, Clearing, and Resetting Pine's Registry Settings below)

The first one in this list that exists is what Pine uses as the pinerc file. All user files listed in the fifth (green) row of the table above are read from and written to the directory that the pinerc file is in. More details about where PC-Pine looks for user files is at:

I prefer to use Pine configuration method #3 (%HOME%\Pine\pinerc) and in the next few sections I discuss why. In Setting Environment Variables below, I walk you through setting up a HOME environment variable & directory, and a “Pine” subdirectory.

 

Why Separate Program Files and User Files?

Separating program files and user files is generally a good idea because it makes it easy to

Separating these files is an example of modular architecture.

 

Why Put User Files in a “Home” Directory?

Another key feature of my PC-Pine configuration is that I put my Pine user files in a subdirectory named Pine in my “home” directory. Using a home directory is useful because:

 

Naming Directories

If you are going to use the Pine configuration that I use, you can name your Pine program files directory, messages directory, and “Home” directory anything you like. However, your Pine user-files directory must be named Pine and must reside in your “Home” directory. Here are some suggestions for naming these directories.

 

Directory Contents Name Suggestions
Pine Program Files C:\Program Files\Pine or C:\Proggies\Pine or C:\Proggies\PC-Pine or wherever you like
“Home” C:\Nancy (but use your name instead of mine!) or C:\MyHome or D:\MyHome or C:\Home or C:\Data or wherever you like
Pine User Files %HOME%\Pine (if you want to use Pine configuration method 3, this directory must be named Pine and must reside in your %HOME directory)
Local Messages %HOME%\Msgs or %HOME%\Mail or %HOME%\Messages or wherever you like (the Pine default is %HOME%\mail)

 

For security reasons, you might want to use bizarre and completely non-standard file and directory names. I discuss this in the Privacy and Security section below.

The next two sections discuss my personal naming strategies. The section Step by Step Through Downloading and Setting Up PC-Pine walks you through creating the directories and setting the HOME environment variable.

 

Naming Your “Home” Directory

This is where the user-specific files of Pine and many programs that originated in the Unix world go. The Microsoft default is to put user-created documents in C:\My Documents. I like my personal files, including documents and configuration files, to be located together so I use a modified Microsoft naming style and name my download directory C:\MyDownloads, my web sites directory C:\MyWebs, my backup directory C:\MyBackups, and my home directory C:\MyHome. And I set up all my programs to save their configuration files in C:\MyHome. This way when I need to find or backup files I've created or updated—or my programs have created or updated—I can go to Windows Explorer and sort by name and all My directories are alphabetized together. On a machine that has only one disk drive, I use C:\MyHome. On a machine that has more than one drive, I like to keep user files somewhere other than C; for example, in D:\MyHome.

 

Naming the Directory Where Your Local Messages are Stored

Both Unix Pine and PC-Pine use a directory named “mail” in your home directory as the default for where folders are stored. Since Pine is both a mail and news client, you can use Pine to save both mail and news messages in your folders. To me it seems incorrect to call this directory “mail,” so I call it “Msgs.” I capitalize the letter M because my personal naming convention is to name directories using an initial capital letter. You can, of course, name the directory where your folders reside anything you like!

 

Step by Step Through Downloading and Setting Up PC-Pine (most of this is relevant to Unix and Mac Pine too)

The procedure I describe in this section is one of many ways to set up PC-Pine. I discuss why I like this configuration and give a link to information about alternate configurations in Configuration Overview above. These instructions were originally written for someone using Windows 95 or 98. If you are using another operating system, it should be fairly straightforward to adapt these instructions to your system.

 

 

0. Backing Up Files and Clearing Pine Registry Settings

If you have used Pine before on this computer, make a backup of all Pine-related files, especially your pinerc file(s), address book(s), and PASSFILE.

If PC-Pine is currently installed on this computer, clear the Pine-related registry settings before you run a new version. To display the Pine-related registry settings, click on the Windows Start button, choose Run, and type:

\full\path\to\pine.exe -registry dump

To clear these settings, run this:

\full\path\to\pine.exe -registry clear

The next time you run PC-Pine, it will reset the registry with the correct settings for the PC-Pine that you are currently using. To find out more, see Support Files, Environment Variables, and Registry Settings: PC-Pine and Pine Comand-Line Arguments, especially the section on the  -registry  command-line argument, at the UW PIC.

 

1. Downloading and Unpacking Pine

Tip     [W] If you are a user of MyUW.net or are a University of Washington student, staff, or faculty, the University of Washington has a step-by-step guide to Configuring PC-Pine for UW Email.

 

  1. Go to washington.edu/pine/getpine/ and follow the link to your platform

  2. Download the appropriate version of Pine to a temporary directory. For example, on my PC I use a directory named C:\MyDownloads\2Install\Pine. Make sure that you do a binary download and not an ascii download.

  3. Check the MD5 checksum to make sure that you have not downloaded a trojan. For example, on Mac OS X, you can check this by running  /usr/bin/openssl md5 /absolute/path/to/pine.tar.gz

    Tip: To ensure that you are using the real (rather than a trojan) openssl and that you are checking the correct pine.tar.gz, specify the absolute path to each of these.

  4. Create a directory where your Pine program files will go. On my Mac, I use (the standard) /usr/local/bin and on my PC, I use C:\Program Files\Pine, but you can put these files anywhere you like. Note that on a Mac, you need to use the sudo command to be able to manage files and directories in the /usr directory.

    • On Mac OS X Tiger, you can either follow the instructions for installing the UW pre-built pine-bin.osx-10.4.Z on Mac OS X Tiger or, to build Pine yourself, see Using a PASSFILE with Unix and Mac Pine below.

    • On Mac OS X Panther and earlier, you need to follow the instructions for building Pine that are in Using a PASSFILE with Unix and Mac Pine below. The UW does not distribute a pre-built version of pine for these systems.

    • On MS Windows, unzip the files into the Pine program files directory (the directory you just created in step 1D) using an unzip program. I recommend Stuffit Expander because it is free of charge and has an easier to understand user interface than WinZip. Expander can also be used to decode a lot of other encodings, such as MIME base64 and uuencoded files. The unzipped Pine files should include the following.
         dict.app
         dict.d
         dict.i
         dict.s
         install.txt
         ldap32.dll
         mailcap.sam
         mimetype.sam
         pico.exe
         pine.exe
         pine.hlp
         pine.ndx
         pinerc.adv
         spell32.dll
      
      MS-
      Windows
      Tip
          If you do not see all these files or their file extensions in Windows Explorer (or in My Computer), you need to change your Folder Options. To do this, click the Windows Start button, choose Settings > Folder Options, and then choose the tab labeled View. Make sure that the following is not checked
            [ ] Hide file extensions for known file types
            

      and the following, which is in the Hidden Files section, is checked

            [X] Show all files
            

      These settings are needed by the set-up procedure below and are also useful for detecting trojans and viruses, which often take advantage of the fact that the default MS Windows configuration hides a lot from users.

      Here is what the Folder Options window looks like in MS Windows 2000.

      Win2K Folder Options dialog box

       

 

2. Setting Environment Variables

Many programs that originated in the Unix world use environment variables for settings that are used by more than one program. An advantage of using environment variables is that if something changes, such as your timezone or the path to your default text editor, you can make the change once — in the environment variable — and the change will be reflected in all the programs that use the environment variable. Another advantage of using environment variables is that a configuration file, such as the pinerc file, can be transferred to another system without needing to be edited because the variables will be set by the local environment variable settings. This section walks you through setting up the environment variables that Pine (and some other programs) use.


 
Note    

 

  1. Use Windows Explorer to go to C:\ and make a backup copy of your C:\autoexec.bat file. One technique for naming backup files is to start with the number zero and count up, e.g., your first backup of autoexec.bat would be named autoexec.bat.0.

  2. Open your C:\autoexec.bat file in a text editor. One way to do this is to click the Windows Start button, choose Run, and type sysedit in the text box. This will open a number of system files. Make sure the focus is on the autoexec.bat file before you do the edits below.

  3. Copy & paste the following four lines into your autoexec.bat file:

    REM The next 3 environment variables are used by PC-Pine
    SET TZ=EST+05EDT
    SET HOME=C:\MyHome
    SET USER_DICTIONARY=%HOME%\Pine\myDic.txt
    
    Pine uses the TZ (time zone) environment variable to construct the Date header in messages that you send. Set this to the appropriate time zone setting for your location. For example, since I live in London, I set TZ to GMT00BST. For more info, see F. Pollastri's Time Zones, especially the links in the Other Information section at the bottom of his page.

    Set the HOME environment variable to point to the directory that you want to be your “home” directory. %USER_DICTIONARY% is used by the PC-Pine spell checker and you can, of course, name it anything you like. If you do not specify it in your autoexec.bat, it will be named dict.u and stored in the directory that spell32.dll is in (and thus not be backed up when you back up your home directory.)

  4. [optional]  If you want to have the option of using an alternate editor to compose a message in Pine, set the EDITOR environment variable. For example
    SET EDITOR=C:\Progra~1\Vim\Runtime\gvim.exe -f 
    
    or if your editor, gvim.exe in this example, is on your path, you do not need to specify the absolute path and can use the following instead
    SET EDITOR=gvim.exe -f 
    
    The second setting is more easily portable to autoexec.bats on other MS-Windows machines.

  5. [optional] PC-Pine will automatically use pinercEx, if it exists, and pinerc to read runtime configuration settings. (These are named .pinercex and .pinerc in Unix Pine.) If you want PC-Pine to automatically use a third file, include a line like the following in your autoexec.bat
    SET PINECONF=%HOME%\Pine\pinercConf
    
    %PINECONF% is used to store “generic” Pine settings that can be used by any Pine user on the system. It can be named anything you like. I suggest the name pinercConf so that when you sort your Pine user files, it will be sorted next to pinerc and pinercEx.

    Tip    

    To get a quick start customizing Pine, copy and paste my sample pinerc-generic (or a fragment of it) into the file you've specified as %PINECONF%. You can append to or override these settings in your pinerc and pinercex files using  MSC  and  MSXC.

    I discuss pinerc, pinercex, and pineconf and give examples on Compartmentalizing and Sharing Your Pine Configuration.


  6. [optional, useful for command-line junkies  If you like to launch pine or its companions pico, rpload, rpdump, and mailutil from the MS Windows Run prompt or the MS Windows Address Bar, include your pine.exe directory in your PATH environment variable. This way you won't need to type \full\path\to\program when you want to launch program; instead you can just type program followed by any arguments you want to use.

  7. After you are done editing your C:\autoexec.bat file, save your changes and exit the text editor.

  8. In order for your environment variables to be set you need to reboot your machine. Close all applications and windows that are open on your system. Click the Windows Start button, choose Shut Down, select Restart, and click OK.

  9. After your machine reboots, open a DOS box (Start > Programs > MS-DOS prompt) and type  set  at the DOS prompt. Check that all the environment variables that you set above are set correctly. Also, check to be sure that at least one of the environment variables TMPDIR, TEMP, and TMP are set. On some systems, the default is to set both the TEMP and TMP environment variables to %WINDIR%\Temp .

  10. To exit the DOS box type  exit

 

3. Creating Directories for Your Pine User Files

  1. Use Windows Explorer to create the “home” directory that you specified in your autoexec.bat file in step 2C.

  2. Create a subdirectory in %HOME% named Pine. This is where your Pine user files will go. In order for PC-Pine to find your user files, this subdirectory must be named  Pine  and it must reside in your %HOME% directory (for details, see How PC-Pine Finds User Files above).

  3. Create a directory where your Pine local message folders will go. The Pine default is %HOME%\mail, but I use %HOME%\Msgs. See Naming Your Folder Directory above for a discussion of the name of this directory.

 

4. Creating a PASSFILE for Storing Passwords

To avoid typing a password when you use Pine to access a password-protected POP, IMAP, NNTP, or ESMTP server, you need to be using either

  1. a version of Pine that was built with the option to use a PASSFILE, OR
  2. a command-line ssh client on the machine on which Pine is running and a POP, IMAP, NNTP, or ESMTP server that allows you to log in via ssh.

In this section, I discuss option #1. If you are interested in using option #2, which involves setting the ssh-command & the ssh-path in your pinerc, and setting up an SSH private-public key pair, see Scott Leibrand's 1999-Dec-13 message Re: Pine config of news server/login/groups (this message is also available at Archive.org).

All versions of PC-Pine have the ability to store passwords, but non-PC versions of Pine need to be built with this option (details about building Pine with a PASSFILE are below).

In order for Pine to use a PASSFILE, the PASSFILE must exist. In non-PC Pine, the name of the PASSFILE and its location is chosen by the person who built Pine. To create the PASSFILE on a Unix-like system, use commands like this:

touch /path/to/my/secret/passfile
chmod 600 /path/to/my/secret/passfile

For example, if you use the pine from rpm.livna.org, use these commands:

touch ~/.pine.pwd
chmod 600 ~/.pine.pwd

For another example, see how to create a PASSFILE for Pine running on a DreamHost shell account.

In PC-Pine, the default PASSFILE is named pine.pwd and is located in the directory where your PINERC is (%HOME%\Pine in these instructions). To create the pine.pwd file, use Windows Explorer to open the %HOME%\Pine directory and then right click on the blank space in the right panel where files (if there are any) are listed. In the pop-up menu choose New > Text Document. Change the name of the file from New Text Document.txt to pine.pwd.

You can override the name and location of the PASSFILE using Pine's -passfile command-line argument, which is discussed in the next section.

 

Important    
  • [All Versions of Pine]  In order to avoid typing your user name and password, you must create PASSFILE (e.g., pine.pwd) and append /user=YourLoginName to every occurrence of a server specification in your pinerc file(s). This includes the settings for smtp-server, nntp-server, inbox-path, incoming-folders, folder-collections, news-collections, address-book, and incoming-archive-folders.


  • [PC-Pine]  If the default name of the new text document is displayed as New Text Document without the .txt extension, then Windows Explorer is hiding the extension from you. In order to rename the file to pine.pwd (rather than pine.pwd.txt), you need to change your Windows Explorer folder options as described in the Tip in the “Downloading and Unzippping PC-Pine” section above.

 

Using the -passfile and -nowrite_passfile Command-Line Arguments

Starting with version 4.43 for PC-Pine and version 4.55 for Unix and non-PC versions of Pine, you can specify a non-default location for the PASSFILE by launching Pine with the -passfile command-line argument. For example:

pine -passfile /absolute/path/to/your/passfile

If you are on a shared Unix system and you launch Pine with the -passfile argument, I recommend that you create a shell script (maybe called mypine or even better something that will be a mystery to spies) that launches pine with this and possibly other arguments. Do not name your script pine and do not use a Unix alias because these are more vulnerable to spies (for example, if the spy runs the ps, who or w command).

The -nowrite_passfile argument tells Pine to "Read from a passfile if there is one, but never offer to write a password to the passfile." This command-line argument was introduced in Pine 4.60.

Tips    
  • Make sure that you chmod 600 your Unix PASSFILE so that other users on the system cannot read or write to it.

  • The -passfile and -nowrite_passfile command-line arguments work only if Pine was built with PASSFILE support. Compiling Pine with PASSFILE support is discussed in the next section.

  • To find out if your Pine supports a PASSFILE, run pine -h and if the -passfile argument is listed, it does!

 

Using a PASSFILE with Unix and Mac Pine

If you are using a non-PC version of Pine, for example Unix Pine or Mac Pine, and if it was built using the default build files, it probably does not support a PASSFILE. To check, run

pine -h

If the -passfile argument is listed, it supports a PASSFILE. If the -passfile argument is not listed and if it is Pine 4.55 or later, it does not support a PASSFILE. To find out how to build Pine so that it can optionally store passwords, see:

Build
Tips
    To specify the PASSFILE as an argument to the build command, run a shell script like the following from your Pine build directory:
#!/bin/sh
./build clean
./build 'EXTRACFLAGS=-DPASSFILE=\".pine.pwd\"' osx
#                                              ^^^
#                                              platform

Important: To avoid problems with quotation marks and other characters that might be interpreted as metacharacters by your shell, run this as a Bourne shell script (that's what  #!/bin/sh  in the first line of this script means).

To check that your newly built Pine supports a PASSFILE, run pine -h and make sure that the -passfile argument is listed.

Note that PASSFILE, which is .pine.pwd in this example, is relative to the location of the pinerc file.

[New!] The above ./build command does not work to build Alpine. For Alpine, use ./configure --with-passfile=FILENAME instead. For details, see Building and Installing Alpine (Apache-Licensed Pine) in my blog.

Reference: I found this Pine build syntax in this 2005-March-23 message in the YellowDog-extras mailing list.

 

As I discuss in the Privacy and Security section below, I suggest that you name PASSFILE something non-standard and bizarre to make it harder for spies to find. Also make sure that you chmod 600 your Unix PASSFILE so other users on the system cannot read or write to it.

See Also:  Pine's Help on the disable-password-caching feature, which is tangentially related to using a PASSFILE.

 

5. Running Pine the First Time and Setting inbox-path and Other Essential Variables

If all your environment variables are set correctly, you are ready to run Pine for the first time.

Tip    In Pine you can get context-sensitive help by typing either ? or ^G (“Get help”).
  1. To run PC-Pine, use Windows Explorer to find pine.exe and double click it. Alternatively, you can use the Windows Find command to locate and launch pine.exe (Start > Find > Files and Folders).

  2. The first time that your run PC-Pine, it displays the PC-Pine Configuration Setup window, which asks you if you want to  Use configuration file stored on an IMAP server  or  Use local configuration file. For now, I recommend that you use the default local configuration file and check the box labeled  Use this as the default PC-Pine configuration. If you are interested in using a remote configuration, see the Infinite Ink page about Compartmentalizing and Sharing Your Pine Configuration.

  3. Pine will display a message telling you it is creating the directory %HOME%\mail. Click OK.

  4. To exit the “Welcome to Pine” screen, type E. You will get a prompt that says
    No inbox! Folder to open as inbox:
    If your ISP uses IMAP, type
    {your.imap.server/user=LoginName}INBOX
    If your server supports secure IMAP connections, then include /tls (available in 4.40 and later), /ssl, or /secure inside the curly braces. With some servers you need to use the /novalidate-cert (which is unsafe) or the /notls qualifier. For details about these and other qualifiers that can be used in a Pine server specification, see Do Not Send Your Password in Plaintext below and Server Name Syntax at the UW Pine Information Center. If you are using Unix Pine and if you do not want to use rsh or ssh to connect to your IMAP server, you can either explicitly specify the IMAP port number using, for example
    {your.imap.server:143/user=LoginName}INBOX
                      ^^^
                      port
    
    or include /norsh  inside the curly braces. The /norsh qualifier is not relevant to PC-Pine users and is available only in Unix Pine 4.41 or higher.

    If you get a message like this
    [Can't connect to your.server,143: Unknown error (10051)]
    
    it means that port 143, which is the default IMAP port, is not accessible.

    You can use Pine to access a POP INBOX but be forewarned Pine will not know about new messages that arrive while you are accessing the POP INBOX. To set up Pine to access a POP INBOX, type
    {your.pop.server/user=LoginName/pop3}INBOX 
                                   ^^^^^
                                   Note
    
    Near the bottom of this page, there is more information about using Pine to access POP INBOXes.

  5. After you press ENTER, you will get this prompt:
    Preserve folder as "inbox-path" in PINERC?
    To answer yes, type Y.

  6. You will now be prompted for your password:
    HOST: your.imap.server USER: LoginName ENTER PASSWORD: 
    
    Type your password and press RETURN.

  7. If you created a PASSFILE (step 4), you will get this prompt:
    Preserve password on DISK for next login? 
    
    To answer yes, type Y.

  8. Pine will open your INBOX or, if you are not connected to the Net, Pine will tell you that it cannot connect to your INBOX.

 

Setting Your From Address, SMTP Server, & Optionally an NNTP Server

  1. To continue configuring Pine, go to the Pine SETUP CONFIGURATION screen by typing MSC (Main > Setup > Config). The top of the screen looks like this:
         PINE 4.64   SETUP CONFIGURATION
          
       personal-name            = <No Value Set: using "">
       user-id                  = <No Value Set: using "">
       user-domain              = <No Value Set>
       smtp-server              = <No Value Set>
       nntp-server              = <No Value Set>
       inbox-path               = {your.imap.server/tls/user=LoginName}INBOX
    
    To change any of these, move the cursor to the relevant line and type C for Change. Details about the inbox-path, which specifies your Pine primary INBOX, are in Step 5D above.

    In order to send messages without being prompted for your identity, you need to fill in the first three variables. The personal-name, user-id, and user-domain variables are what Pine uses to construct your From header, which will look like this:
    From: personal-name <user-id@user-domain>
    
    If you are using Unix, Mac, or any non-PC Pine, your Pine user-id is your login name and you do not have the option to change it within Pine. You can, however, change your From header either by using a role or by setting some of Pine's  *-hdr  variables. I discuss these and other options in detail in Changing Your From Header in Pine.

    The smtp-server is the server that sends your outgoing email messages. If you are running Pine on a remote Unix system, you probably do not need to edit the smtp-server and instead you should leave it as it is (even if it says <No Value Set>). Pine will then use the default outgoing SMTP server for that system. For example, this is the case at Dreamhost.com. If you are not able to send email from Pine running on a remote Unix system, ask the system administrator of that system how you should configure Pine's smtp-server when Pine is running on their system.

    If your SMTP server requires authentication using SMTP AUTH, you need to specify a user name for your SMTP server, which you do by setting smtp-server to something like this:
    your.smtp.server/user=UserName
    
    Note that if your SMTP server requires a fully qualified user name, it will look something like this:
    your.smtp.server/user=UserName@domain.name
    
    If your SMTP server supports SMTP AUTH over SSL or TLS, append the /ssl or /tls qualifier so that you have something like this:
    your.smtp.server/user=UserName/tls
    
    If you need to use an SMTP server port other than port 25, for example port 26, use something like this:
    your.smtp.server:26
    
    [New!] If your SMTP server uses a Submit server (usually port 587) and if you are using Pine 4.64+, you can use this:
    your.smtp.server/submit
    
    If your SMTP server uses all of the above (alternate port, SMTP AUTH, and TLS), use something like this:
    your.smtp.server:26/tls/user=UserName
    
    [New!] Or this:
    your.smtp.server/submit/user=UserName
                    ^^^^^^^
                    Works in Pine 4.64+ with a Submit server (usually port 587)
                    Submit servers automatically use TLS so you do not need /tls


    If you want to use Pine as an NNTP client, you can either specify your nntp-server(s) on this screen or in the role(s) that you use for public posting. If you need to specify a user name for your nntp server, do it like this:
    your.nntp.server/user=UserNameOnNNTPServer
    
    Note that usually you will not need to specify a user name for the NNTP server of your IAP (Internet access provider).

    The inbox-path should already be filled in with the information that you gave in Step 5D above.

To use the bare-bones Pine, these are the only Pine settings you need.  

 

SMTP &
NNTP
Tips
   
  • If you do not want to use your Internet access provider's outgoing SMTP server and if they hijack outbound port 25 requests, you may be able to route around them by either
  • If you are having trouble authenticating to an SMTP server:
    • Make sure you are using the correct username (the string after the Pine  /user=  qualifier) to log in to the SMTP server. Sometimes the SMTP username is different from the IMAP username, even if both the IMAP server and the SMTP server are provided by the same service provider.
    • Make sure that there are no upper-case letters in the username. Usually this string can contain only lower-case letters (possibly along with numbers, the @ symbol, and other non alphanumeric characters).
    • Make sure that the SMTP server allows you to use the address that is in your From header line. Some outgoing SMTP servers, for example the AOL outgoing SMTP servers, require you to use a From header that contains an email address that is hosted on their system.
    • If you are having trouble with the Gmail SMTP server, see Gmail SMTP and POP Tips below.

  • If you send mail From more than one email address and if some of these require a different (not your Pine default) SMTP server, you can set up a role for each From address and specify the appropriate SMTP server in the role. An example of this is in the Gmail SMTP and POP Tips below. Being able to set an smtp-server (or list of servers) in a role is available in Pine 4.50+.

  • To ensure that your outgoing mail messages are not considered forgeries by SPF-aware tools, I recommend that you use SPF Tester to see if your SMTP MAIL FROM (Return-Path) address and your outgoing SMTP server are an acceptable combination.

  • If you are using Pine 4.56+, I recommend that you do not set your nntp-server on the Pine SETUP CONFIGURATION screen but instead do the following.
    • Use the instructions in Step 7 below to set up the news-collections that you read.
    • Set the nntp-server(s) in the role(s) that you use for posting to newsgroups.
    This way you will be less likely to post your non-public email address in a newsgroup.

 

6. Useful Configuration Settings for Power Users

If you have the time and energy, page through the rest of the Pine SETUP CONFIGURATION screen, read Pine's context-sensitive help by typing ? or ^G, and experiment with your settings.

Tip     If you use some or all of my generic pine settings, many settings in this section will already be set. In PC-Pine, you can set the PINECONF environment variable and then “plug in” system-wide generic Pine settings. I discuss setting this environment variable in step 2E above.

For more ways to plug & play with Pine settings and details about how it works in both PC and Unix Pine, see Compartmentalizing and Sharing Your Pine Configuration.

 

  1. default-fcc 
    In its default configuration, Pine saves a courtesy copy (CC) of each message that you send in a folder on the local system named sentmail (in PC-Pine) or sent-mail (in non PC-Pine). If you would like these Fcc'd messages to be accessible to then set your default-fcc to something like this:
    default-fcc = {imap.server.of.your.webmail.provider}INBOX.Sent Items
                                                        ^^^^^^
                                                        path & delimiter depend on IMAP server
    To find out the imap.server.of.your.webmail.provider and the “Sent” folder on that system, consult your webmail provider's documentation. Details for some providers are in The Table on the IMAP Service Providers page.

    Note:  The behavior of default-fcc depends on the variable fcc-name-rule and on a number of feature-list settings (search for the string fcc on the SETUP CONFIGURATION screen). It also depends on whether the recipient of the message is in your address book with an Fcc setting and whether a role with an Fcc setting was used to construct the message.

    Tip 1:  If you want to always view the Fcc folder name when you are composing a message, include Fcc in your Pine default-composer-hdrs list. This also makes it easy to change the Fcc during message composition. This is one of the settings that I suggest in the Sample Settings section of Compartmentalizing and Sharing Your Pine Configuration.

    Tip 2:  If you want to save both your sent and your received messages in the same folder, set your default-fcc to be the same as your saved-msg folder. Doing this makes it easy to review entire conversations (rather than only one side of a conversation).

    Tip 3:  You can use Fcc to “deliver” a newly composed message directly to an IMAP mailbox to which you have write access. This is an easy way to “send” yourself, or anyone who can read the Fcc'd mailbox, a message without using SMTP. This is one way to use IMAP for blogging (which might more appropriately be called plogging, i.e., IMAP logging as opposed to web logging). If you do this regularly, you might want to set the feature fcc-only-without-confirm.

    Tip 4:  An alternate way to save messages that you send on an IMAP server, and what I prefer, is to use Bcc (blind courtesy copy). I discuss this in my blog in an item titled Server-Side Sent Messages.


    See Also:  The section Using Pine's pruned-folders Variable below, which discusses how to set up Pine so that it will periodically archive the default-fcc folder.
     

  2. My 27 Favorite feature-list Settings
    Below are 27 feature-list settings that I find especially useful. If you set your EDITOR environment variable (step 2D above) and if you want the option to use it to compose a message, make sure that you set enable-alternate-editor-cmd (the first feature that I list below). An easy way to put these settings in your pinerc is to copy & paste them from the feature-list in the generic pinerc on the Compartmentalizing and Sharing Your Pine Configuration page.

    Note: The 2nd, 4th, 5th, 15th, 25th, and 26th features that I list below are not X'd.
PINE 4.64   SETUP CONFIGURATION
    :
   Set    Feature Name
   ---  ----------------------
[ Composer Preferences ]
    :
   [X]  enable-alternate-editor-cmd
    :
[ Reply Preferences ]
    :
   [ ]  reply-always-uses-reply-to (unset this so Pine will give you the option to not use the Reply-To header)
    :
[ Sending Preferences ]
   [X]  disable-sender  (available in 4.51+)
    :
   [ ]  send-without-confirm (unset this so you can use sending-filters, which are useful for greenlisting, & use ^V to control flowed text)
   [ ]  use-sender-not-x-sender (unsetting this may prevent spammers from getting your private - as opposed to public - email address)
   [X]  warn-if-blank-to-and-cc-and-newsgroups  (available in 4.55+)                                            
   [X]  warn-if-blank-subject  (available in 4.55+)
[ Folder Preferences ]
    :
   [X]  separate-folder-and-directory-entries  (useful if you access Cyrus or other servers that support dual-use names; discussed below)
    :
[ Viewer Preferences ]
    :
   [X]  enable-msg-view-urls  (available in 4.00+; discussed below)
   [X]  enable-msg-view-web-hostnames  (available in 4.00+; discussed below)
    :
   [X]  quell-charset-warning  (available in 4.60+)
[ News Preferences ]
    :
   [X]  enable-multiple-newsrcs (useful even if you use only one NNTP server; discussed below; available in 4.56+)
   [X]  hide-nntp-path  (available in 4.60+)
    :
   [X]  news-post-without-validation
    :
   [ ]  quell-extra-post-prompt (because of this problem, I recommend unsetting this; available in 4.30+)
[ Advanced Command Preferences ]
   [X]  enable-aggregate-command-set (aggregate operations are discussed below)
   [X]  enable-arrow-navigation (makes Pine menu navigation easier)
    :
   [X]  enable-bounce-cmd  ("bounce forward" can be used to update a greenlist, train Spambayes, use SMTP to transfer msgs)		
   [X]  enable-exit-via-lessthan-command (makes Pine menu navigation easier)
   [X]  enable-flag-cmd (enables manual setting and clearing of status flags and keywords (labels))
    :
   [X]  enable-flag-screen-keyword-shortcut (available in 4.62+)
    :
   [X]  enable-full-header-cmd (also consider enable-full-header-and-text)
    :
   [X]  enable-unix-pipe-cmd (available in PC-Pine 4.60+; available in non-PC-Pine for 10+ years)
[ Advanced User Preferences ]
    :
   [X]  expose-hidden-config (available in 4.40+)
    :
   [ ]  quell-attachment-extension-warn  (available in 4.60+)
   [ ]  quell-attachment-extra-prompt (unset this so Pine will notify you if you try to launch an attachment; available in 4.50+)

    :
    :
    : (next section is at the bottom of the Config screen & viewable only after setting expose-hidden-config & restarting Pine )
    :
--- [ Normally hidden configuration features ] ---
    :
   [X]  allow-changing-from
    :

[New!] See Also: The section below about Privacy Configuration Settings, which lists some of the above settings, as well as some other useful settings.

 

  1. character-set, the euro sign, and 8-bit negotiation
    Page down through the Pine configuration screen until you get to the character-set variable. Alternatively, search for the string character-set using Pine's Where (^W) command. Set this to the character coding that you use for most of your correspondence. For example, if you usually correspond in a Western European language, such as English, you will might set this to ISO-8859-1 or ISO-8859-15. For example:
    character-set            = ISO-8859-1

    [New!] Starting with Alpine, the Apache-Licensed Pine, you can specify UTF-8, i.e.:

    character-set            = UTF-8

    UTF-8 can represent any character in the Unicode standard and is what I use and recommend. Note: UTF-8 is available only in Alpine and is not available in Pine.


    euro sign
    Note
       

    Unfortunately, there are currently many problems using the euro sign in email and I, along with many others, recommend that you

    Do not use the euro sign in an email or news message.

    Instead, type the string  EUR  rather than the character  . For a discussion of the problems, including why you may not see the euro sign that is the last character before the period in the previous sentence, see Jukka "Yucca" Korpela's the euro sign in HTML and in some other contexts. If you need to send the euro sign in an email message, 1] set your Pine character-set to a coding, such as Windows-1252 or ISO-8859-15, that contains this character, 2] set your Pine font to one that corresponds to the coding you used in #1, and 3] make sure your correspondents are using a system and font that is able to use this character coding.

    Thanks to Jukka for for the graphic of the euro sign and his wonderful material on international character sets!



    For correct results when viewing a character coding, you must choose a corresponding font. For example, the vt100.fon font, which I discuss below in the Setting Fonts section, can be used for ISO-8859-1 but it cannot be used for the Windows-1252, ISO-8859-15, or UTF-8 full character repertoire because vt100.fon does not contain the euro sign and some other non-ASCII characters. When you receive a message that is in a different coding from your Pine character-set setting, Pine displays a warning:

    [ Some characters may be displayed incorrectly. ]
    You can turn off this warning by setting quell-charset-warning, which is one of the feature settings that I recommend above.

    (Thanks to the Usenauts who helped to clarify some “charset” issues, especially Alan Flavell, who edited the previous paragraph in this 2001-Dec-3 Usenet message.)


    For more about the terms charset, character set, repertoire, coding, & encoding, see:

    If you are having problems with a character and you've checked that both the font and the character-set support the problematic character, try using a different SMTP server. Some broken SMTP servers mangle 8-bit characters. Also, if you are running Pine in a terminal or SSH window, make sure the terminal emulation settings are correct.


    If you set your character-set to anything other than US-ASCII, I suggest that you set the following in your Pine feature-list
    [X]  downgrade-multipart-to-text (especially useful if you post to text-only NNTP groups[New!])
     : 
    [X]  enable-8bit-esmtp-negotiation
     :
    [X]  enable-8bit-nntp-posting
    
    These tell Pine to try to do 8-bit ESMTP or NNTP negotiation if a message contains a “higher ASCII” character, such as the £ symbol. If the 8-bit negotiation is successful, the message is not encoded using, for example, quoted-printable encoding.


  2. editor
    If you X'd enable-alternate-editor in your feature list in Step 6B and if you set the EDITOR environment variable in Step 2D, set the Pine editor variable to ${EDITOR}:
    editor                   = ${EDITOR}
    
    Using the EDITOR environment variable here will make it easy to use this pinerc on other machines. Note that PC-Pine understands both Unix ($EDITOR or ${EDITOR}) and Microsoft (%EDITOR%) environment-variable notation. If you are on a machine without much memory, you can save a little of your precious memory by not setting the EDITOR environment variable (Step 2D) and explicitly specifying your editor here. For example, here is what I use on an MS-Windows system:
    editor                   = gvim.exe
    
    Since gvim.exe is on my path, I do not need to specify the path. This makes this pinerc setting portable to other MS-Windows machines (but it's not portable to Unix machines because Unix gvim does not use the .exe file extension).

    Editor
    Tips

    [Updated!]
       
    • To launch your alternate editor while in a Pine COMPOSE MESSAGE screen, move the cursor to the MESSAGE TEXT region and type either of the following key combinations (chords):
      CTRL-_
      ESC-ESC-_
      Some systems do not understand the chord CTRL-_ (CTRL-underscore) and only ESC-ESC-_ will launch the alternate editor.

      Note that these chords are used when enable-alternate-editor-cmd is set and enable-alternate-editor-implicitly is not set.

    • If you want Pine to ask you what alternate editor to use, you can use this trick that Ted Stern posted to comp.mail.pine in 1995. This trick still works more than ten years later, in 2007!

    • If you sometimes use both an alternate editor and the built-in Pine composer to compose a message, set Pine's composer-wrap-column to be the same as your alternate editor's wrap column. This way you might be able to avoid needing to re-justify your message text when you switch editors.

    • Starting with Pine 4.60, the Pine default is to generate flowed text and to send messages with a Content-Type header that contains format=flowed. If you use an alternate editor, you will be less likely to send a message that contains “embarrassing line wrap” (aka the shark's tooth effect) if you set up your alternate editor so that it also creates flowed text. A brief discussion about how to do this if Vim is your alternate editor is in this 2004-Apr-28 message that Gary Johnson crossposted to comp.mail.pine & comp.editors.

    • One way to avoid “embarrassing line wrap” is to use the Pine composer to re-justify the message text just before you send the message. To re-justify the . . .
      • current paragraph, type ^J (Justify)
      • entire message text, type ^W (WhereIs) followed by ^U (fUllJustify)
      To undo a Justify or fUllJustify command, type ^U (UnJustify) before you type anything else.

    • To ensure that one particular line is not merged (flowed) into its surrounding lines, start the line with two spaces and surround it with blank lines.

    • You can toggle whether a particular message is sent as format=flowed by typing ^X (Send) followed by ^V (toggles between Flow and NoFlow). This is possible only if the feature send-without-confirm is not set. Unsetting send-without-confirm is one of my favorite feature-list settings, which I discuss above.

    • format=flowed, which is sometimes abbreviated f=f, is defined in RFC 3676 and discussed in Joe Clark's The format=flowed FAQ. f=f is especially useful when you or your correspondents are using a small window size, for example, using a mobile or handheld device.

     

  3. url-viewers
    In PC-Pine and Mac-Pine, if you leave the url-viewers variable set to <No Value Set>, Pine should use your PC or Mac's default browser when you launch a URL that appears in a message. If you would like a launched URL to be opened in a new window or a new tab in your browser, you can either set this in your browser's preferences or specify a command-line argument in your Pine url-viewers setting. Specific settings for some browsers are discussed in this 2002-February pine-info thread about opening urls.

    • General url-viewers tips:
      • To be able to use Pine to launch URLs, set the features enable-msg-view-urls and enable-msg-view-web-hostnames. These are two of the features that I recommend in the feature-list settings above.
      • If you explicitly specify a Pine URL viewer, you must specify the /absolute/path/to/the/viewer. If you specify a relative path, Pine will silently ignore the setting.
      • If you want to copy a URL to a file, set the viewer to something like this:
        /bin/echo _URL_ > filename
      • You can sometimes get more information about where exactly a URL will take you by using the H command to view the raw message. To be able to use the raw-message variation of Pine's H command, set these two features:
        [X]  enable-full-header-and-text 
        [X]  enable-full-header-cmd  (one of my favorite feature-list settings)
                      
        Being able to view a raw message is especially useful for investigating HTML messages that might contain phishing or other malicious URLs.
      • The Pine default is to launch mailto: and news: URLs in the current instance of Pine. To override this, include something like the following in your Pine url-viewers setting:
        _SCHEME(mailto)_ "/usr/bin/open -a /Applications/SeaMonkey.app _URL_"
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          use the appropriate command for your system
        
        Details about the SCHEME token are in Pine's built-in Help about the url-viewers variable


    • MS-Windows url-viewers tip:
    • Mac url-viewers tips:
      • If Pine is running locally on your Mac and if leaving the url-viewers variable unset (<No Value Set>) does not work, set url-viewers to:
        "/usr/bin/open _URL_"
        ^                   ^
        :....use quotes!....:
        Make sure you include the surrounding quotation marks and specify the absolute path to the open command. This will launch a selected URL in your Mac's default viewer for that type of URL (e.g., your Mac's default ftp:, http:, imap:, mailto:, or nntp: viewer).
      • If Pine is running in a Mac OS X Terminal window (either locally or in a remote shell), you can use CMD-double click (⌘-double click) on a URL to open the URL in your local Mac's default browser. Unfortunately, as I posted in this comp.mail.pine message, this does not always work.
      • If Pine is running in an iTerm window (either locally or in a remote shell), you can use CMD-click (⌘-click) on a URL to open the URL in your local Mac's default browser.
      • To specify the default web browser on a Mac, go to Safari > Preferences > General > Default Web Browser.
      • To specify the default feed client on a Mac, go to Safari > Preferences > RSS > Default RSS Reader.
      • To specify the default email client on a Mac, go to Apple Mail.app > Preferences > General > Default Email Reader.
      • To specify your Mac's default application for other protocols, you can use a tool such as monkeyfood.com's MoreInternet or Rubicode's RCDefaultApp.



  4. index-format
    The index-format variable specifies what is displayed about a message on the Pine MESSAGE INDEX screen. The default index-format in Pine is this:
    index-format=STATUS MSGNO DATE FROMORTO(33%) SIZE SUBJECT(67%)
    [Updated!] The default index-format in Alpine is this:
    index-format=STATUS MSGNO SMARTDATETIME24 FROMORTO(33%) SIZENARROW SUBJKEY(67%)
    For details about this syntax, see Tokens for Index and Replying and index-format in the Pine Technical Notes. If you prefer different tokens, different token widths (the numbers inside parentheses), or a different ordering, set this variable. Here is what I use:
    index-format=SMARTTIME(3) NEWSANDRECIPS(15%) FROM(17%) IMAPSTATUS MSGNO SUBJKEYINIT(68%) KSIZE
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                 the most interesting tokens (to me) are here
    I put the least interesting tokens on the edges so that when I view the MESSAGE INDEX, I can easily focus on the interesting aspects of the messages.

    Tip 1:  The behavior of some tokens, such as STATUS, IMAPSTATUS, and FROMORTO, depend on your email addresses. To specify your email addresses, use the alt-addresses variable.

    Tip 2:  If you set up keywords, which are discussed below, you will probably want to include a keyword token (SUBJKEY, KEY, SUBJKEYINIT, or KEYINIT) in your index-format so that keywords will be displayed in the MESSAGE INDEX.

    Tip 3:  As I discuss in the Speed Tips below, some tokens, such as ATT (attachments), can slow down the presentation of the Message Index screen.

    Tip 4:  You can customize the color of index lines and some index-format tokens. For example, the ARROW, IMAPSTATUS, and keyword tokens can have custom colors.

    Tip 5:  If you want a particular folder or group of folders to have a custom view, e.g. a non-default index-format, use an “Other” rule.


  5. When you are done editing your Pine configuration, type E to exit.

 

I have more suggestions for Pine settings throughout this Power Pine page, especially in Speeding Up Pine below, and on the separate pages Compartmentalizing and Sharing Your Pine Configuration, Changing Your From Header in Pine, and Pine's Feature List and its More than 90 Features.

   

 

7. Setting Up IMAP, NNTP, and Local Collections

Note   

 

Another essential part of your Pine configuration is the location of mailboxes and newsgroups that you are interested in. If you would like...

then go through the following steps.

  1. To set up a collection, type MSL (Main > Setup > collectionList).

  2. The Folder-Collection listed on this screen is the one that Pine created when you ran Pine the first time. To view (and possibly edit) this collection's specification, type  C  for Change.

  3. The Pine default primary collection is this:
       Nickname  : Mail
       Server    :
       Path      : mail
       View      :
    
    Note that the Server field is blank, which means that this collection resides on the local system (the system on which Pine is running). Change Path so that it is the name of the directory that you created in step 3C above (Creating Directories for Your Pine User Files)For a local collection, Path is relative to $HOME  so if it is a subdirectory of $HOME, you can simply type the subdirectory's name. If it is not a subdirectory of $HOME, type the absolute path, including the drive letter if you are on a PC. I suggest that you change the Nickname to something more meaningful than “Mail” so that when you select a folder collection using   G  (Go),  S  (Save),  or  ML  (Main > ListFldrs), the nickname will help you remember where exactly this folder collection is. For example, here is what I use:
       Nickname  : Local Msgs
       Server    :
       Path      : Msgs
       View      : 
    
    When you save this setting, Pine will automatically detect the appropriate path delimiter (usually either slash (/), dot (.), or backslash (\)) and append it to the end of the Path value.

    Note: On many systems the Path is case sensitive and on such a system, for example, Mail is not the same as mail.

    Tip: For a local collection, I recommend that you use an absolute path, such as $HOME/mail or $HOME/Msgs, rather than a relative path, such as mail or Msgs (which are used in the examples above). This way it will be easy for you to remember where exactly the collection is located on your local system. This is especially useful if your system uses an imaprc file to change the default location of your mail's 'home' directory.

  4. To exit this setup screen and save this setting, type ^X.

  5. If you want to save or access folders on an IMAP or NNTP server, type A to add a collection.
     
  6. If a collection is not on your local system, i.e., if it resides on an IMAP or NNTP server, the Server field must be a fully qualified server specification. The server qualifiers depend on what is supported by the server and what is supported by your version of Pine. Possible server qualifiers include /imap (which does not need to be specified because it is the default), /nntp, /ssl, /tls, /tls-sslv23 (available in Alpine), /secure, /novalidate-cert, /norsh, /notls, /loser (which is sometimes useful with a Courier IMAP server), /readonly, /anonymous, and /debug. If you are not sure what to put in the Path field, I suggest that you start by leaving the Path field blank and filling in only the Server field, for example, start with something like this:
       Nickname  : 
       Server    : server.name/user=LoginName/qualifier2/qualifier3
       Path      : 
       View      :
    
    where qualifierN  is replaced with one of the server qualifiers described when you view Pine's built-in help (using ^G while your cusor is in the Server field). For example, I would start with the following for my FastMail.FM account:
       Nickname  : 
       Server    : mail.messagingengine.com/user=iiiiiii@fastmail.fm/ssl
       Path      : 
       View      :
    
    When you save this setting, Pine will automatically give it a nickname.

    Tip: To learn more about using Pine with FastMail.FM, see Step 7K below, ConfiguringPine in the FastMail.FM wiki, and the FastMail.FM section of my IMAP Service Providers page. The Table on the IMAP Service Providers page includes details about setting up Pine to access lots of different IMAP service providers.

  7. To save your settings and exit this screen, type ^X. Pine will try to connect to the server to check that your specification works. If you have set up Pine to use a PASSFILE, Pine will ask you if you want to save your password (so you won't need to tell Pine this password again).

  8. To change the order of your collections use the Shuffle command ($). The first collection (after the Incoming-Folders collection, if it exists) on your Collection List screen is your Pine primary folder collection and it is where folders that are specified in your pinerc without a server name reside. If you have a reasonable amount of space on your IMAP server, I recommend that you make an IMAP-accessible (remote) collection your primary folder collection so that those folders will be accessible by any IMAP client, including web-based IMAP clients such as WebPine, WebAlpine, Gmail (discussed in the next section), and Horde/IMP.

  9. To exit the Setup Collection List screen, type E.

  10. To view and test your folder collections, type ML (Main > ListFldrs).

  11. While viewing your folder collections (previous step), you may discover that you need to drill down through directories to get to your IMAP mailstore. Make a note of the hierarchy delimiter, which is usually slash (/), dot (.), or backslash (\), and the directory, which is sometimes either INBOX. or mail/. Type MSL and update the Path value for the folder collection. For example, here is what I use for my FastMail.FM account.
     * Nickname  : FastMail.FM
       Server    : mail.messagingengine.com/user=iiiiiii@fastmail.fm/ssl
       Path      : INBOX.
       View      :
    
    The above Path (INBOX.) is what is usually used to access the personal mailstore on a Cyrus or Courier IMAP server. On a UW IMAP server, the Path is often determined by the user and a common choice is mail/ or Mail/. On some IMAP servers -- including the UW IMAP server on Verio's Signature accounts, some MS Exchange servers, and the Gmail IMAP server (which is discussed in the next section) -- the Path should be left blank.

    You can use anything you like for the Nickname. For example, you could use the full technical specification as the nickname:
       Nickname  : {mail.messagingengine.com/user=iiiiiii@fastmail.fm/ssl}INBOX.[]
    

    *
    I actually prefer to use the full technical specification as the nickname (which is what is listed on Pine's FOLDER LIST and COLLECTION LIST screens). This way I can know exactly where a folder collection is, and what qualifiers it is using, when I'm viewing my Pine Collection List.

 

 

[New!] [HOT] Example: Setting Up Your Gmail IMAP Collection

On 2007 October 24 Google started supporting IMAP access to Gmail (Google Mail). To use Pine to access and manage your Gmail messages, type MSLA (Main> Setup> collectionLists> Add) and add a collection like this:

Nickname  : Gmail                                             
Server    : imap.gmail.com/ssl/user=id@gmail.com                                                       
Path      :                                                                                                                 
View      :  
  

where the Nickname is anything you like and id@gmail.com is replaced by your Gmail or Google Apps sign-in ID.

Gmail's IMAP server is different, as is Gmail's POP server, which is discussed in POPping Gmail is Different below. To successfully use Pine to access and manage your Gmail IMAP collection, I recommend that you do the following.

  1. Important: Read the Gmail Help article about How do actions sync in IMAP?

  2. Keep in mind that...
    1. Each Gmail folder that you see in your Pine Gmail collection is actually a Gmail label.
    2. All your non-spam non-trash messages are in the [Gmail]/All Mail special folder.
    3. Each non-spam non-trash message can appear in multiple folders.
    4. To put a message in multiple folders, use Pine's Save (S) command multiple times. Be careful about whether you copy or move the message. Pine's Save ^R subcommand is a toggle that controls whether or not the message is Removed from the current folder after the Save is done.
    5. When you use Pine to "Delete" (D) a non-spam non-trash message, the Gmail IMAP server immediately deletes & expunges the message from the current folder, but it will still be in the [Gmail]/All Mail special folder and any other folders that it happens to be in.
    6. To "archive" a message that is in your Gmail INBOX, use the Pine D command to Delete it from the INBOX. It will still be archived in [Gmail]/All Mail. Tip: When accesssing your Gmail INBOX with Pine, you can think of D as meaning Done (but don't think this way in non-Gmail folders!).
    7. When you use Pine to "Delete" (D) a message in the [Gmail]/All Mail special folder, the command is ignored.
    8. To delete a message from all the folders it is in, including the special [Gmail]/All Mail folder, use Pine's Save (S) command to move or copy the message to the [Gmail]/Trash special folder.
    9. When you use Pine to "Delete" (D) a message in either the [Gmail]/Trash or the [Gmail]/Spam special folder, the message is immediately deleted & expunged and cannot be recovered.
    10. To search all your non-spam non-trash Gmail messages, open the [Gmail]/All Mail folder and use Pine's Select (;) command and other aggregate operations to zoom (Z) in on the search results.
    11. Pine folder means Gmail label!

  3. Type MSC (Main > Setup > Config) and use the following configuration settings.
     :
    incoming-archive-folders       = <No Value Set>
     :
    read-message-folder            = <No Value Set>  
     :
    [ ]  auto-move-read-msgs
     :
    [X]  save-will-not-delete
     :
    pruning-rule =
                   (*)  don't rename, don't delete  
     :
    The first three settings and the last (pruning-rule) setting prevent Pine from trying to archive messages in a non-Gmail way (see #2f above for the Gmail way of archiving). The first three settings also work around a Gmail bug that causes Pine to complain about "Message to save shrank!" [subscription to the Alpine-alpha list is required to view this link].

    The fourth setting, save-will-not-delete, makes it easier to save a message in multiple folders (discussed in #2d above) and makes it less likely that you will misplace a message and need to go hunting for it in the [Gmail]/All Mail special folder.

  4. You might want to set up incoming-folders (Pine shortcuts) for your frequently used Gmail folders.

 

Notes:

 

See Also:

 


Collection
Tips

[Updated!]
   
  • Put the collection where your most frequently used folders are located at the top — i.e., first — in your folder-collections list. This will save you a lot of keystrokes in both using and configuring Pine because Pine considers this first folder collection to be your default folder collection or default collection for saves or primary collection. This collection is the default location for saves, opens, pruned-folders, default-fcc, default-saved-msg-folder, postponed-folder, form-letter-folder, filter move targets, the 2nd part of an incoming-archive-folder pair, and more. The folder-collections setting will look like this in your pinerc file:
    folder-collections=nickname1 your-primary-collection,
      nickname2 folder-collection2,
      etc.
    If you do not use the Incoming-Folders virtual collection, your Pine default INBOX, which is specified by inbox-path, will be listed in your primary collection.

  • To customize the way Pine lists your collections and the folders that are within each collection,
    1. Go to the Pine SETUP CONFIGURATION screen (by typing MSC) and edit the 12 features in the  [ Folder Preferences ]  section.
    2. Edit the folder-sort-rule variable.

    Note: Pine distinguishes between a mailbox name and a directory name by appending a hierarchy delimiter character to a directory name. For example, in the Pine FOLDER LIST screen, the following represents a mailbox:
    Archive
    And each of the following represents a directory:
     Archive/
     Archive\
     Archive.
    
    The trailing hierarchy character depends on the IMAP server.

  • [Updated!] On a server that allows a mailbox and a directory to have the same name, for example a UW server that's using mix mailbox format, a Dovecot server that's using maildir format, the Gmail IMAP server, any Courier or any Cyrus server, Pine (in its default configuration) represents a dual-use name like one of the following:
     Archive[/]
     Archive[\]
     Archive[.]
    
    The character inside the square brackets is the hierarchy delimiter that is used on the server. To change Pine's default way of displaying dual-use names, do one or more of the following:


    If you set quell-empty-directories, be aware that a directory will disappear from the Pine FOLDER LIST when you delete the last folder that it contains. To learn more about dual-use names, which are also known as hybrid folders, see the 2004-September comp.mail.pine thread about Square brackets in IMAP folder?

  • If you want a folder name to be listed near the top in a collection list, give it a name that begins with a character that will sort above alphabetic characters in an ASCII sort. For example I use the dash character (-) as the first character in the name of my folders that receive incoming messages. I discuss my mailbox-naming style on my Procmail Quick Start in the sections Use Consistent Naming and Formatting Styles and My Latest Mailbox-Naming Experiment.
     
  • To create a collection that contains only some folders in a directory, specify a View. For example, to create a collection of all folders whose name starts with a dash (-), use this:
    View      : -*
    To create a collection of all folders that reside in a subdirectory of the current directory, use this:
    View      : */*
    The above will work if the hierarchy delimiter is slash (/). If the hierarchy delimiter is dot (.), use this:
    View      : *.*
    For details about why I use this View, see this 2005-July-01 message that I posted to comp.mail.pine. Also see Managing Your News Reading with newsrc(s) and “Views” below.

  • To speed up accessing folders that you frequently access, set the enable-incoming-folders feature and add frequently-accessed folders to your incoming-folders list. For details, see Using the Incoming-Folders Collection (aka Pine Shortcuts) below.

  • When I want to edit my folder-collections or news-collections, I often directly edit my pinerc using a text editor, such as vim or pico -w, rather than using Pine's cumbersome COLLECTION LIST configuration screens (discussed in this section and in my Pine wish list on the All About Pine page). I have instructions and tips for doing this in Setting Up Pine for Multiple IMAP Accounts on the IMAP Service Providers page.

  • You can add an IMAP collection to a news-collections list and an NNTP collection to a folder-collections list. This is useful if you want your collections in a particular order or if you compartmentalize your Pine configuration & use the INHERIT token with these variables.

  • Instructions for moving messages from a folder in one collection to a folder in a different collection are in Using Aggregate Operations to Select and Move Messages below.

  • If you want to access messages on a POP server, I recommend that you use Pine's “Maildrop” feature, which is discussed in Using Pine's Built-In Fetch (#move) Ability below.

  • More folder-collection tips are in Speeding Up Pine below.

  • More information about folder collections is in Syntax for Collections at the UW Pine Information Center.

 

Important     After you set up Pine to access your folder collections, you will be able to use Pine to manage and create mailboxes in your folder collections. When you are choosing a name for a mailbox, do not use the string  inbox  or  mbox  or  mail.txt  or  inbox.mtx   or  default  or any combination of upper and lower case letters of any of these strings. For details about the problems with these names, see Notes About Mailbox Names in the Procmail Quick Start.

 

8. Creating an IMAP-Accessible Personal Address Book

With Pine you can look up addresses in personal address books, global address books, and LDAP directories (as long as Pine was built with LDAP support). The last two are usually set up and maintained by a system administrator and shared by many users. Personal and global address books can be one of the following two types:

Note    
  • On some systems both Pine and the IMAP server run on the same machine. In this case an IMAP-accessible address book is on the same system and so is not really “remote.” Because of this scenario, I prefer to use the phrase “IMAP-accessible address book” rather than the phrase “remote address book.”

  • IMAP-accessible address books and IMAP-accessible configuration files are available in Pine 4.30+.

 

If you are going to use only a local personal address book, you do not need to do anything to set up your address book because this is the Pine default. But if you would like a personal address book to reside on an IMAP server and be usable by WebPine or Pine running on a different system, you will probably want to set up an IMAP-accessible address book.

  1. To set up addressbook(s), type MSA (Main > Setup > AddressBooks). In the default PC-Pine configuration, the top of the screen looks like this:
    PINE 4.64 SETUP ADDRESS BOOKS
     
      addrbook 
          Personal AddressBook in Pine\addrbook 
     
      [ Move here to add a Global Address Book ]
    The PC-Pine default personal address book resides in the same directory as your pinerc and is named addrbook. In Unix Pine, the default personal address book is in $HOME and is named .addressbook.

  2. To add an IMAP-accessible personal address book, put the focus on a Personal AddressBook (e.g., addrbook in the example screen above) and type A.

    Important     We are not adding a global address book so do NOT put the focus on

     [ Move here to add a Global Address Book ]

    Usually only a system administrator creates and updates a shared global address book.

  3. To add an IMAP-accessible personal address book, fill in the server name, folder name, and (optionally) nickname. For example:
      PINE 4.64   ADD ADDRESS BOOK
       
    Server Name : xxx.imap.server/user=LoginName
    Folder Name : path.to.abook-imap
    NickName    : abook-imap
    
    
    Notes
    • Your IMAP-accessible address book will be stored as a message in the folder named abook-imap (or whatever folder name you just specified). Old versions of your remote address book are stored as messages in this folder. The number of versions stored is determined by the remote-abook-history setting in your pinerc.

    • When you specify path.to.abook-imap:
      1. Make sure you use the correct hierarchy delimiter — slash (/), dot (.), or backslash (\) — for the IMAP server. I once used Msgs\abook-imap instead of Msgs/abook-imap on a UW IMAP server and it took me a while to figure out why abook-imap hadn't been created (a file with the confusing name Msgs\abook-imap had been created in $HOME!).
      2. It is best if the folder abook-imap does not already exist. This will ensure that Pine creates a folder with the special “x-pine-addrbook” header line.

    • If you run Unix Pine on your IMAP server and have a local address book (e.g. $HOME/.addressbook) that you use with Unix Pine, you can not use this as your IMAP-accessible address book because it is a simple plain text file and not a message in an IMAP-accessible folder.

    • Here are some ideas for the name of your IMAP-accessible address book:
      • Give it a name that contains the string “imap” or “remote” to remind you not to try to use this address book as a local address book when (if) you run Pine in a shell on the server.

      • Give it a name that will sort near the bottom of your folder list. For example, you could name it zz-abook-imap.


  4. To save your settings and exit this screen, type ^X.

  5. If you want your IMAP-accessible address book to be the default for where addresses are taken from and put into, use the shuffle command ($) to move it to the top of your address book list.

  6. To exit the Setup Address Books screen, type E.

  7. To view and test your address books, type MA (Main > AddrBook).

 

To learn more about IMAP-accessible configuration files & address books, and address books in general, see:

 

9. Copying Addresses in a Local Personal Address Book to an IMAP-Accessible Personal Address Book

The steps in this section copy the addresses from a Pine local address book to an IMAP-accessible address book. Before you go through steps 9A-9K, make sure you have gone through steps 8A-8G in the previous section and that both the local and IMAP-accessible address book are listed in the ADDRESS BOOK LIST (which you get to using Main > AddrBook) for the Pine you are currently using.

Tips    
  • Make a back up of each of your address books before you go through the steps below!

  • Alternate ways to copy addresses from a local to an IMAP-accessible address book (or vice versa) are described in the section Transferring Configurations To and From an IMAP Server on the page Compartmentalizing and Sharing Your Pine Configuration. For example, you can run the following from the command line or a script.
    pine -copy_abook localAbook remoteAbook
    In addition to to uploading your local address-book addresses, this command will create the remote address book if it does not already exist.
  1. Go to your address book list by typing MA (Main > AddrBook).
  2. Use the up or down arrow key to select the local address book that has the addresses you want to copy.
  3. Press ENTER to view the addresses in the address book.
  4. To select all addresses in the address book, type ;A (Select > All). (If the ; command doesn't work you need to go to the Pine Setup Configuration screen using MSC and set the enable-aggregate-command-set feature.)
  5. To copy the selected addresses, type ASS (Apply > Save > Save to address book). You will get a prompt like this:
    Save to which addrbook : abook-imap
    ^G Help                ^P Prev AddrBook
    ^C Cancel  Ret Accept  ^N Next AddrBook
            
  6. If the suggested addrbook (abook-imap in this example) is not where you want to save the address, type ^N or ^P until you get to the IMAP-accessible address book you want to copy these addresses to.
  7. Press ENTER to accept the specified address book. You will see status messages that say Pine is writing, saving, and sorting. After the addresses have been copied, you will see a message that says [Saved NN entries to IMAP abook] where NN is the number of entries that were copied and IMAP abook is the nickname of the address book.
  8. To check that the addresses were copied correctly, go to your address book list by typing MA (Main > Address Book).
  9. Use the up or down arrow key to move to the IMAP-accessible address book.
  10. Press ENTER to view the address book. If the saved addresses are not listed, try quitting and restarting Pine and then checking the IMAP-accessible address book.
  11. Now you can set up Pine on machines around the world to use this IMAP-accessible address book.

 

10. Setting Up Keywords (Labels)

Starting with Pine 4.60, which was released 2004 May 10, Pine supports keywords, which are also known as user-defined labels, user-defined flags, or user-defined tags. To set up Pine keywords, go to Main > Setup > Config (MSC) and use the WhereIs (^W) command to search for keywords. To learn how keywords are used in Pine, type ? or ^G and read Pine's Help about Keywords. To add a keyword and optionally a nickname for it, type A.

If you want to be able to use the same keywords in lots of different IMAP clients, including Pine, SeaMonkey Suite, Thunderbird, Cone, and Mulberry 4.0.1+, include the following five $LabelN common keywords in your list of Pine keywords.

keywords = Nickname1  $$Label1
           Nickname2  $$Label2
           Nickname3  $$Label3
           Nickname4  $$Label4
           Nickname5  $$Label5

where you specify any (case sensitive) string you like for NicknameN and order these however you like.

For example, if you use the keyword $Label4 to mean “To Do” (which is the SeaMonkey Suite/Thunderbird default meaning of this keyword) and if you want this keyword listed first on your Pine FLAG MAINTENANCE screen, you could specify the following on the Pine SETUP CONFIGURATION screen.

keywords = ToDo       $$Label4
           nicknameN  keywordN

For details about nicknames and keywords, including why two dollar signs ($$) are needed to specify a keyword with only one dollar sign in its name, e.g. $LabelN, see Pine's Help about Keywords. In addition to specifying keyword names and their nicknames, you may also want to do some or all of the following.

  1. Set enable-flag-cmd so you can use the flag command (*) to set and clear keywords.
  2. Set enable-flag-screen-keyword-shortcut (available in 4.62+). This makes it possible to set a keyword by typing asterisk (*) followed by the first character of the keyword's nickname. For example, typing *T would set the ToDo keyword (defined in the above example). Note that the keyword shortcut is case insensitive and *t would also set the ToDo keyword.
  3. Set enable-aggregate-command-set so you can...
    1. use a select command (; or :) to select messages and then apply the flag command (A*) to the selected messages.
    2. create a virtual mailbox (i.e. select & zoom) based on keywords (;K). For an example of a Pine virtual mailbox, see the next section, Index Color Rule and Virtual Mailbox Example.
  4. Include one of the following tokens in your index-format setting (discussed in Step 6F above).
    1. SUBJKEY (available in 4.60+)
    2. KEY (available in 4.62+)
    3. SUBJKEYINIT (available in 4.62+)
    4. KEYINIT (available in 4.62+)
    If you use either the SUBJKEY or SUBJKEYINIT token, you might want to change the keyword-surrounding-chars from the default characters, which are:
      "{" "} "
       ^   ^^
    left   right
    I am currently experimenting with using these keyword-surrounding-chars:
    "" "| "
    I.e., nothing on the left and the pipe character (|) on the right.

  5. Set up colors that depend on keywords.
    1. Use MSK to set the color of a keyword or its INITial (available in 4.62+).
    2. Use MSRI to set Indexcolor Rules that depend on keywords (available in 4.60+).
    For more about color and an example Indexcolor rule, see Fun with Color and Kolor in the next section.
  6. Set up Roles, SetScores, Filters, or Other Rules that either depend on or set/clear keywords.
  7. Set up server-side filters, using, for example, Procmail, Sieve, or Maildrop, to assign keywords during message delivery. For a Procmail example, see Setting Keywords or Labels in the Procmail Quick Start. For Sieve examples, see Greenlisting with Sieve and Using a MaybeSpam Mailbox in my blog, each of which includes a script that uses the Sieve addflag command.

To configure #1-4, go to Main > Setup > Config (MSC). To configure #5b and #6, go to Main > Setup > Rules (MSR).

[Updated!] Important:  Keywords do not work on NNTP, POP, and some IMAP servers. For example, the Gmail IMAP server, which is discussed in Setting Up Your Gmail Collection above, does not support IMAP keywords.

 

Keyword
Tips
   
  • Whenever possible, use a system-level flag/label/status/tag, such as Answered (A), Flagged (*), Read or Unread, because these are more likely to be accessible to lots of different IMAP clients and available on different servers (for example, if you move a labeled message to a different server).

  • If you include the SUBJKEY or KEY token in your index-format, use short nicknames. For example:
    • If you use the common IMAP keywords proposed by Alexey Melnikov, you could use F for Forwarded, W for Work, P for Personal, etc.
    • If you use my Reverse Spam Filtering strategy and terminology, you could use M for Magenta/Magnet, V for Violet/Virus, B for Blue/Bulk, G for Green/Good, Y for Yellow/Unknown, etc.
    • If you use David Allen's Getting Things Done strategy, you could use @ for “Action item,” 1 for “Next Action,” P for “Pending/Waiting for a response from the person to whom an action was delegated,” M for Maybe/Someday, D for Deleted/Trashed, category-name for categorized messages, and _ (underscore) for Done/Filed.
    Using short nicknames will minimize the amount of screen real estate that keywords take up on your Pine MESSAGE INDEX screen.

    Tip:  In Pine 4.62+, the SUBJKEYINIT or KEYINIT token can be used to display only the initial (first character) of each keyword.

  • You can set multiple keywords on a message. For example if you use the Getting Things Done system, you could label a message with 1, @, and ii if the message is the next action item in the ii (Infinite Ink) category. After you deal with the message, you could add the label _ (for Done/Filed). You might want to clear the @ and 1 labels, but you also might want to leave those labels because 1) it's easier and 2) it will remind you that this message was an action item.

    Note that some IMAP clients, for example Cone, SeaMonkey Suite, and Thunderbird, display at most one keyword per message. Each of the Pine index-format keyword tokens, SUBJKEY, KEY, SUBJKEYINIT, and KEYINIT, displays all keywords that are set on a message (as long as they are specified in Pine's Keywords variable).

  • If you use Opera Mail, the $LabelN IMAP keywords are not supported and you will instead need to use IMAP keywords named XOPL-N. For example, to label a message “Funny” ([clown (Funny label icon)]) in Opera Mail, you can use Pine to set the XOPL-6 keyword on the message. I have tested this only with the Opera 9.0 βeta. Please let me know what, if any, IMAP keywords are supported in Opera 8.51 and earlier.

  • If your system uses MMDF or Unix-mbox formatted mailboxes, make sure that this feature is not set:
    [ ]  quell-folder-internal-msg
    These two mailbox formats need the c-client internal (aka pseudo) message in order to be able to record IMAP keywords and other metadata. To learn more about the c-client “pseudo message,” see What are the messages with the subject DON'T DELETE THIS MESSAGE--FOLDER INTERNAL DATA about? in the Pine FAQ.


For more information about keywords, see:

 

[16 colors in an 8x2 grid] 11. Fun with Color and Kolor

Color was introduced in Pine 4.20, which was released on 1999 October 12. To set your Pine colors, go to:

Since there are so many settings, you may want to use someone else's color settings as a starting point. When I first started experimenting with Pine's colors, I used Starv's settings at dotfiles.com and made a number of changes, including changing “normal color” to white on blue, and the “title” and “keylabel” color to white on black. If you come up with a good set of colors, how about being a good net citizen and contributing them to dotfiles.com/Mail Clients/Pine.

If you edit your pinerc file directly, rather than from within Pine, you can specify colors using color names or RGB (Red Green Blue) values. For example:

          Pine Name       RGB Value in PC-Pine       Comment
          black     000,000,000    
    blue   000,000,255    
    green   000,255,000   the HTML color keyword for this RGB value is lime or green1
    cyan   000,255,255    
    red   255,000,000    
    magenta   255,000,255    
    yellow   255,255,000    
    white   255,255,255    

You might be able to use the RGB values of any color that is supported by your system. For details, see color-style, Color Configuration, and patterns-indexcolors in the UW PIC Configuration and Preferences; and Color Details in the UW PIC Technical Notes on Configuration and Preferences.

Speed Tip:  If you have a slow connection to the Net, for example 56 kilobits/second (kbps) or slower, and if you run Pine on a remote system in an ssh window, you might want to use Pine's default colors. This is discussed in Speed Tip #28 below.

 

Index Color Rule and Virtual Mailbox Example

If you use my Reverse Spam Filtering system, you may want your solicited-bulk-email (mailing-list) messages to be colored blue on your Pine MESSAGE INDEX screen. An easy, but not exact, way to do this is to create an INDEX COLOR RULE (by typing MSRIA) with the following conditions.

 

  PINE 4.64   ADD A COLOR RULE
Nickname          = SBE
Comment           = Solicited Bulk Email
 
==================== CURRENT FOLDER CONDITIONS BEGIN HERE ====================
                                                                                                  
Current Folder Type =                                                                             
            Set    Choose One                                                                     
            ---  --------------------                                                             
            ( )  Any                                                                              
            ( )  News                                                                             
            (*)  Email                                                                            
            ( )  Specific (Enter Incoming Nicknames or use ^T)                                    
                 Folder List = <No Value Set>                                                     
                                                                                                  
==================== COLORED MESSAGE CONDITIONS BEGIN HERE ====================
                                                                                                  
To pattern           = <No Value Set>
From pattern         = <No Value Set>
Sender pattern       = <No Value Set>
Cc pattern           = <No Value Set>
News pattern         = <No Value Set>
Subject pattern      = <No Value Set>
Recip pattern        = <No Value Set>                 
Partic pattern       = <No Value Set>                
Precedence pattern   = bulk, list
Add Extra Headers
:
 

To add an extra header field, such as Precedence, to the COLORED MESSAGE CONDITIONS, move your cursor to Add Extra Headers and type X (eXtraHdr). If the pattern is a list of values, such as  bulk, list  in the above example, then the condition is satisfied if one of the values in the list is matched. Details are in Pine's built-in Help about Patterns, which you can get by typing ^G or ? while your cursor is in one of the pattern condition lines.

Not all solicited-bulk-email messages include a  Precedence: bulk  or  Precedence: list  header line, but enough do that this index color rule is very useful to me. I hope it — or a similar rule — is useful to you too! To learn about other headers that you can use to identify solicited bulk email, see Alternatives to the ^TO_ Macro in the Procmail Quick Start.

 

Virtual Mailbox Tip

Starting with Pine 4.62, which was released 2005 Jan 18, you can use Pine's aggregate operations (details below) to quickly select messages that satisfy a rule's conditions. For example, to select messages that satisfy the SBE (Solicited Bulk Email) rule above, type:

; R SBE

which means Select > Rule > SBE. You can then use Z to zoom in on or zoom out from the selected messages. To flip the selection, i.e., to select the messages that do not match this rule, type:

; F

To broaden or narrow the selection, use one of the following along with your desired criteria:

; B
; N

Messaging clients, such as Pine 4.62+, that allow users to zoom in on messages that match saved conditions are said to support “saved searches” or “faceted mailboxes” or “virtual mailboxes.” Virtual mailboxes can be used to help you manage MaybeSpam messages, ToDo messages, and other facets of your messaging world.

 

12. Setting Fonts

To change the screen font that PC-Pine uses, drop down the Config menu (in the MS-Windows-style menu bar) and choose Set Window Font. The Font list box contains a list of the fixed-width fonts on your system. Experiment with different fonts until you find one you like. Some fonts that I kind of like are vt100, Fixedsys, Lucida Console, Monaco, ProFont, and Bitstream Vera Fonts. The vt100 font (vt100.fon) is shipped with VanDyke Software's great terminal emulator SecureCRT. You can get this font by either trying out CRT or SecureCRT or from one of these places:

In order for a font such as vt100 to be available to PC-Pine, you may need to go to Start > Settings > Control Panel > Fonts > File > Install New Font and install the font on the system.

To learn about the interaction of fonts and character codings, see character-set and the euro sign above and the Microsoft Euro Currency Resource Center.

To learn more about monspaced fonts, see ProgrammerFonts in Keith Devens' Wiki and Monospace/Fixed Width Programmer's Fonts at Lowing.org.

 

13. Testing and Quitting

Now you are ready to test your configuration.

  1. Type C to compose and send a message to yourself.
  2. When the message arrives, view it and make sure the Date, including the timezone (step 2C), From header, and other headers are correct.
  3. Type H to view the message's full headers and make sure Pine is not sending any information that you'd like to keep private. If H does not display the full headers of the message, follow the instructions in Step 6B above to enable-full-header-cmd.
  4. Type S to save the message to a different folder.
  5. Type R to compose and send a reply to the message.
  6. Type L to go to your collection list and check to make sure your messages are being saved in the folders, directories, and possibly server(s) where you want them to be saved.
  7. Type T to take an address from a message and put it in an address book.
  8. Compose a message using the nickname of the address you just added to your address book.
  9. When you are done testing Pine, type Q to quit.

Tip: To do a more thorough test of Pine, see the Test Checklist in the Pine Technical Notes.

 

 

14. Cleaning Up

  1. After you quit Pine, use Windows Explorer to go to your %HOME% directory and look at the files and directories that Pine created. Your configuration information is stored in %HOME%\Pine in a file named pinerc.
  2. If in step 3C you changed your local folder collection to something other than the default %HOME%\mail, you can delete the %HOME%\mail directory. Before you delete it, make sure it does not contain any folders you want to keep. If it does contain folders you want to keep, move them to your local folder collection (for me that's %HOME%\Msgs).
  3. Delete the pmxxxw32.zip file, which is in the directory you created in step 1B.

 

Quick Editing of Pinerc, Mailcap, and Other Files with No File Extension

In Windows Explorer you can double click on a file and the default action is determined by the file extension. For example, .txt files are opened in your default text editor. For files with no extension, such as pinerc, newsrc, and mailcap, double clicking produces the File Open dialog box, which asks you to pick a program to use to open the file. To set up your system so that double clicking on files with no extension opens them in a text editor, do the following:

  1. Click the Windows Start button and choose Settings > Folder Options and then choose the tab labeled File Types. This opens the Folder Options dialog box.
  2. Choose the button labeled New Type. This opens the Add New File Type dialog box.
  3. In the text box labeled Description, type something to describe files with no extension. I use No Extension.
  4. In the text box labeled Associated Extension, type three spaces by pressing the spacebar three times.
  5. In the drop-down list box labeled Mime Type, choose text/plain.
  6. Under Actions, choose the button labeled New to open the New Action dialog box.
  7. In the text box labeled Action, type Edit or Edit with Notepad or Edit with Whatever (or actually anything you like!).
  8. Use the Browse button to find and select the application that will be used to perform the action. Possibilities include %WINDIR%\notepad.exe and C:\Progra~1\Vim\Runtime\gvim.exe.
  9. Choose Open to accept the editor you selected.
  10. In the “Application used to perform action” text box, append "%1" (including the quotation marks) to the path and name of the application you chose in step H so it looks like:

      C:\Progra~1\Vim\Runtime\gvim.exe "%1"

    where the first part is the path to your editor. Appending "%1" ensures that files with spaces in their names or path will be opened.
  11. Choose OK to close the New Action dialog box.
  12. Choose OK to close the Add New File Type dialog box.
  13. Choose OK to close the Folder Options dialog box.
  14. In Windows Explorer, find a file that has no extension, for example pinerc, and double click it to see if it is opened in the application you selected in step H.

 

Launching Pine

There are lots of ways to start Pine. For Unix and Mac Pine, you can usually just type pine at a command prompt. For PC-Pine, you can use Windows Explorer to find pine.exe on your system and then double click it. Or you can choose Run from the Windows Start menu and type the absolute path to pine.exe and click OK. You can even lauch Pine from a DOS prompt by typing the absolute path to pine.exe at the DOS prompt. Below I discuss some other ways to launch Pine.

 

Using a Shell Script to Launch Pine

If you use a Unix-like system, for example FreeBSD, Linux, or OS X, and if you always want to use some Pine command-line arguments when you launch Pine, you can create a wrapper script that launches Pine. For example, I use a script similar to the following on my Mac.

#!/bin/sh
/usr/local/bin/pine -P "${HOME}/Pine/pinercconf-mac" -p "${HOME}/Pine/pinerc" -x "${HOME}/Pine/pinercex" "$@"

To make this long line easier to read and edit, you can split it over multiple lines by using a continuation backslash. To split a line, type backslash (\), immediately followed by newline, followed by whitespace (spaces, tabs, and/or newlines). For example, the above script is equivalent to the following.

#!/bin/sh
# The above "shebang" ("#!") means this script is run as a Bourne shell script.
  
# This script runs pine with the arguments listed below PLUS any arguments that
# are specified on the command line (that's what the $@ variable means). 
   	
/usr/local/bin/pine \
  -P "${HOME}/Pine/pinercconf-mac" \
  -p "${HOME}/Pine/pinerc" \
  -x "${HOME}/Pine/pinercex" \
  "$@"
	
# Tip: You may want to use ${1:+"$@"} or ${1+"$@"} rather than "$@" in the last line above

You can name your script whatever you like, for example, you might call it mypine or simply pine. After you create the script, use a command like this to make it executable:

chmod +x mypine

If the script is in a directory that is not on your PATH, you need to specify the path when you run it, i.e., you need to use a command like one of these:

./script
relative/path/to/script
/absolute/path/to/script

To avoid needing to specify the path to the script, put the script in a directory that is listed in your PATH environment variable. For example, if $HOME/bin is on your PATH, you could put it there.

Important: If you name the script pine, make sure that the script's directory is listed in your PATH before the directory where the real pine resides. Otherwise running pine will launch the pine binary rather than your pine script.

To learn about Unix-like shells and shell scripts, see:

For another example of a Pine-related shell script, see the Build Tips in Using a PASSFILE with Unix and Mac Pine above.

To learn about the -P, -p, -x Pine command-line arguments that are used in these scripts, see man pine and Compartmentalizing and Sharing Your Pine Configuration.

 

[green pine icon] Putting a PC-Pine Shortcut on Your Desktop and Start Menu

  1. Use Windows Explorer (or My Computer or the Find command) to find pine.exe on your system.
  2. Right click on pine.exe and choose Copy.
  3. Minimize all windows so you can view your desktop.
  4. Right click on your desktop and choose Paste Shortcut.
  5. Right click on the Pine icon on your desktop and choose Rename. Overtype the word PINE with the word INBOX.
  6. Again right click on the Pine icon and this time choose Properties. Edit the Target text box so that the path to pine.exe is followed by a space and the Pine command-line argument -i. On my system the Target looks like this:
    "C:\Program Files\Pine\pine.exe" -i
            
    The -i argument tells Pine to start on the message index rather than the Pine Main Menu.
  7. Double click on the icon and see if it works to open your INBOX message index.
  8. Right click on the Pine INBOX icon on your desktop and choose Copy.
  9. On the Windows Start Menu choose Settings > Taskbar & Start Menu. Choose the Start Menu Programs tab and then click the Advanced button. In the right panel under the list of names, right click in a blank region and choose Paste. This will paste a copy of your Pine INBOX shortcut on your Windows Start Menu.

 

Launching PC-Pine on a Specific Mailbox from Windows Explorer

As I discussed in the Quick Editing of Pinerc, Mailcap, and Other Files with No File Extension above, you can double click on a file in Windows Explorer and the default action is determined by the file extension. The Pine default is to use no file extension for mailboxes but you might want to start doing this because then

  1. You can use the extension to signify the folder format, e.g., traditional Unix mail spool (mbox), c-client MBX, or mtx.
  2. You can open the folder in Pine by double clicking on it in Windows Explorer.
  3. You can backup all your mailbox files by specifying these file extensions in your backup program.

Below I give instructions for how to associate a file extension with Pine and how to create a pop-up menu that says “Open with Pine.”

Tip     Do not use .mbx as the extension for mailboxes that are in c-client MBX format. This extension is used by many mail clients, for example Mulberry and Eudora, to mean a format other than c-client MBX format. Does anyone know if there is a standard extension for c-client MBX folders? What do you think of .cMBX or .ccm?

Also, using the extension .mbx makes mailboxes vulnerable to viruses, such as the Welyah virus (aka Shoho or I-Worm), that search out and destroy or harvest .mbx files on a system.

 

Using a File-Extension Association

The PC-Pine default folder format is c-client MBX format and the Unix Pine default folder format is “Unix mail spool” (AKA mbox) format. Both PC-Pine and Unix Pine understand both these folder formats. I use the extension .cMBX for folders that I create with PC-Pine. For folders that are in Unix mbox format, I use either no extension or .Umbox. In the following steps, I walk you through associating the .cMBX extension with PC-Pine.

  1. Click the Windows Start button and choose Settings > Folder Options and then choose the tab labeled File Types. This opens the Folder Options dialog box.
  2. Choose the button labeled New Type. This opens the Add New File Type dialog box.
  3. In the text box labeled Associated Extension, type cMBX (or Umbox or whatever extension you use for message folders).
  4. Under Actions, choose the button labeled New to open the New Action dialog box.
  5. In the text box labeled Action, type Open with Pine.
  6. Use the Browse button to find pine.exe on your system and double click on it.
  7. In the text box labeled “Application used to perform action” you should now see something like C:\Progra~1\Pine\pine.exe. Append -if to this so it now says:
    C:\Progra~1\Pine\pine.exe -if
    Note: Do not append "%1" to this because Pine has quotation marks built in and a second set of quotation marks will not work.
  8. Choose OK to close the New Action dialog box.
  9. Choose OK to close the Add New File Type dialog box.
  10. Choose OK to close the Folder Options dialog box.
  11. In Windows Explorer, find a message folder that has the extension .cMBX and double click it to check if it is opened in Pine.

 

Using a Pop-Up “Open With Pine” Menu Item

For files that do not have a file extension, you probably do not want the default MS Windows association to be to open with Pine. On my system, I set the default action for files with no extension to be to edit with my text editor and set things up so that if I right-click on these files, one of the menu items is to “Open with Pine.” Here's how to set this up.

  1. To set up a MIME type for files with no extension, follow the instructions in Quick Editing of Pinerc, Mailcap, and Other Files with No File Extension.
  2. Click the Windows Start button and choose Settings > Folder Options and then choose the tab labeled File Types. This opens the Folder Options dialog box.
  3. In the Registered file types list box, select No Extension.
  4. Choose the button labeled Edit. This opens the Edit File Type dialog box.
  5. Choose the button labeled New.
  6. In the text box labeled “Action” type

        Open with Pine

  7. In the text box labeled “Application used to perform action” type

       C:\path\to\pine\pine.exe -if

  8. Choose OK to close the New Action dialog box.
  9. Choose OK to close the Edit File Type dialog box.
  10. Choose OK to close the Folder Options dialog box.
  11. In Windows Explorer, find a message folder that has no extension and right click on it. Choose “Open with Pine” on the pop-up menu to check that the folder is opened in Pine.

 

Launching Pine from a mailto: or news: URL in a Web Browser

Most browsers have a built-in mail and news client but if you want to be able to use your Pine address book, roles, Fcc settings, and more, you'll probably want to set up your browser to use Pine for mail and news. This will enable you to click on a mailto or news URL — such as [email icon]mailto:nm-this-address-is-valid@no.sp.am or [NNTP icon]news:comp.mail.pine — and launch Pine. The sections below describe how to set this up in Internet Explorer, Navigator, and Opera.

Test Your Browser

If you are viewing this page in a web browser, you can test how your browser handles mailto: and news: URLs using these URLs

[email icon]mailto:nm-this-address-is-valid@no.sp.am
[email icon]mailto:nm-this-address-is-valid@no.sp.am?subject=Hi Nancy
[NNTP icon]news://news.gmane.org/gmane.org.infiniteink

Internet Explorer

Go to Tools > Internet Options > Programs and in the drop-down list box for both E-mail and Newsgroups, choose PC-Pine.

Navigator and Mozilla

If you are using a stand-alone version of Navigator, follow these Netscape instructions for Using MAPI Mail Clients with Navigator 4.0x . You also need to follow the instructions in the next section to make Pine be your default MAPI client.

If you use Mozilla or Netscape version 6 or 7, see Using the default system email client with Mozilla - Windows and Mac only and Muttzilla.

Opera

Go to File > Preferences > Email and select “Use external mail application” and put the following in the text box:

  C:\path\to\pine\pine.exe %
  

Opera 6 supports mailto: URLs that specify the subject of the mail message, but Opera 5 and earlier do not.

Alternatively, if PC-Pine is your system default mail client, you can select “Use system default” in the File.Preferences.Email dialog box and then you do not need to specify the command.

Lynx

Lars Eighner posted a message to comp.mail.pine with the Subject Using pine with mailto urls in lynx (unix) that describes how to do this. More information is on the Lynx site, e.g. in URL Schemes Supported in Lynx.

See Also

Search for mailto in the Evolution  Knowledge Base. Especially relevant is How do I make Evolution handle mailto: links in my browser? This may give you ideas for how to make Pine handle mailto: links in your browser.

 

Making PC-Pine Your System's Default MAPI Client

If you want Pine to be the program that is launched when you choose “Send To Mail Recipient” in either a mail-enabled Windows applications or when you right click on a file in Windows Explorer, do the following.

  1. Go to ftp://ftp.cac.washington.edu/pine/pcpine/ and do a binary download of pmapi32.zip. Make sure that you are using the corresponding version of PC-Pine so that all these files are compatible.
  2. Unzip it into your Pine program files directory.
  3. Read readmemapi32.txt, which is included in the zip file.
  4. [Optional] Create an empty text document named  mapi_debug.txt  in your %TEMP% directory. To find out about setting and checking environment variables such as %TEMP%, see Setting Environment Variables above.
  5. Close all programs running on your machine.
  6. Run instmapi.exe to make the Pine MAPI file your default messaging API (application program interface).
  7. (¿¿¿Question: What is a good way to test if this is working???)

Notes    

 

Privacy and Security

Privacy Configuration Settings

The following feature-list settings 1) might prevent you from sending a message somewhere you don't want to send it; and 2) might hide information about your local system and the SMTP & NNTP servers that you use. To edit your Pine feature-list and other configuration settings, type MSC (Main > Setup > Config).

Note: To be able to use all the features listed in this section, you need to be using Pine 4.60+ or Alpine.

feature-list                     = 
            Set    Feature Name     
            ---  ---------------------- 
             :
  [ Reply Preferences ]
             :
            [ ]  reply-always-uses-reply-to
             :
  [ Sending Preferences ]
            [X]  disable-sender  
             :
            [ ]  send-without-confirm
            [ ]  use-sender-not-x-sender
             :
  [ News Preferences ]
            [ ]  compose-sets-newsgroup-without-confirm
             :
            [X]  hide-nntp-path
             :
            [ ]  predict-nntp-server
            [ ]  quell-extra-post-prompt
             :
  [ Advanced User Preferences ] 
             :	
            [X]  quell-timezone-comment-when-sending
             :
            [X]  scramble-message-id
 

In addition to these feature settings, I also recommend that you unset the nntp-server variable in any role that you do not want to use to post to NNTP newsgroups. To unset a variable in Pine, set it to:

""

For example, in a role, specify this:

Use NNTP Server = ""
                  ^^
                  Pine will convert this to the string <Empty Value>

Or this (which I prefer):

Use NNTP Server = bogus

Note that this setting will be relevant only if predict-nntp-server is unset, which is one of the feature-list settings I recommend in this section. To learn more about why you might want to do this, see The Problem with Receiving an Email Message that Includes a Newsgroups Header Line on the All About Pine page.

For more feature-list suggestions, see My 27 Favorite feature-list Settings in Step 6 above.

Tip: Some outgoing SMTP service providers will scrub your email headers to make it hard (or impossible) for your email recipients to determine your email client, your IP address, and more. For example, LuxSci, which is one of my email service providers, offers Additional Privacy with Anonymous SMTP.

See Also: EFF: Privacy and EmailPrivacy.info.

 

Use Non-Standard Directory and File Names

If an intruder or virus gets into your system, you can try to thwart his/her/its efforts to find your files by using non-standard names for directories and files. For example, I suggest you name your %HOME%, Program Files, and mail directories something weird and non-standard, and name your mailboxes using either no extension (which is the Pine default) or using an extension other than .mbx. The Welyah virus (aka Shoho or I-Worm) harvests email addresses from *.mbx files so you do not want any *.mbx file on your system to contain a valid email address!

If you build your own version of Pine to use a password file (PASSFILE), you should name the default file that stores your passwords something non-obvious and definitely something other than the default pine.pwd. Alternatively, you can invoke Pine using the -passfile command-line argument to specify the name and location of your Pine PASSFILE.

You can also make files and directories hidden but this will fool only the dumbest of viruses.

To find out if your system is vulnerable to intruders from the Internet, use either Shields Up! at Gibson Research Corporation or one of the many security scanners listed at the Open Directory Project (dmoz.org).

 

Attachments

The best way to deal with viruses is at your incoming mail server. If you have access to Procmail on your mail server, I recommend that you read the section called Snagging Viruses in the Procmail Quick Start. An alternative is to use a mail service provider that runs up-to-date virus scanning software on their server. There are many such providers listed on my IMAP Service Providers page.

 

A common way for a virus to spread is through an email attachment that can run a program (I use the word “program” to include scripts and macros). To avoid this type of virus, do not run a program that you receive in email. Even if it is sent to you by a friend. These programs can be buried in files that you usually think of as just containing data, such as a Word or Excel document. Or even an HTML document. If you are super paranoid, you can turn off scripting in Windows, Word, Excel, your web browsers, and any other program on your system that supports scripting. But if you need to be able to use scripting on your system, you can set up Pine so that you can not easily launch programs from within Pine. The way to do this is to create a mailcap file that Pine will use to determine how to handle MIME attachments that you receive. Pine can also use a mimetype file to determine how to handle MIME attachments that you send.

Note     PC-Pine uses the Windows registry to associate programs, file extensions, and MIME types. You need to use a mailcap or mimetype file only if you want to override a registry association.

 

How To Process an Attachment in Pine

Before you even think about opening an attachment, you should find out as much as you can about it. To do this, first view the message in the Pine Message Text screen, then type V to view the Attachment Index, use the arrow key to select the attachment you're interested in, and type A to find out about the attachment. The About Attachment screen looks like this.


   PINE 4.64   ABOUT ATTACHMENT
 
 Details about Attachment #2 :


           Type            : Application
           Subtype         : OCTET-STREAM
           Encoding        : BASE64
           Parameters      : NAME = IKissYou.TXT.vbs
           Description     : "Message from Mahir to you!"
           Disposition     : ATTACHMENT; FILENAME = IKissYou.TXT.vbs
           Approx. Size    : 27 bytes
           Display Method  : "via Windows-specific method"

This is the details of the attachment that is part of the message with subject “PC-Pine, I Kiss You” that I sent to comp.mail.pine after the ILOVEYOU virus broke out. As you can see, the display method is "via Windows-specific method", which means that it will be opened using whatever the Windows registry says to use to open a .vbs file. The default setting is for Windows to run the Visual Basic script.

To process the message, type E to exit the About Attachment screen and go back to the Attachment Index, then do one of the following:

 

Type This    To Do This

Enter  or  >  or  V
or double click on the attachment name  

 

Open the attachment using the “display method” that was listed on the About Attachment screen.

 

S    Save the attachment as a file on your hard disk. You can then run a virus scan on the file, open it using whatever program you want, etc.

If you are using PC-Pine, you can also right click on the attachment and choose View, Save, Delete, or About.

Starting with Pine 4.61, which was released 2004 July 15, you have the option of exporting a message and all its attachments by typing E (Export) followed by ^P (AllParts) from either the MESSAGE INDEX or the MESSAGE TEXT screen.

 

Avoiding Application Viruses

To avoid viruses like the ILOVEYOU virus, put one of the following lines in the file %HOME%\Pine\mailcap (PC-Pine) or $HOME/.mailcap (Unix, Linux, Mac Pine):

  application/*;""

  application/*;C:\Progra~1\Vim\Runtime\gvim.exe -R %s

  application/*;C:\Path\your-favorite-editor.exe %s

where the italicized words (C:\Progra~1\Whatever) are replaced with the correct path for your system. These lines tell Pine what to use to open a file whose MIME type is Application and whose MIME subtype is anything (*) other than what is explicitly specified elsewhere in your mailcap file. So, for example, an attachment of type Application/MSWORD will be opened with whatever program you specify in your mailcap for the type Application/MSWORD (see the next section for how to view Word documents).

The first line tells Pine to use nothing ("") to open this type of file, i.e., to not open it! When you use this setting and try to open an attachment of type Application/*, Pine displays this message:

  [Can't start viewer. Windows error 161.]

Question: Does anyone know of a mailcap setting you can use that will produce a message that does not contain the word “error”? E.g., something that would produce a message like this:

  [Don't know how to display Application/OCTET-STREAM attachments. Try Save.]

The second line tells Pine to open this type of file as a read-only file in the editor gvim (this is what I use). You can use a modified version of the third line to tell Pine to use your favorite editor to open these type of attachments. It's a good idea to open an “application” in read-only mode so you don't accidentally corrupt it.

With the second mailcap setting for application/*, I see the following on the About Attachment screen for the IKissYou attachment:


   PINE 4.64   ABOUT ATTACHMENT
 
 Details about Attachment #2 :


           Type            : Application
           Subtype         : OCTET-STREAM
           Encoding        : BASE64
           Parameters      : NAME = IKissYou.TXT.vbs
           Description     : "Message from Mahir to you!"
           Disposition     : ATTACHMENT; FILENAME = IKissYou.TXT.vbs
           Approx. Size    : 27 bytes
           Display Method  : "C:\MyProgs\Vim\Runtime\gvim.exe -R <datafile>"

 

And I do not have to worry about accidentally running a malicious attachment that is of type Application/whatever, such as a Visual Basic script.

If you want to completely disable Windows Scripting Host on your computer, see How to uninstall Windows Scripting Host at F-Secure.

 

Avoiding Mislabeled Application Viruses such as Nimda, Badtrans.B, and KLEZ

One of the ways that the Nimda, BadTrans.B, and KLEZ worms propagate is as a MIME attachment that is an executable file but is mislabeled as type audio/x-wave, audio/x-wav or audio/x-midi. I don't know if PC-Pine users are vulnerable to mislabeled attachments, but to be sure that you are not add this to your mailcap file

audio/*;""

This means that the if the MIME type is labeled audio and the MIME subtype is anything (*), use nothing ("") to open this type of file, i.e., do not open it. And then make sure you don't run any attachment that is labeled audio/* by hand!

To learn more about this type of virus, see the Microsoft Security Bulletin (MS01-020): Incorrect MIME Header Can Cause IE to Execute E-mail Attachment.

 

Avoiding MS Word Viruses

A common way for a virus to spread is through a macro that is part of a MS Word document. It is a good idea to set up your system so that Word documents you receive via Pine are viewed in Word Viewer, WordPad, or wv rather than Word. WordPad is part of Windows but it can not view Word 97 documents; it can only view documents created by earlier versions of Word. Word Viewer is free from Microsoft and it can view documents created by any version of Word. You can find out more about Word Viewer and download it here or here.

If you are using Pine on a non-PC platform, such as Unix or OS/2, you can use wv to load and parse Word 2000, 97, 95 and 6 file formats. You can find out more about wv and download it at wvWare or SourceForge.

To tell Pine what program to use to view Word documents, put a line like one of the following lines in the file in your mailcap:

  application/MSWORD;"C:\Program Files\Accessories\wordpad.exe" %s

  application/MSWORD;"C:\Program Files\WordView\wordview.exe" %s

where the italicized words (C:\Program Files\Whatever) are replaced with the correct path for your system. Since neither of these programs support macros, a macro virus won't be able to infect your machine if you open a Word document with either of them. However, if you use MS Word to open a Word document that contains a macro, you can become infected.

More information about preventing, detecting, and removing Word macro viruses is at MultiLinker's Word is acting strangely, and wasn't a couple of weeks ago! and Bruce A. Epstein's Avoiding viruses in Word documents and elsewhere.

 

Avoiding HTML Viruses

Attachments that are of type text/html can contain malicious scripts and web bugs. To avoid these, do one of the following
  1. set up your Pine mailcap file so that HTML attachments are displayed using a browser that has scripting and images turned off;  or

  2. set up your Pine mailcap file so that text/* or text/html attachments are displayed using a text editor;  or

  3. set up the Pine default web browser so it does not run scripts and does not display images (this is what is used to display HTML attachments if no viewer is specified in the mailcap file)

For option #1, you could use

  text/html;C:\Progra~1\Lynx\lynxbat.bat %s

You can download the latest Lynx for Windows from FDISK.COM.

For option #2, you could use

  text/*;C:\Progra~1\Vim\Runtime\gvim.exe -R %s

If you have any suggestions for how to deal with potentially dangerous attachments or HTML, please let me know. Also, if you have anything to add to the list of Pine Security-Enhancement Wishes that is on my main Pine page, please let me know that too.

 

[So long, and thanks for all the passwords] Do Not Send Your Password in Plaintext

The default for most mail and news clients is to send passwords in plaintext. This means that anyone using a packet sniffer, such as ngrep or Sniffit, can find out your password.

Using TLS/SSL, CRAM-MD5, Kerberos, or OTP

If your IMAP server supports TLS/SSL, CRAM-MD5, Kerberos, or OTP you can use one of these protocols to connect to the server without doing plaintext authentication. To tell Pine to disable plaintext authentication and to use the most secure authentication supported by Pine and the server, append /secure to your server specification in your pinerc. To tell Pine to use TLS or SSL, which will encrypt the entire session, append /tls (available in 4.40+) or /ssl (available in PC-Pine 4.20 & higher and Unix Pine 4.30 & higher). PC-Pine is pre-built with TLS/SSL support but Unix Pine needs to be built with TLS/SSL support. Here are some example server specifications:

   {your.imap.server/user=LoginName/tls}
Or
   {your.imap.server/user=LoginName/secure}
Or
   {your.imap.server/user=LoginName/tls/secure}

If you establish a secure TLS/SSL connection to an IMAP server, there will be a plus sign (+) in the top right corner of your Pine window. For TLS/SSL access to some IMAP servers, you need to include the qualifier /novalidate-cert  — this is unsafe and you should ask your IMAP server's admin to set up the system so it sends valid certificates.

To ensure you are always using a secure connection, make sure that you append /tls or /secure (or both) to every occurrence of your server specification in your pinerc and that you always see a plus sign (+) in the top right corner of your Pine window. If your ISP doesn't let you securely connect to their IMAP server, get a new IMAP service provider!

For more information, see:

 

Using SSH Port Forwarding (Tunneling)

If a server either does not support TLS/SSL, CRAM-MD5, or Kerberos or if a server allows access only from trusted IP addresses (this is common for SMTP and NNTP servers), you can use SSH port forwarding (tunneling) to encrypt passwords and make your server requests appear to be coming from the local system. The following describe SSH port forwarding:

If you are the administrator of your systerm and want to tunnel to only one IMAP, SMTP, and NNTP server, it is simplest to tunnel through your local system's default IMAP port (143), SMTP port (25), and NNTP port (110). After you set up SSH port forwarding, edit your pinerc so that every occurence of the name of a server that you have tunneled to is replaced by either localhost or [127.0.0.1]. Your IMAP server specification will look like one of the following:

{localhost/user=LoginName}   
{[127.0.0.1]/user=LoginName}

Your SMTP and NNTP server specifications will look either like this:

smtp-server=localhost
nntp-server=localhost  

Or this:

smtp-server=[127.0.0.1]
nntp-server=[127.0.0.1]  

If you are not the administrator of your system or if you connect to more than one IMAP server, you need to use a different local port number for each remote IMAP server you connect to. What I do is use port numbers 2143, 3143, ..., 9143 for SSH forwarding to different IMAP servers. And then the IMAP server specifications look like one of the following:

{localhost:9143/user=LoginName}   
{[127.0.0.1]:9143/user=LoginName}

 

Important    
  • Before you can use Pine to access a tunneled server, you need to run your SSH client, connect to the remote host, and establish the tunnel.

  • Ports less than or equal to port 1024 are privileged ports and only the administrator (root) of a system can forward these ports. The 2002-Jan-02 thread Re: feature request: choose smtp in the pine-info mailing list discusses this.

 

Tip     To ensure that you always use ssh port forwarding to connect to a server, delete the file pine.pwd (or rename it to something like pine.pwd.OLD). Create a new empty pine.pwd by following the instructions in step 4 and then when you are prompted for the localhost password, type the password for the server that localhost is tunneled to. If you are ever prompted to give the password to something other than localhost or localhost:port, don't do it! Instead, quit Pine and go into your pinerc and change all server names to localhost and make sure you've set up ssh port forwarding for all servers.

To discuss ssh or port forwarding, go to[NNTP icon]comp.security.ssh.

 

More Security Links

More about security is at:

Speeding Up Pine

The speed tips in this section are separated into 31 General Speed Tips and 7 NNTP Speed Tips. The general speed tips are relevant when Pine is accessing a POP server, an IMAP server, an NNTP server, an (E)SMTP server, a local file system, or running remotely in an ssh window. The NNTP speed tips are relevant only when Pine is accessing an NNTP server.

[Updated!] 31 General Speed Tips

  1. In its default configuration, Pine first tries to use rsh or ssh to connect to an IMAP server and then, if that does not work, it tries to establish the connection using IMAP. If it's not possible to connect to the server using rsh or ssh, Pine (and the user!) wastes time while Pine tries. To tell Pine not to try rsh or ssh, set the following
    rsh-open-timeout=0
    ssh-open-timeout=0
    
    Since these are hidden variables, you need to either manually put these lines in your pinerc or set the expose-hidden-config feature (discussed in Step 6A above) and then you can edit these -- and all hidden configuration settings -- from the Pine configuration screen.

    Alternatively, if you explicitly specify the port in a server's specification using, for example, imap.server.name:143 or imap.server.name/ssl (which usually implies port 993), Pine will not try to use rsh or ssh to connect to the server. I discuss how to specify and qualify a server in Running Pine the First Time and Setting inbox-path and Other Essential Variables above. Starting with Pine 4.41, you can use the  /norsh  flag in a server specification to tell Pine to not try to use rsh or ssh when connecting to that server. Using either the port number, the /ssl flag, or the /norsh flag are especially useful when specifying a pinerc file that is stored on an IMAP server.

    For more about this, see Why is there a long delay in Pine or any other c-client based application call before I get connected to the IMAP server? The hang seems to be in the c-client mail_open() call. I don't have this problem with any other IMAP client. There is no delay connecting to a POP3 or NNTP server with mail_open(). in the IMAP Toolkit Frequently Asked Questions.

  2. If speed tip #1 doesn't speed up your connection to an IMAP (or POP) server, it could be that xinetd (running on the server) is trying to connect back to the IP Address that initiated the connection. To learn more about this, see the comp.mail.imap messages slow mail retrival and Got it: Long Delay in POP3 Login to IMAP, and xinetd by Frédéric Raynal at LinuxFocus.org. The server administrator -- not a regular user -- needs to fix this.

    For more about this, see Why is there a long delay before I get connected to the IMAP or POP server, no matter what client I use? in the IMAP Toolkit Frequently Asked Questions.

  3. To have Pine present the Message Index of a mailbox as quickly as possible, set
    sort-key=Arrival
    or, if you prefer reading messages from newest to oldest, use this
    sort-key=Arrival/Reverse
    With either of these settings, Pine won't need to sort the mailbox but instead will present the messages in the order that they are sitting in the mailbox. This is especially useful when you are accessing either a mailbox or newsgroup that contains a lot of messages, or a newsgroup that's on a flaky NNTP server (see the first NNTP speed tip below). Another advantage of sorting by Arrival is that a message that was sent from a system with an incorrect date setting will be sorted more correctly than if you have Pine sort by Date.

  4. If you use IMAP over SSL/TLS to connect to an IMAP server and you have the option of creating an SSH tunnel to the IMAP server, you might get faster access to the server by using a compressed SSH tunnel rather than SSL/TLS. For more about this, see the thread IMAP over SSL vs IMAP over SSH tunnel (Was: slow message index display with IMAP over dialup).

  5. Pine buffers keystrokes so you do not need to wait for Pine to respond to a keystroke before continuing issuing commands. One caveat is that PC-Pine does not seem to buffer mouse wheel rotation clicks (which in my mouse configuration are equivalent to PageUp and PageDown keystrokes) so when I want to page down through a long Message Index screen, I press PageDown (or Spacebar) over and over again, rather than use my mouse wheel. And then while I'm waiting for all the PageDowns to take effect, I do something else in another window.

  6. If you have more than one Internet Access Provider (IAP), you may be able to speed up sending messages by setting your first SMTP-server setting to be the one that is used by the IAP you are currently using to jack in to the Internet.

  7. Another way to speed up Pine is to make your address book(s) and frequently used folders (postponed-folder, default-fcc, default-saved-msg-folder, read-message-folder, & maybe even your inbox-path) local rather than remote. Unfortunately this is not very useful for people who want their address book and folders accessible from multiple machines.

  8. Each time you compose a message, Pine checks all your address books for the recipient(s). Pine is able to check local address books quickly but remote IMAP-accessible address book checks can take a long time if you have a slow connection to the Net. If you have multiple remote address books, you can speed up Pine by reducing these to one remote address book.

  9. Starting with Pine 4.20 there is a hidden variable called remote-abook-validity, which tells Pine how often it should automatically compare your cached local copy of the address book with the remote address book. 0 means check only when you start Pine and -1 means never check. Since the cached copy of my address book is almost always good enough, I include the following in my pinerc:
      remote-abook-validity=0
    
    You can force Pine to update your local address book cache by typing ^L from the address book screen.

  10. Another hidden feature is quell-partial-fetching. You can try adding this to your pinerc feature-list and see if it speeds up Pine for you. Please let me know if it does (or doesn't!).

  11. Yet another hidden feature is save-aggregates-copy-sequence. Setting this, which is the default, “may save network traffic when the source and destination folders are on the same IMAP server.” I prefer to unset this so that the order of messages is preserved when I do an aggregate save. Note that, as discussed in this pine-info thread, especially in this and this message, this feature has no effect if keywords are present in the messages that are being copied.

  12. Using the index-format token ATT, which displays the number of attachments in each message, slows down presentation of the MESSAGE INDEX screen. When I removed ATT from my index-format specification, I noticed a significant speed improvement.

  13. Using Pine's default index-format seems to be faster than the alternatives that I've experimented with. For details about this, see the 2003-July-11 comp.mail.pine message tip: speeding up (newsgroup) index display by Alex. Please tell me if you know which tokens, in addition to ATT (see previous tip), slow down the display of the Message Index.

  14. Unsetting mark-for-cc will speed up the display of the Pine Message Index. Thanks to Gabe Anderson who posted this tip in comp.mail.pine.

  15. When I want to do a full text search of a large remote mailbox (using ;TA) or a group of mailboxes, I fire up Pine on one of my remote Unix accounts and perform the search from there. That way I save resources and bandwidth on my local computer and the search is a lot faster because the Unix machine's IMAP connection is much faster than my local computer's measly ~56 kilobits/second connection.

  16. If you have a mailbox that contains more than 1000 messages, split it into separate mailboxes, each of which contains less than 1000 messages and see if that improves the speed of accessing and updating the mailbox. Some mailbox formats, for example maildir* and traditional mbox, can be quite slow when there are a large number of messages in a mailbox. If this works to speed up Pine, ensure that all your mailboxes contain less than 1000 messages.

    *Note 1:  The official UW Pine cannot access local maildir mailboxes but it can access maildir mailboxes when they are on an IMAP server that is set up to serve maildir mailboxes (e.g. on a Binc, Courier, or Dovecot IMAP server).

    Note 2:  Eduardo Chappa has created an unofficial maildir patch for Pine.

  17. If your mailboxes are stored locally or are on a UW IMAP server, use c-client MBX or MIX mailbox format rather than good ol' traditional Unix spool (mbox) format. C-client MBX and MIX formats are significantly more efficient than mbox format. For more about this, see Wish #5: Let Pine Users Choose Their Default Local Mailbox Format on the All About Pine page.

  18. Set up incoming-folders so you can use TAB to quickly step through the mailboxes and newsgroups that you read regularly. Details are in Using the Incoming-Folders Collection below.

  19. To speed up accessing a mailbox that you frequently access, add it to your incoming-folders list and give it a nickname. For example, I put my SENT folder in my incoming-folder list because I frequently need to re-read or forward a message that I sent and it is easier to open it from my incoming-folders list or to use its nickname than it is to find and drill down in the appropriate folder collection. See the next item for a related tip.

  20. If it takes a long time for Pine to build a folder list when you type ML (Main> Folder List), try these settings:
    [X]  combined-folder-display
     :
    [ ]  expanded-view-of-folders
    
    This will quickly display your incoming-folder list, which is stored locally, and your unexpanded collections and eliminate the often time-consuming “Formatting Scroll Text” message. Note that you can quickly go to a folder from anywhere in Pine by typing G (for Go To Folder) and then specify the folder by typing the initial letter(s) and using TAB completion.

  21. mail-check-interval

    1. If you regularly get the message
      [MAIL FOLDER "INBOX" CLOSED DUE TO ACCESS ERROR]
      
      and if your IMAP server is running on a Unix system, you might be able to alleviate this problem by editing your Pine configuration file (using MSC) so the mail-check-interval is set to 60 seconds or less. The edited line in the Pine Setup Configuration screen will look like this:
      mail-check-interval = 60
      
      Some details about this bug and its fix are in the groups.google.com archives. If you still get the inbox-closed error message with a setting of 60, try a lower number. To be polite to the IMAP server and its users, you should use the highest number that prevents the inbox-closed error message.

    2. If you do not have the above problem (#21A) and if you have a slow connection to the Net, you can speed up Pine (and also make your computing life more peaceful by not being constantly interrupted by new-mail announcements) by setting your mail-check-interval to a high number that is less than 1800 seconds (30 minutes), for example:
      mail-check-interval = 1740
                            ^^^^
                            29 minutes
      This way you will rarely get interrupted by Pine checking your mail server. Whenever you want to check for new mail you can type ^L (redraw screen) or X (expunge), or do one of the things I describe in Checking for Recent Messages below.

      According to section 5.4. Autologout Timer of the IMAP specification, the minimum inactivity autologout timeout is 30 minutes. So, as long as you “ping” an IMAP server at least once every 1800 seconds your IMAP connection should stay alive.

  22. If Pine mailchecks interrupt you when you are composing a message, you can set these two features, which are available in Pine 4.60+:
    [X]  quell-mailchecks-composing-except-inbox                                            
    [X]  quell-mailchecks-composing-inbox
    Note that on some systems, mailchecks are needed to keep IMAP connections alive and if you set these two features, you will sometimes lose your IMAP connections while composing a message. Because of this, I recommend setting these features only if mailchecks during composition are a big irritant.

  23. If you use Pine's built-In fetch (#move) ability to automatically fetch messages from a maildrop folder, set maildrop-check-minimum to a fairly high number and definitely higher than or equal to your regular mail-check-interval, which I discuss in speed tips #21A and #21B above. For example, I use at least 3600 seconds (60 minutes) because my maildrop folders receive only low priority messages. This speeds up Pine because it is “expensive” to check a maildrop folder. Note that there is no need to keep open (aka “keep alive”) an NNTP or POP maildrop because in order to check these for recent messages, Pine needs to close and re-open the folder.

    Tip:  To turn off automatic checking of maildrops entirely, set maildrop-check-minimum to zero (0).

  24. Setting the hidden feature disable-shared-namespaces (which is available in Pine 4.40+) will prevent password-lookup delays on some systems.

  25. On some systems you can set the feature enable-background-sending to make sending appear to be fast. This feature has some potential problems and is not available on MS Windows, DOS, and some flavors of Unix.

  26. If you always use a non-default Sort Order or Startup Rule for a particular mailbox, use MSRO (Main> Setup> Rules> Other) to create an "Other" rule for that mailbox. For example, I have Other rules that automatically:
    • sort my Blogstreet-Info-Aggregator mailbox by the To header (because the To header starts with the Blog ID)
    • sort my MaybeSpam mailbox by the Subject header (because the Subject header in this mailbox starts with the spam score¹)
    • sort my virus (violet) mailbox by Size (so that similar viruses are grouped together and it will be easier to find any non-virus message)
    • set the Startup Rule for public or shared IMAP folders to Last (because the Seen and Recent flags are updated when anyone accesses these mailboxes and thus are not especially useful to me; see the next speed tip for info about Startup Rules)
    • sort NNTP mailboxes by thread
    [1] If you are curious about how I get the spam score in the Subject, see Reverse Spam Filtering: Winning Without Fighting. This page also discusses my general mail-filtering strategy and my magenta, blue, green, yellow and red (MaybeSpam) mailboxes.

  27. Set your default incoming-startup-rule so that when Pine opens an incoming mailbox, the focus is on the message (or region of the mailbox) that you are most likely to want to view. My preference is the following.
    incoming-startup-rule            =
                Set    Rule Values
                ---  ----------------------
                ( )  first-unseen
                (*)  first-recent
                ( )  first-important
                ( )  first-important-or-unseen
                ( )  first-important-or-recent
                ( )  first
                ( )  last
    This way you will usually be able to immediately start reading messages and you won't need to spend time navigating through the mailbox to find the messages that you are interested in. For information about the meaning of the terms Recent and Unseen, see the next speed tip and the Terminology section below.

  28. If you have a slow connection to the Net and if you run Pine on a remote system in an ssh window, try one or both of the following.
    1. Set the assume-slow-link feature.
    2. Use the default Pine color settings, especially the default index colors. To use the default Pine colors in Unix or any non-PC Pine, specify this setting on the PINE CONFIGURATION screen:
      color-style                      =
                  Set    Rule Values
                  ---  ----------------------
                  (*)  no-color
                  ( )  use-termdef
                  ( )  force-ansi-8color
                  ( )  force-ansi-16color
                  ( )  force-xterm-256color   (256 colors available only in Alpine)
    To make it easy to launch Pine with one or both of these settings when you have a slow connection, create an alias (shortcut) with your desired Pine command-line arguments. For example, if you have a really slow connection and if the remote shell is based on csh, you might want to use this:
    alias reallyslowpine "pine -assume-slow-link -color-style=no-color"
    If your connection is medium slow, e.g. between 28 and 56 kilobits/second (kbps), you might want to use this:
    alias slowpine "pine -color-style=no-color"
    Tip: If you like slowpine, you might like slowfood and other “Slow” movements.


  29. Starting with Pine 4.60, the Pine default is to (try to) keep alive two old (earlier) connections so that these connections can easily be re-used. On some systems, these background connections can cause problems. If you get an error message, such as either of these:
    Waited X seconds for server reply.  Still Waiting...
    MAIL FOLDER "foo" CLOSED DUE TO ACCESS ERROR
    you may be able to solve the problem by setting max-remote-connections to be less than the default, which is 2, e.g.:
    max-remote-connections = 0
                             ^
                             or 1
    Another possible way to solve this problem is to use mailchecks to keep all your IMAP connections alive. For details, see speed tip #21, which is about mail-check-interval, and speed tip #22, which is about the quell-mailchecks-composing-* features, above.

    Note that Pine will keep alive the current folder, your primary INBOX (inbox-path), and any stay-open folder (discussed below) independent of the value of max-remote-connections. For details, see max-remote-connections in the Pine Technical Notes.


  30. Set up your Pine rules so that the set of messages that Pine needs to scan is minimal. For example, rules for Filters, Indexcolor, and SetScores usually need to check only messages that arrived since the last time you opened the mailbox or newsgroup (because the non-recent messages were filtered, etc. the last time the mailbox was open). To specify this, use the following condition in the RULE setup screen:
    Message is Recent? =                                                                          
                Set    Choose One                                                                       
                ---  --------------------                                                               
                ( )  Don't care, always matches                                                         
                (*)  Yes                                                                                
                ( )  No
    This is especially useful for speeding up filtering, scoring, and index-coloring in a newsgroup that has tens of thousands of unexpired messages. For examples of such newsgroups, see the list of gmane.linux.debian.* newsgroups, especially gmane.linux.debian.user, which has over 300,000 messages!  Note that being able to specify the Recent status in a rule condition was introduced in Pine 4.50, which was released 20 November 2002. For more information about the meaning of the terms Recent, Seen, and Unseen, see the Terminology section below.

  31. When you want to read some, but not all, messages in a mailbox, select each message you want to read using colon (:) and then after they are all selected, type Z to zoom in on them and create a “virtual mailbox.” Now you can use N (next), P (previous), and other Pine navigation commands to quickly move between the selected messages. To zoom out of the virtual mailbox and view the entire mailbox, type Z again.

7 NNTP Speed Tips

Many of the General Speed Tips above are relevant to both IMAP and NNTP messaging. The last two above, #30 and #31, are especially useful for news reading. The tips in this section are relevant only to NNTP messaging.

  1. Use an NNTP server that follows the NNTP specification, especially in its implementation of the LISTGROUP command. For more information about this, see the message Re: Lockups while 'sorting' in comp.mail.pine.

  2. When you want to read most, but not all, of the messages in a newsgroup, use D to delete each message that you do not want to read and then type X to “expunge” them. Note that newsgroup messages are not actually deleted -- they are just hidden and you can view all messages that haven't expired from the NNTP server by typing  & on the Pine Message Index screen. If you want to read less than half the messages in a newsgroup, it's probably more efficient to use the technique described in the last general speed tip (#31).

  3. Set news-post-without-validation in your feature list (this is one of my 27 favorite settings that I suggest in step 6B). This will prevent Pine from fetching the (often very large) ACTIVE file from your NNTP server(s) each time you compose a news message.

    Note:  If you are not always able to connect to all your NNTP servers, you might want to unset this feature so that Pine will make sure that you are currently able to post to the NNTP server that carries the newsgroup(s).

  4. Setting news-deletes-across-groups can make Pine very slow when you leave a newsgroup so I recommend not setting this.

  5. You can speed up future openings of a newsgroup by “deleting” all the messages that you don't want to see the next time you open the group. To delete messages, use either an aggregate delete command (for example ;AAD) or have Pine offer to delete all messages when you leave a group by setting news-offers-catchup-on-close. Pine does not actually delete messages from the news server and you can view all unexpired messages in a newsgroup — even those marked deleted — by using the & command. You can hide “deleted” messages by typing X (for expunge).

  6. When you are at the last message in a newsgroup, you can press TAB and Pine will move to the next new message in the next newsgroup that has new messages. The behavior of TAB depends on the settings of the features continue-tab-without-confirm, enable-cruise-mode, tab-visits-next-new-message-only, and news-read-in-newsrc-order. If you have set news-offers-catchup-on-close (see previous tip), you can press TAB immediately followed by Y or N to quickly move beyond Pine's asking you if you want to delete all undeleted messages in the group.

  7. If you read news on a news server, such as the Gmane.org, that does not expire messages, newsgroups can contain tens of thousands of messages and it can take a very long time for Pine to open such a newsgroup, especially if you use rules to automatically filter, thread, color, or score the group. Starting with Pine 4.55, you can set the nntp-range variable to limit the number of messages that Pine will access in a newsgroup. Note that the nntp-range variable is ignored if you access news over IMAP.

More NNTP-related tips are in Miscellaneous NNTP Tips & Incoming-Folders Tips below, and in General Speed Tips above.

 

 

[red pine icon] Checking for Recent Messages

There are many ways to check if mailboxes and newsgroups contain recent messages. This section discusses:

 

Terminology

Since Pine is primarily an IMAP client, it uses the following IMAP terminology: A message is ...

Note:  Pine and many other clients use READ as a synonym for SEEN, but the word “READ” is misleading because a message body that has been SEEN has not necessarily been read.

With most mail and news clients a user can easily change the status of a message from SEEN back to UNSEEN (aka from READ back to UNREAD). For example in Pine, you can do this using the Flag command (*). However, the only way to change the status of a message from NOT RECENT to RECENT is to move it to another IMAP mailbox and then it will be considered RECENT there.

Beware:  The term NEW is not well defined and has different meanings in different mail clients. For example, in SeaMonkey Suite and Thunderbird, the term “New” usually means “Recent & Unseen.” In Mulberry a user can go to Preferences > Mailbox > Advanced and specify whether “New Messages”:

( ) are Unseen
( ) are Recent
( ) are Recent and Unseen
 

In Pine, the meaning of “New” depends on the context . . .

 

Because of these ambiguities, I try to avoid the term “New” when discussing the status of a message.

[brain-meltdown image from Cronenberg's film 'Scanners'    

Tip
To avoid brain meltdown due to the ambiguous nature of message status New or N, I sometimes think that a message marked N is “Not read” or “Not seen.”

 

For more about message status, flags, and labels, see:

For more about terminology, see Terminology and Typographic Conventions Used in This Article above.

 

 

Checking the Current Mailbox and Stay-Open Mailboxes for Recent Messages

When a message arrives in . . .

. . . a description of the newly arrived message is displayed in the Pine status line. Also, if you are running Pine in an X terminal or if you are using PC-Pine, the Pine icon will indicate that a new message has arrived. Pine checks these mailboxes at least every mail-check-interval seconds.

If you are eagerly awaiting the delivery of a message to a stay-open mailbox or to the currently open IMAP mailbox and you don't want to wait for Pine to do a mail check, you can force a mail check by doing one of the following:

  1. Type ^L to redraw the screen
  2. Type X to eXpunge
  3. While viewing the folder index, put your cursor on the last message and type either N, TAB, or DOWN ARROW.
  4. While viewing the message text of the last message in the folder, type either N or TAB.

[New!] Note: The commands in #3 and #4 do not work if the folder index is sorted by one of the Reverse sort keys, for example they do not work if sort-key=Arrival/Reverse. Starting with Alpine 0.9999+, you can use UP ARROW on the top message to do a mail check.

 

Mail-
Check
Notes
   

 

 

Using tab-checks-recent or the folder-reopen-rule

To be able to check for recent messages in a newsgroup, POP box, read-only box, or unopened IMAP box, set the following on the Pine SETUP CONFIGURATION screen.

To learn how these options work, read the relevant Pine Help files, either at the above two links or by typing ^G on the Pine SETUP CONFIGURATION screen.

An alternate way to check these type of boxes for recent messages is to Use Pine's Built-In Fetch (#move) Ability, which is available in Pine 4.55+.

If you are using a version of Pine that does not have these features (Pine 4.53 or earlier), you can close and re-open a mailbox by using Terry Gray's wacky workaround.

 

Using Aggregate Operations on a Folder List

You can use Pine's aggregate operations on a folder collection to select folders that contain RECENT messages. To do this, type ML to go to the FOLDER LIST and move your cursor to the folder collection that you are interested in. If the collection is not expanded, expand it by pressing ENTER. Next type

;P
to select based on Properties. Pine will display this prompt:
Select by which folder property ?		
 ? Help           U Unseen msgs     C msg Count                                                             
^C Cancel         N [New msgs]  		
		

To select folders that contain RECENT messages, type N. You can then use Z to zoom in on or zoom out from the selected folders.

 

Aggregate-
Operations
Tip
    For more examples of and discussion about Pine's aggregate operations, see:

 

 

Using the Incoming-Folders Collection (Pine Shortcuts)

Another way to check for RECENT messages (and to do a lot more) is to use Pine's Incoming-Folders collection. This pseudo or virtual collection is a list of nicknames to POP, IMAP, NNTP, and local folders. You can think of this collection as your Pine Shortcuts or Aliases or Pointers or Bookmarks or Favorites or Daily Reads or (Soft) Links. Do not be fooled by the word incoming; your Pine incoming-folders list is a collection of any folders — whether they receive incoming messages or not — that you want to be easily accessible.

Pine's incoming-folders variable allows you to:

To be able to use incoming folders and the above incoming-folders features, do the following.

  1. Type MSC to go to the Pine SETUP CONFIGURATION screen and set this feature:
    [X]  enable-incoming-folders 
    In order for this setting to take effect, you must quit Pine.

  2. To specify your incoming-folders list, do one of the following:
    • EITHER: Open your pinerc file with a text editor, such as pico -w, and directly edit the incoming-folders variable.


    • OR:
      1. Restart Pine.
      2. Type MSC to go to the SETUP CONFIGURATION screen.
      3. Type ^W followed by Normally hidden and edit the incoming-folders list variable. Important: To be able to see the Normally hidden configuration options, you need to set expose-hidden-config, which is one of my favorite feature settings.



    • OR:
      1. Restart Pine.
      2. Type ML to go to the COLLECTION LIST screen.
      3. Move the cursor to INBOX in the Incoming-Folders FOLDER LIST. You may need to first press RETURN to expand your Incoming-Folders collection.
      4. Type A to add an incoming folder.
      5. At the Name of server prompt, type one of the following:
        • ^X if the folder resides on the same (IMAP or NNTP) server as your Pine primary INBOX (which is specified in your Pine inbox-path variable);  or...
        • any IMAP or NNTP fully qualified server specification (described in Step 7F above and in Server Name Syntax at the UW PIC). Tip: To get a template for a server specification, type ^X and then edit this template server specification;  or...
        • RETURN if the folder resides on the local file system. Warning: If you share this pinerc with pines running on different computers, this local incoming folder will refer to a different folder when pine is running on a different computer;  or...
        • ^W if you want to use a #move folder (discussed below).
        Tip: To view Pine's built-in Help for this prompt, type ^G.

      6. At the Folder prompt, type the path.to.folder.name and make sure you use the correct hierarchy delimiter for the server. The delimiter on an IMAP server is usually forward slash (/), dot (.), or backslash (\); the delimiter on an NNTP server is usually dot (.). If you are adding the default INBOX on an IMAP or POP server, type INBOX at the Folder prompt. (Note that the string INBOX has a special meaning to an IMAP or POP server and the server will tranlate the string INBOX to a particular user's default INBOX on the server.)
      7. At the Nickname prompt, type the nickname you'd like to use. I recommend that you do not use whitespace (spaces or tabs) in an incoming-folder nickname.
        Important: Do not use the string inbox or INBOX, or any combination of upper- and lower-case characters of this string, because this is a Pine reserved nickname.
      8. Save this new incoming folder.
      9. Optionally use the Shuffle command ($) to change the order of your incoming folders.
      10. Optionally Quit (Q) and restart Pine. For a thorough test, I do this, but it is not essential.
      11. Type ML to go to the COLLECTION LIST screen
      12. Select the new nickname and press ENTER and make sure it opens the correct folder.


      For a specific example, see Adding your FastMail.FM INBOX to your Pine incoming-folders list that I posted in gmane.org.infiniteink. Feel free to join the discussion in this, or any, gmane.org.infiniteink thread.

    Important: On some servers, for example on NNTP servers, any folder that you add to the Pine incoming-folders list must already exist. Remember that an incoming folder is a nickname (aka shortcut) to an actual folder.

 

To learn more about incoming folders, see:

If you have access to the Pine source code and a compiler, Eduardo Chappa has created a patch that will make Pine notify you automatically of new mail in incoming folders.

Incoming-
Folders
Tips

   
  • As mentioned in the Pine Technical Notes, the Incoming-Folders collection is a pseudo collection (aka virtual collection or cabinet) and this collection behaves differently from a regular collection. For example:
    • It is not possible to use an aggregate operation (;) to search these folders based on Properties or Text.
    • The Add (A), Delete (D), and Rename (R) commands are applied to an incoming-folder's nickname rather than to the actual folder.

    • Remember: An incoming folder is a nickname (aka shortcut).


  • If you want your Incoming-Folders collection to be automatically expanded when you go to the FOLDER LIST screen, set the combined-folder-display feature. For more about this, see Speed Tip #20 above.

  • The folder specified by your inbox-path variable, which is discussed in Step 5D above, is considered your primary incoming folder. It has the special nickname INBOX and it is listed first in your Incoming-Folders list. You can set your goto-default-rule so it is very easy to go to this folder from anywhere in Pine. For example, with some settings you can simply type G followed by RETURN to go to your INBOX.

    Important:  The string INBOX has a special meaning in Pine (and most IMAP clients), and you must not explicitly specify the string INBOX — or any combination of upper and lower case letters of this string — as the nickname of a Pine incoming folder. For more recommendations about naming folders, see Notes About Mailbox Names in the Procmail Quick Start.

  • If you often use Pine's GoTo (G) command to go to a nickname in your Incoming-Folders collection, set your goto-default-rule to this:
    (*)  inbox-or-folder-in-recent-collection
    As long as Incoming-Folders is your most recent collection, it will be considered the default collection for a GoTo command.

  • Add NNTP groups that you frequently read to your incoming-folders list by using syntax like this:
    incoming-folders=goi {news.gmane.org/nntp}gmane.org.infiniteink,
                     ^^^
                     nickname    
    
    gmane.org.infiniteink is the Infinite Ink discussion group and you are welcome to join!

  • To read summaries of the current BBC Front Page and Technology News, include the following public NNTP folders in your incoming-folders list:
    bbc     {freenews.genecast.com/nntp}news.bbc.news.front.page,
    bbctech {freenews.genecast.com/nntp}news.bbc.news.technology,
    ^^^^^^^
    you can (of course) use anything you like for the nicknames
    

  • Put mailboxes that are frequently the target of a Save (S) command in your incoming-folder list with a nickname that can be easily TAB completed. For example, the bottom of my incoming-folders list looks like this:
    :            :
    spam-trainer {mail.mxes.net/tls/user=UID}Auto-Train/Spam,
    ham-trainer  {mail.mxes.net/tls/user=UID}Auto-Train/Ham,
    _done        {mail.mxes.net/tls/user=UID}_done
    And I use these nicknames to quickly save to these mailboxes. For example, to save a spam message to the Bayesian spam trainer at mail.mxes.net (Tuffmail), I type S (for Save), followed by spam-, followed by TAB, followed by RETURN. This sequence of keystrokes works if enable-tab-completion is set, if spam-trainer is the only nickname that begins with the string spam-, and if Incoming-Folders is the target collection for the save (you can use ^P and ^N to change the target collection).

  • Unset continue-tab-without-confirm so that you have the option of stopping Pine from cycling through all your incoming folders if a problem is encountered. This is useful when one of your IMAP or NNTP servers is not accessible and you don't want Pine to waste time checking all incoming folders on that problematic server.

  • In addition to continue-tab-without-confirm, the other features and variables that are relevant to incoming-folders are:
    auto-open-next-unread 
    enable-cruise-mode 
    enable-cruise-mode-delete 
    enable-fast-recent-test  (does not work with some servers)
    return-to-inbox-without-confirm (available in Pine 4.55+)
    tab-uses-unseen-for-next-folder (available in Pine 4.60?+)
    tab-visits-next-new-message-only
    incoming-archive-folders (discussed below and at the UW PIC)
    incoming-startup-rule
    stay-open-folders (discussed above and at the UW PIC)
    use-regular-startup-rule-for-stayopen-folders

  • If there is a file that you periodically download via FTP and if this file is accessible via IMAP, you can add it to your Pine incoming-folders list and then use Pine as a pseudo FTP client. For example, I include this in my incoming-folders list:
    {ftp.cac.washington.edu/anonymous}#ftp/pine/pine.tar.gz
    And whenever there is a new Pine release, I use Pine to open this “folder” and save this Pine tarball to my local system. This is an example of a folder that is in the #ftp/ namespace of an IMAP server. To learn about namespaces in general, see the Wikipedia.org page about Namespaces (programming).

  • To make it easier to create and edit incoming-folders specifications in your pinerc, you may want to use an environment variable for the specification of IMAP and NNTP servers that occur frequently in your pinerc. Details are in the next section.

 

Using Environment Variables to Specify Folders and Collections

If there is a server specification fragment that you use repeatedly in your pinerc, you may want to store it in an environment variable. The advantages of doing this are that:

  1. You can use a short variable name instead of a long hard-to-remember server specification.
  2. If there is a change in the server specification, you need to change it only once, i.e., in the environment variable.

For example, I put the following in my ~/.tcshrc:

setenv IMAPFO "{mail.freeshell.org/user=UID/ssl}"
setenv IMAPFM "{mail.messagingengine.com/user=UID@fastmail.fm/ssl}INBOX"
setenv NEWSGO "{news.gmane.org/nntp}#news"
setenv NEWSUN "{my.usenet.server/nntp}#news"

And then I reference these in the inbox-path, incoming-folders, folder-collections, and news-collections variables in my pinerc. For example, in my incoming-folders list, I reference these environment variables like this:

incoming-folders=INHERIT,
   fo-inbox  ${IMAPFO}INBOX,
   nickname2 ${IMAPFO}mail/mailbox/name,
   fm-inbox  ${IMAPFM},
   nickname4 ${IMAPFM}.mailbox.name,
   nickname5 ${NEWSGO}.newsgroup.name,
   nickname6 ${NEWSUN}.newsgroup.name,
   etc.

Note that the hierarchy delimiter is forward slash (/) on the freeshell.org server and dot (.) on the other servers in this example. Also note that some servers, for example MS Exchange and IBM Lotus, use backslach (\) as the hierarchy delimiter.

I chose these environment variables so that they can be used in collection specifications and in incoming-folders (including news-over-IMAP and #move folders) specifications. For example, here is how I reference these environment variables in my folder-collections list:

folder-collections=nickname1 ${IMAPFM}.[],
  nickname2 ${IMAPFO}mail/[],
  nickname3 ${NEWSGO}.[],
  nickname4 ${NEWSUN}.[],
  etc.

These environment variables can be used by any tool that uses c-client-style folder syntax, for example, they can be used by mailutil, which is discussed below. They are also useful in shell aliases and scripts that launch Pine on a particular folder, for example, I have the following in my ~/.tcshrc:

alias p2   'pine -if "${IMAPFM}.2do"'
alias pcmp 'pine -if "${NEWSUN}.comp.mail.pine"'

If you create aliases like these, make sure you surround the folder specification with double quotes (") so that the shell does not try to interpret the squiggly braces that are in the expansion of the IMAPFM or NEWSUN environment variables.

For details about using environment variables in Pine, including why it might seem that I have double curly braces in the above specifications, see Using Environment Variables at the UW Pine Information Center.

Environment
Variable
Tips
   
  • Another advantage of using an environment variable to specify a server is that your Pine aliases and Pine configuration files can be used on another system without needing to be edited (because the appropriate servers will be specified by the local environment variables). This is especially useful for SMTP and Usenet servers, both of which are often system dependent.

  • If you use your Pine configuration file on multiple systems, use an environment variable to specify the directory where your local mailboxes are stored. For example, on a Unix-type system where I have control of my directory structure, I use this:
    setenv LOCALMSGS "${HOME}/Msgs/"
    On my viaVerio Signature Hosting account, I use this:
    setenv LOCALMSGS "${HOME}/users/username/mail/"
    On my MS Windows 98 system, I use this:
    set LOCALMSGS=%HOME%\Msgs\
    And in all cases, the following Pine folder-collections setting will work:
    folder-collections=primary collection,
      LocalMsgs ${LOCALMSGS}[]
    Note that I include the trailing hierarchy delimiter (slash or backslash) in the LOCALMSGS environment variable and do not specify the hierarchy delimiter in the Pine folder-collections setting. This way the setting works on both MS and Unix-type systems.

  • On MS Windows 98 and earlier, it is not possible to set an evironment variable that contains an equals sign (=). On this type of system, do not include the /user= qualifier. For example, instead of using this in AUTOEXEC.BAT :
    set IMAPFO={mail.freeshell.org/ssl/user=UID}
    use this:
    set IMAPFO={mail.freeshell.org/ssl}
    If you use a PASSFILE and if mail.freeshell.org occurs exactly once in your PASSFILE, Pine will use the UID that is associated with the mail.freeshell.org PASSFILE entry.

 

 

Using an External Program

If you access multiple incoming folders, possibly on multiple IMAP servers, you may want to use a separate mail-checking program to notify you about recent messages.

One possibility is the command-line tool mailutil, which is part of the Pine package and is discussed in Using mailutil below.

Another possibility is Mulberry. I often run Mulberry along with Pine, simply for its powerful and customizable monitoring of mailboxes and mailbox-specific alerts.

More possibilities are on the pages that are listed in the next section.

 

See Also

For more about checking for recent messages, see:

 

Setting Up PC-Pine for Multiple Users on One PC

If more than one person uses Pine on a PC, the primary user of the machine can run pine.exe and use the pinerc and other user files it finds when it walks through steps 2, 3, and 4 listed in How Pine Finds User Files above. A second (non-primary) user can put her user files in her own Pine directory and then start Pine using the -p command-line argument. For example, when I share a machine with someone I keep my Pine user files in C:\Nancy\Pine and I start Pine by running

   C:\Progra~1\Pine\pine.exe -p C:\Nancy\Pine\pinerc

or by running a shortcut to this command. In order for password(s) used in this invocation of Pine to be stored in this directory, you need to create a blank text document named pine.pwd in this directory (for details about creating this file see step 4 above). Most of your other user files will also be stored in this directory. An exception is the user dictionary, which is stored either in the directory that pine.exe is in or, if the USER_DICTIONARY environment variable (which is discussed above) is defined, it is stored there. The built-in and user dictionaries are shared by all PC-Pine users on the machine.

 

Tip     Pine settings that are common to all users on the system can be put in a system-wide configuration file. This can be specified using the MS-Windows PINECONF environment variable, which I discuss in step 2E above, or by using the -P command-line argument. For lots of information about this, see Compartmentalizing and Sharing Your Pine Configuration.

 

Note     If you are the only user of Pine on your PC, you probably do not need to maintain multiple pinerc files. Instead you can:
  • Access INBOXes on different systems by setting the enable-incoming-folders feature in MSC (Main > Setup > Config). To add INBOXes to your list of incoming folders, type ML (Main > folderList), then open the Incoming-Folders collection and type A (Add). Pine will prompt you for the INBOX specification. Another way to add INBOXes to your incoming-folders list is to directly edit your pinerc file. This is described in the POP section below.

  • Send messages using different roles. To set up roles, type MSRR (Main > Setup > Rules > Roles). For more information about roles, read Pine's built-in Help on roles and Changing Your From Header in Pine.

If you use more than one Internet Access Provider to connect to the Net, you can follow the instructions in the next section to change your SMTP and NNTP servers for your connections.

 

 

 

Switching Your SMTP or NNTP Servers

News  
  • Starting with Pine 4.50 you can specify a list of SMTP servers in a role.
  • Starting with Pine 4.56 you can specify a list of NNTP servers in a role.

Pine uses your smtp-server to send email messages and your nntp-server to send news messages. Most people set these to the servers provided by their Internet access provider. If you want to either

the sections below will give you ideas for how to do this.

 

 

Reading From Multiple NNTP Servers

In the old days, people set their Pine nntp-server variable to be their Internet Access Provider's NNTP server and used this to read and post to Usenet newsgroups, e.g. comp.mail.pine, and the providers newsgroups, e.g., best.general. If you want to read newsgroups on more than one NNTP server, you need to specify all of them in Pines' news-collections list variable. For example, here are some NNTP servers that contain newsgroups that I read:

news-collections={primary.isp.com/nntp}#news.[],
      {alternate.isp.com/nntp}#news.[],
      {news.gmane.org/nntp}#news.[],
      {freenews.genecast.com/nntp}#news.[],
      {forums.macromedia.com/nntp}#news.[],
      {msnews.microsoft.com/nntp}#news.[],
      {news.mozilla.org/nntp}#news.[],
      {oldnews.mozilla.org/nntp}#news.[],
      {secnews.netscape.com/nntp/ssl/novalidate-cert}#news.[]

If you want to post to a group, you need to also follow the instructions in one of the following sections.

Tip 1: After you specify a news server in your news-collections list, you need to subscribe to the newsgroups that you want to read on that server. How to do this is discussed in Miscellaneous NNTP Tips below.

Tip 2: Lots more NNTP servers are listed on Nyx Net's page about Specialized Public NNTP News Servers.

 

 

Posting to Multiple NNTP Servers in Pine 4.56 and Later

In Pine 4.56+, you can have Pine automatically use the currently open NNTP server as the outgoing (posting) NNTP server. To enable this, set this feature.

[X]  predict-nntp-server 

If this feature is set, you do not need to list your outgoing NNTP servers in the nntp-server variable, which is discussed in the next two sections. Instead, Pine will post an NNTP message to the currently open NNTP server (if an NNTP server is currently open).

Another option, which was also introduced in Pine 4.56 and is what I recommend, is to specify your nntp-server variable in the "public" (non personal) Pine Role that you use for public posting.

 

 

Posting to Multiple NNTP Servers in Pine 4.30 and Later

As I discuss in Reading From Multiple NNTP Servers above, you use the news-collections variable to list the NNTP servers from which you read newsgroups. To post to these NNTP servers, you need to either set predict-nntp-server, which is discussed in the previous section, or list them in the nntp-server variable. For example, to be able to post to the NNTP servers listed above, use this setting:

nntp-server=primary.isp.com,
    alternate.isp.com,
    news.gmane.org,
    forums.macromedia.com,
    msnews.microsoft.com,
    news.mozilla.org,
    oldnews.mozilla.org,
    secnews.netscape.com/ssl/novalidate-cert

When you compose and initiate the sending of a news message with ^X, Pine steps through the your nntp-server list until it finds one that it can use to post to the newsgroup(s) you have specified in the Newsgroups header of the message you are sending.

Notes    
  • To successfully post a message, all newsgroups that are listed in a message's Newsgroups header must reside on the same news server. So, for example, it is not possible to crosspost to macromedia.dreamweaver and comp.infosystems.www.authoring.html because macromedia.dreamweaver is only carried on the forums.macromedia.com news server and that server does not carry the standard Usenet newsgroups (such as the comp.* hierarchy).

  • I do not list freenews.genecast.com in the above nntp-server list because the newsgroups on that server are read only, i.e., regular users are not allowed to post.

 

 

Posting to Multiple NNTP Servers in Pine 4.21 and Earlier

If you are using Pine 4.21 or earlier, the nntp-server variable, which is used for posting, can be set to at most one NNTP server. To post to an NNTP server that is different from the one that is specified in your pinerc, you can create a Pine shortcut that sets the nntp-server on the command line. For example, when I want to participate in — that is, both post to and read — newsgroups on the Gmane NNTP server, I start Pine with this command:

 pine -nntp-server=news.gmane.org

 

 

Managing Your News Reading with newsrc(s) and “Views”

You can restrict the newsgroup names that are displayed on a server's FOLDER LIST screen by specifying a “View.” For example, in the last seven news-collections below I have specified a View (the part inside the square brackets) that will list only the newsgroups that I read on the corresponding server:

news-collections={primary.isp.com/nntp}#news.[],
         {alternate.isp.com/nntp}#news.[],
         {news.gmane.org/nntp}#news.[gmane.*],
         {freenews.genecast.com/nntp}#news.[weblog.*],
         {forums.macromedia.com/nntp}#news.[macromedia.*],
         {msnews.microsoft.com/nntp}#news.[microsoft.*],
         {news.mozilla.org/nntp}#news.[mozilla.*]
         {oldnews.mozilla.org/nntp}#news.[netscape.public.*]
         {secnews.netscape.com/nntp/ssl/novalidate-cert}#news.[netscape.mozilla.*]

Since I use the first two news collections to access all standard Usenet newsgroup hierarchies — comp.*, news.*, sci.*, rec.*, etc. — I do not restrict these views and thus I see all newsgroups that are listed in my newsrc when I'm viewing the FOLDER LIST screen of either of those news collections (this includes the macromedia.*, microsoft.*, etc. newsgroups). To make these FOLDER LIST screens more manageable, I order my newsrc so that newsgroups that are not standard Usenet newsgroups are at the bottom of my newsrc and set news-read-in-newsrc-order in my Pine Config.

For more about Pine Views, see the Collection Tips above.

Tip: If you use multiple newsrcs, which is discussed in the next two sections and is what I recommend, you probably won't need to use any of the above example Views. This is because, for example, all the (non control) newsgroups on news.mozilla.org are named mozilla.something and the Pine FOLDER LIST will list only mozilla.* newsgroups in any case.

 

Using Multiple newsrcs in Pine 4.56 and Later

If you are using Pine 4.56 or later and if you would like the newsrc name to reflect the name of the news (NNTP) server, set the following in your feature-list.

[X]  enable-multiple-newsrcs

Since it is generally useful to have the name of the news server as part of the newsrc file name, I recommend that you set this whether you access one or multiple news servers. This is one of the 27 feature settings that I recommend in Step 6B above.

If you set this feature, I recommend that you also do the following.

  1. Read the description of the mult-newsrc-hostnames-as-typed feature and decide whether you would like to set or unset this. I am currently experimenting with having this feature set and so far it is working well for all the news servers that I access.
    [X]  mult-newsrc-hostnames-as-typed


  2. To store your newsrc files in their own directory, rather than in $HOME, which is the default, set newsrc-path to something like this:
    newsrc-path=${HOME}/Newsrc/newsrc
                ^^^^^^^^^^^^^^ ^^^^^^
                DirectoryName  PrefixOfNewsrcName
    With this setting, the newsrc file name for a news server named news.server.name will be:
    ${HOME}/Newsrc/newsrc-news.server.name
    and the previous version of this newsrc will be:
    ${HOME}/Newsrc/newsrc-news.server.name.old
    You can of course use any newsrc prefix name (newsrc in this example) and any directory. For example, you could set the prefix name to rc and the directory to News.


    newsrc-path tips: 
    1. Set your newsrc-path to an absolute path rather than a relative path. If you use a relative path, you can have unexpected results if the feature use-current-dir is set or if newsrc-path is set in an IMAP-accessible pinerc.

    2. If your home directory is part of your newsrc-path, use the string ${HOME} rather than the string $HOME or ~ (tilde). ${HOME} is more likely to work on all systems that use this pinerc (for example, if newsrc-path is set in an IMAP-accessible pinerc).

    3. Make sure that the newsrc-path base directory (~/Newsrc in this example) exists and that it is a directory.

    4. If you already have a newsrc file, for example ~/.newsrc (which is the default newsrc name for Unix-like Pines) copy it to newsrc-path using, e.g., a command like this:
      cp -i ~/.newsrc ~/Newsrc/newsrc
                      ^^^^^^^^^^^^^^^
                      your Pine newsrc-path value
      Pine will use the file that is specified by your newsrc-path variable — if it exists — as the starter file for a new news-server-specific newsrc file. This is useful when you first set the enable-multiple-newsrcs feature.

 

Using Multiple newsrcs in Pine 4.55 and Earlier

To use more than one newsrc in Pine 4.55 or earlier, you need to specify the nntp-server and newsrc-path on the command line like this

 pine -nntp-server=news.gmane.org -newsrc-path=newsrc-gmane

You can set up an alias (shortcut) for the above command and start Pine by using it whenever you want to read those newsgroups.

An alternative is to put the nntp-server and newsrc-path in a configuration exception file and start Pine using something like this:

 pine -x pinerc-gmane

I discuss the -x (and -P and -p) command-line arguments in the section Changing Both Your SMTP and NNTP Servers below, and on a separate page called Compartmentalizing and Sharing Your Pine Configuration.

Other options for pre-Pine 4.56 users are:

 

 

Using an IMAP-to-NNTP Proxy to Store Your newsrc on an IMAP server

Starting with version 4.00, Pine can be set up to use an IMAP-to-NNTP proxy to store your newsrc on a UW-IMAP server. I discuss this — including how to set it up — in the comp.mail.pine message Re: Multiple newsservers, multiple newsrcs?

Doing this has the following advantages.

  1. You can access a news server that is accessible from the IMAP proxy server but is not accessible from the system on which you are running Pine.

  2. Since your newsrc is stored on an IMAP server, it can be used from Pine running on any system and you won't see news messages that you have already “deleted.”

  3. [relevant only to users of Pine 4.55 and earlier] If you access multiple news servers, you have the option of storing the newsrc for each news server that you access on a different UW-IMAP account (and one could be stored locally of course). This way . . .
    • you will see only the newsgroups from one news server when you view the FOLDER LIST for a particular news collection, and
    • you won't need to worry about corruption in your newsrc if you read the same newsgroup with the same instance of Pine, but on multiple news servers.
    Beginning with Pine 4.56, you have the option to set the feature enable-multiple-newsrcs, which is an alternate (and much easier) way to solve the problem of using multiple news servers. This feature is discussed above.

A disadvantage of using an IMAP-to-NNTP proxy is that it can be slower and more vulnerable to disconnections because a connection is made first from your system to the IMAP server and then from the IMAP server to the NNTP server.

 

News-
Over-
IMAP
Tips
   
  • Accessing news via an IMAP-to-NNTP proxy is sometimes called accessing news over IMAP.

  • This works only if the proxy server is running a University of Washington (UW) IMAP server.

  • If you need an account on a UW IMAP server so you can remotely store your newsrc file(s), see my IMAP Service Providers page, which lists many free and reasonably-priced providers that run UW IMAP.

  • To make it easier to create and edit news-over-IMAP specifications in your pinerc, I recommend that you use an environment variable for the specification of both the IMAP server and the news server. Then, for example, you can use something like this in your incoming-folders list:
    incoming-folders=INHERIT,
      nickname1 ${IMAP1}${NEWS1}.news.group.name,
      nickname2 ${IMAP1}${NEWS2}.news.group.name2
    
    For details about ${IMAPn} and ${NEWSn}, see Using Environment Variables to Specify Folders and Collections above.

 

 

Miscellaneous NNTP Tips


 

 

Connecting to a Different Internet Access Provider

Many Internet Access Providers (IAPs) let only their customers (i.e., users who are either dialed into their system or connected via a LAN, WAN, or DSL) use their SMTP and NNTP servers to send messages. If you have more than one IAP that you connect to from your PC, you may need to change your SMTP and NNTP settings each time you change which IAP you are connected to.

 

 

Changing Only Your SMTP Server

News:  Starting with Pine 4.50 you can specify a list of SMTP servers in a role.

 

You can list all the SMTP servers that you use in your smtp-server variable setting like this:

  smtp-server=smtp.isp1.com,
         smtp.isp2.com,
         smtp.isp3.com

Pine will try each SMTP server until it finds one that works. A disadvantage of this method is that if the first one doesn't work, you will experience a delay while Pine checks the others in the list. If you don't want to wait for the delay you can either start Pine with a command-line argument like this:

 pine -smtp-server=smtp.isp3.com

Or you can compartmentalize your pinerc settings and start Pine using the -P, -p, and -x command-line arguments. I describe this in the next section, Changing Both Your SMTP and NNTP Servers, and in a separate page called Compartmentalizing and Sharing Your Pine Configuration.

 

Note     The smtp-server variable is a list variable, which means it can be set to a list of values. Before Pine 4.30, the nntp-server variable, which I discuss above, was not a list variable and could be set to at most one value. Starting with Pine 4.30, the nntp-server is also a list variable.

 

Changing Both your SMTP and NNTP Servers

News  
  • Starting with Pine 4.50 you can specify a list of SMTP servers in a role.
  • Starting with Pine 4.56 you can specify a list of NNTP servers in a role.

If you want to temporarily change your smtp-server, your nntp-server, and your newsrc-path, you could do it all on the command line like this:

pine -smtp-server=smtp.isp2.com  -nntp-server=nntp.isp2.com  -newsrc-path=newsrc-isp2

When I want to set a lot of variables on the command line (as in this example), I prefer to use the Pine command-line arguments -P, -p, and -x to specify two or three pinerc files. The -P argument specifies a pinerc file that contains generic settings and the -p and -x arguments specify pinerc files that contain “user” (easily changeable) settings, i.e., settings that can be changed by MSC (Main > Setup > Config) or MSXC (Main > Setup > eXceptions > Config). One reason I prefer using -P, -p, and -x to putting all the settings on the command line in a Windows shortcut is that it is easier to edit a file than a Windows shortcuts with its tiny text box.

One way to set this up is to put your ISP-specific settings in files named pinerc-ispn.

For example, pinerc-isp1 would contain this:
  smtp-server=smtp.isp1.com
  nntp-server=nntp.isp1.com
  newsrc-path=C:\MyHome\Pine\newsrc-isp1

And pinerc-isp2 would contain this:

  smtp-server=smtp.isp2.com
  nntp-server=nntp.isp2.com
  newsrc-path=C:\MyHome\Pine\newsrc-isp2

And your pinerc file would have these variables unset:

  smtp-server=
  nntp-server=
  newsrc-path=

Then when you are connected to ispn, start Pine with

C:\Progra~1\Pine\pine.exe -x C:\MyHome\Pine\pinerc-ispn

Or if you are using Pine 4.21 or earlier, use this

C:\Progra~1\Pine\pine.exe -P C:\MyHome\Pine\pinerc -p C:\MyHome\Pine\pinerc-ispn

To avoid typing these long commands, set up shortcuts on your desktop or start menu.

Notes    

 

 

Moving Messages and Mailboxes

When you view a message with Pine, you have the choice of leaving it in the folder it's already in or saving it to a folder on an IMAP server or a folder on your local file system. In order to have all three of these choices, you need to set up both local and remote folder collections, which I describe in Step 7 above. To move some or all messages in a mailbox, you can do one of the following.

 

Using the Rename Command to Move a Mailbox

To move a mailbox to another location on the system it is currently on, you can use the Rename command. For example, to move a mailbox named _done to a subdirectory named Archive, 1) Type L to go to the FOLDER LIST screen; 2) Select the _done mailbox; 3) Type R (for Rename) and specify something like this:

Rename folder to : Archive/_done-2007
                          ^
                          Use the appropriate hierarchy delimiter; usually slash (/), dot (.) or backslash (\)

Important: The path (Archive/ in this example) must be either empty (null) or point to a (possibly non-existent) subdirectory of the current directory. If a subdirectory does not exist, Pine will create it. If the target mailbox (_done-2007 in this example) already exists, Pine will not do the move.

Note:  If you use the Rename command in the Incoming-Folders virtual collection, it does not move a folder, but instead renames the incoming-folder's nickname.

     

Using Aggregate Operations to Select and Move Messages in a Mailbox

To use Pine's aggregate operations to select and move all messages in a mailbox, first set enable-aggregate-command-set in your pinerc, then open the mailbox, view its index, and type:

; A A S

which means ;select All Apply Save; then type:

 
^R ^N mailbox-name
 ^  ^
 |  |
 |  +---- 0 or more [steps through Next Collections]
 +---- 0 or 1 [toggles between SAVE (and delete) and SAVE (no delete)]

where you type ^R if you want to change whether a copy or move is performed and you type ^N (Next Collection) zero or more times until you get to the appropriate collection. If you need to set up a collection, see Setting Up IMAP, NNTP, and Local Collections above.

If you want to move the messages to your default INBOX (the mailbox specified by inbox-path), you do not need to type ^N to specify the collection where your primary INBOX resides. Instead, you can type the following from anywhere (and the case of the string INBOX does not matter):

; A A S inbox

Note that the target of a save command must be either IMAP accessible or on your local file system; it is not possible to move messages to an NNTP or POP folder. Also note that Runbox.com and AOL do not let users move messages to the INBOX even though INBOX is an IMAP-accessible mailbox.

For more examples of and discussion about Pine's aggregate operations, see:

  

 

Using Pine's Built-In Fetch (#move) Ability

Starting with version 4.55, which was released 2003 April 16, Pine has the built-in ability to automatically fetch or snarf all messages in a folder — called a “maildrop folder” in this context — and move them to another folder. Before Pine 4.55, a Pine user needed to either use a Pine filter or an external program, such as getmail or fetchmail, to do this.

A Pine #move folder is specified in the pinerc file by using the move namespace prefix (#move) followed by a delimiter, followed by the maildrop folder's specification, followed by the same delimiter, followed by the destination folder's specification. For example, if your default INBOX (inbox-path) is a #move folder, your pinerc file will contain a line like this:

inbox-path="#move!MaildropFolder!DestinationFolder"
           ^     ^              ^                 ^  
           :     :              :                 :
           :     :...delimiter..:                 :
           :                                      : 
           :..quotes don't hurt & sometimes help..:
  
  

Here is a diagram that illustrates how a Pine “#move folder” works:

+---------------------+
|   Maildrop Folder   |
|                     | 
+---------------------+
         ||
         || periodic fetch
         \/
+---------------------+
| Destination Folder  |
|                     | 
+---------------------+
         ||
         || local or IMAP access
         ||
+---------------------+
| PINE 4.55+          |
+---------------------+
|                     |
|  your view of the   |
|   “#move folder”    |
|                     |
+---------------------+
 

The maildrop folder can be any type of folder that Pine supports (POP, IMAP, NNTP, or local) and the destination folder can be either a local or an IMAP folder. A #move folder is especially useful for fetching messages from a POP or NNTP folder because otherwise . . .

  1. Pine is not able to automatically check a POP or NNTP folder for recent messages;
  2. Pine does not remember flags or status values in POP and NNTP folders; and
  3. Pine leaves the messages on the server and does not copy the message's to the system on which Pine is running. Pine's online accesss mode is not what most POP users (or POP service providers!) expect or want.

When you set up a POP or NNTP folder as a #move folder, you get automatic recent-message checking, you get these messages into a folder that supports flags & other metadata, and for a POP folder, you get the messages off the POP server.

 

To set up a #move folder, either use the Pine Setup screens, which is described on Eduardo Chappa's site, or directly edit your pinerc file (using, for example, pico -w). In any case, a #move folder specification will look like this in your pinerc:

"#move!MaildropFolder!DestinationFolder"

I use bang (!) as the #move delimiter, but you can you use any character that does not occur in the rest of the specification as the delimiter.

For example, if you want your default Pine INBOX to be a #move folder that fetches a newsgroup's messages and moves them to a folder in your local folder collection, it will look like this in your pinerc:

inbox-path="#move!{usenet.server/nntp}comp.mail.pine!Msgs/comp-mail-pine"
                                                     ^^^^^^^^^^^^^^^^^^^
                                                     relative to local $HOME
                                                     make sure it exists!

To specify more than one #move folder, you need to use Pine's incoming-folders variable. For example, here is an incoming-folders variable setting that contains a couple #move folders:

incoming-folders=INHERIT,
  :          :
  fetch-cmp  "#move!{usenet.server/nntp}comp.mail.pine!Msgs/comp-mail-pine",
  nickname   "#move!MaildropFolder!DestinationFolder",	
  :          :

This fetch-cmp #move folder moves all “undeleted” messages in the comp.mail.pine Usenet newsgroup to a destination mailbox named comp-mail-pine in the $HOME/Msgs directory of the local system. Alternatively, you could move these messages to a destination mailbox on an IMAP server, an example of which is in the next section, POPping Gmail is Different.

 

To learn more about #move folders, see:

 

#move
Tips

   
  • In order for a #move folder to work, the destination folder must already exist. If it does not exist, Pine will not create it and the #move will fail with the error message Folder does not exist.

  • In order to use a #move folder, you must set the feature enable-incoming-folders in your Pine configuration. To learn about using incoming folders, which a #move folder is an example of, see Using the Incoming-Folders Collection above.

  • Pine checks a #move folder for recent messages every maildrop-check-minimum seconds. Because it is “expensive” to check a #move folder, I suggest that you set this fairly high — and definitely higher than or equal to your regular mail-check-interval. For example, I use at least 3600 seconds (60 minutes) because my maildrop folders receive only low priority messages. Note that there is no need to keep open (aka “keep alive”) an NNTP or POP maildrop because in order to check these for recent messages, Pine needs to close and re-open the folder.

  • Pine will automatically check a #move folder for recent messages only if it is either the currently open folder or the folder specified by inbox-path. This means that each instance of Pine can automatically be fetching at most two maildrops.

  • To save bandwidth and CPU/memory on your local system, run an instance of Pine in a remote shell whose sole purpose is to monitor and fetch two maildrop folders. If this instance of Pine is running inside screen, you can detach screen, log out from the ssh session, and that remote Pine will happily continue to deflect messages to the Destination Folders. If these Destination Folders are IMAP-accessible, you can access them with any IMAP client!

  • To move messages from multiple maildrop folders to one single destination folder, use the same DestinationFolder in each of the #move folder specifications. This is useful if you like to keep all your messages in one jumbo mailbox and then use saved searches (invoked via ;R) to view and manage virtual submailboxes of that jumbo mailbox.

  • If you have a problem using a destination folder that is local and if that local folder is also IMAP accessible, you might be able to solve the problem by using the destination folder's IMAP specification rather than its local specification.

  • I sometimes add a LUSER, Troll, or Anonymous Coward to my Pine "killfile" filter, but filters did not work with #move folders in Pine 4.58 and earlier. In Pine 4.60+, filters do work with #move folders. Details about Pine filters are below.

  • If you use a #move folder in Pine 4.58 and earlier, all status flags (Read, Flagged, Answered, etc.) are lost. In Pine 4.60+, you can use the feature maildrops-preserve-state to preserve the state of fetched messages. This feature is useful only when you are fetching from an IMAP or local mailbox. Because of potential problems, I recommend that you do not set this unless you need it. For an example of this feature causing a problem, see the 2005-March-08 comp.mail.pine thread Maildrops don't work with gmail, especially this message from Mark Crispin.

  • If a maildrop folder is an NNTP folder (newsgroup) that contains thousands of messages, it can take a long time for Pine to copy all the messages to the destination folder. You can limit the number of messages that Pine will copy from an NNTP folder by setting the nntp-range variable. This and other NNTP tips are discussed in NNTP Speed Tips above.

  • If you fetch from a lot of NNTP folders (newsgroups), you may want to use a separate program, such as mailutil (discussed below), leafnode, or slrnpull, to fetch newsgroup messages.

  • [little green bug] In Pine 4.62-, if a maildrop folder is an NNTP folder and if the feature enable-multiple-newsrcs is set, the NextNew (TAB) command will always open that #move folder. In Pine 4.63+, the NextNew command will open such a #move folder only if it contains a “new” message.

  • Another reason that I like to use a #move folder to fetch NNTP groups into IMAP mailboxes is so I can use Mulberry, Horde/IMP, SquirrelMail, Pine, or any IMAP client to search and manage my archived newsgroups. I discuss this and other types of “message deflexion” at Deflexion.com on the page Internet Message Deflexion: Intertwingling IMAP, SMTP, NNTP, IM, RSS, & More.

  • To make it easier to create and edit #move folder specifications in your pinerc, you can use environment variables for the specification of both the maildrop folder's server and the destination folder's server. Then, for example, you can use something like this in your incoming-folders list:
    incoming-folders=INHERIT,
      nickname1 "#move!${NEWS1}.news.group.name!${IMAP1}.mailbox.name"
    For details about ${NEWS1} and ${IMAP1}, see Using Environment Variables to Specify Folders and Collections above.

  • If the Maildrop is on an IMAP server that does not support the IMAP SEARCH command, the move will fail with this error message:
    Command 'SEARCH' not supported
    The AOL IMAP server is an example of an IMAP server that does not support the SEARCH command.

  • If your outgoing SMTP server requires authentication using (the flaky and obsolete) pop-before-smtp authentication, set up your inbox-path so that it is a move folder with your POP INBOX as the maildrop. This will ensure that Pine regularly "pops" your inbox and thus authenticates you for SMTP sending.

   

 

POPping Gmail is Different

On 10 November 2004 Google started letting their users use POP (Post Office Protocol) to access their Gmail messages. After a lot of experiments, I have decided to use a #move folder, which is discussed in the previous section, to fetch a copy of my Gmail messages. Rather than fetch them to my local system, I fetch them to my two-gigabyte IMAP store at FastMail.FM by using a specification like this in my incoming-folders list:

  fetch-gmail "#move!{pop.gmail.com/pop3/ssl/user=UID@gmail.com}INBOX!{mail.messagingengine.com/ssl/user=UID@fastmail.fm}INBOX.fetched-gmail",

If you would rather fetch your Gmail messages to a local mailbox rather than a remote IMAP mailbox, use a specification like this:

fetch-gmail "#move!{pop.gmail.com/pop3/ssl/user=UID@gmail.com}INBOX!Msgs/fetched-gmail",
                                                                    ^^^^^^^^^^^^^^^^^^^
                                                                    relative to local $HOME
                                                                    make sure it exists!

In either case, make sure the destination folder, fetched-gmail, exists! For more #move tips and examples of #move folder specifications, see the previous section, Using Pine's Built-In Fetch (#move) Ability.

The following are five ways in which Gmail is different from other POP service providers.

  1. By default POP access is not enabled. To access your Gmail messages with POP, you need to edit your Gmail Settings and enable POP. Make sure that you click the "Save Changes" button.
  2. In your Gmail POP Status setting, you can specify which of your messages are accessible by POP — you can choose either all mail or mail that arrives from now on. Note that you can not use POP to access Gmail messages that are labeled Trash or Spam.
  3. When you access your Gmail messages with POP, they are not deleted from your Gmail mailstore. Instead you can set up Gmail to either leave them in your Gmail Inbox, move them to your Gmail archive (All Mail), or label them Trash. Note that if a message at Gmail is labeled Trash and if it is more than 30 days old, it is subject to automatic deletion.
  4. Gmail tracks which messages have been downloaded with POP and does not (by default) let you download these already-POPped messages again. You can reset this by editing your Gmail POP Status setting (described in item #2 above) and choosing:
    Enable POP for all mail (even mail that's already been downloaded)
  5. Part of the Google philosophy and Code of Conduct is “Don't be evil.” (But note that as of 2005 August 8, Google is Now 10% More Evil :-))

 

Gmail
Tips
   
  • [HOT] [New!] As of 2007 October 24, Gmail supports IMAP. For details, see Example: Setting Up Your Gmail IMAP Collection above.


  • If you want to use the Gmail SMTP server for your outgoing messages, I recommend that you create a Pine Role that includes these ACTIONS:
    Set From        = Your Full Name <your.username@gmail.com>
    Use SMTP Server = smtp.gmail.com/tls/user=your.username@gmail.com
    
    Note:
    • If the above SMTP Server specification does not work on your system, one of the following might work:
      smtp.gmail.com:587/tls/user=your.username@gmail.com
      smtp.gmail.com/ssl/user=your.username@gmail.com
      smtp.gmail.com:995/ssl/user=your.username@gmail.com
    • Since Gmail uses Sender Policy Framework (SPF) and DomainKeys Identified Mail (DKIM), it is best if you always use the Gmail outgoing SMTP server when your SMTP MAIL FROM (Return-Path) address is your Gmail address. This will help to ensure that your message with gmail.com or googlemail.com in the From: header is not considered a forgery by spam-detection tools.

    • To use the Gmail outgoing SMTP server, you must use your Gmail address or a verified alternate address [*] in the From: header. If you do not specify one of these in your Gmail Pine role, it will automatically be changed by the outgoing Gmail SMTP server.

      [*] As of ~20 August 2005, Gmail lets users use a non Gmail (gmail.com or googlemail.com) address in the From: header. Be aware that your Gmail address will appear in the Return-Path: and Sender: headers so this is not a way to keep your Gmail address secret. For details, see Using a custom 'From:' address to send in the Gmail Help.


  • If you want a copy of your outgoing messages to be stored in your Gmail account, you can either use Gmail as your outgoing SMTP server (discussed in the previous tip) or set your Bcc to your Gmail address (discussed in Server-Side Sent Messages in my Deflexion.com blog). Each of these type of messages will be saved in your Gmail account and, if the From: address is one of your Gmail-validated addresses, it will automatically be assigned the Sent Mail (aka sent-mail) label. Details about this useful Gmail feature are in Sending email from a Gmail alias using another program at A Consuming Experience (you need to scroll down to get to the relevant section). (Thanks to Alex Steer for this Gmail tip.)


  • To “export” a copy of your message archives to your Gmail account, you can use Pine's aggregate operations to “bounce forward” (redirect) your Pine-accessible messages to your Gmail address. For example, while using Pine to view the MESSAGE INDEX of a folder, type:
    ; A A B your.username@gmail.com
    which means “Select All Apply BounceTo your.username@gmail.com”; make sure that the features enable-aggregate-command-set and enable-bounce-cmd, which are two of the features that I recommend, are set.

    Warning: If you bounce forward thousands of messages at one time, you may have problems with 1] Gmail thinking you are a spammer and blocking all mail that arrives from your outgoing SMTP server; 2] your outgoing SMTP service provider thinking you are a spammer and banning you from using their system; or 3] being charged extra by your outgoing SMTP provider for the bandwidth that you used to bounce forward the messages. It is probably best to not use your Pine Gmail Role, especially the Gmail outgoing SMTP server, to do this (or any) type of bounce forwarding. For more tips about using Pine to bounce forward messages to Gmail, see MIT's How to RESEND (BOUNCE) all your MAIL with PINE and Oliver Aaltonen's Tip: Batch-forward Email, including all the useful responses.

    Note: Gmail does not currently support IMAP, but when (if) it does, you should be able to transfer messages to Gmail using IMAP, which is much more robust than using SMTP (via bounce forwarding) to transfer messages. Gmail now supports IMAP!


  • As announced in this 2007-July-12 post in the Gmail blog, you can now set up the Gmail Mail Fetcher to fetch messages from up to five POP-accessible accounts to your Gmail account.


  • If you have problems using a #move folder to fetch Gmail messages to a local or IMAP-accessible mailbox, make sure that the following feature is not set:
    [ ]  maildrops-preserve-state
    This is discussed in the 2005-March-08 comp.mail.pine thread Maildrops don't work with gmail; especially relevant is this message by Mark Crispin.


  • To access your Gmail messages that arrived within the last 30 days, use syntax like this:
    {pop.gmail.com/pop3/ssl/user=recent:UID@gmail.com}INBOX
                                 ^^^^^^^
                                 Note!
    Without the string recent:, Pine will access the messages that arrived since the last time you used POP to access your Gmail messages. Details about this are in How should I use POP on mobile or multiple devices? at mail.google.com.

  • To learn more about using Pine with Gmail, including some warnings, see the comp.mail.pine thread How to access GMail with PINE.

 

The Metaphysics of a #move Folder: Noun or Verb?

[yin yang symbol] What exactly is a #move folder anyway? Is it the maildrop folder or is it the destination folder? Or is it not a folder at all, but rather the action of periodically fetching messages? Or is it neither a folder nor an action, but instead simply a conduit? This is one of the great mysteries, like the wave-particle duality of light and the yin-yang nature of the universe.

 

 

Using a Pine Filter to Automatically Move Messages

Starting with version 4.20, Pine has built-in filters that you can use to delete messages, move messages, or change the keywords or status flags of messages. To create a Pine filter, type MSRFA (Main > Setup > Rules > Filters > Add). To learn about Pine filters, see:

 

Filter
Tips
   
  • The condition lines in a Pine rule are ANDed, which means that a filter's actions are applied only if a message satisfies all the filter's conditions.

  • One way to match every message in a mailbox is to do the following on Pine's ADD A FILTERING RULE screen:
    1. Set Current Folder Type so that the desired mailbox is matched.
    2. Set Score interval to (-INF,INF). This means the score of the message must be either undefined or between negative infinity and positive infinity. All messages satisfy this condition.
    3. Leave all other FILTERED MESSAGE CONDITIONS with their default setting.

    Important:  “Because filtering is a potentially destructive action, filtering Patterns with nothing other than Current Folder Type defined are ignored.” That is why Step 2, specifying a score interval, is needed.


  • To match some, but not necessarily all, messages in a mailbox, set appropriate FILTERED MESSAGE CONDITIONS. For example, to match messages that arrived 7 or more days ago, use this condition:
    Age interval      = (7,INF)
  • In a pattern CONDITION, comma (,) means OR. For an example of this, see Index Color Rule and Virtual Mailbox Example above (which includes the condition Precedence pattern = bulk,list). To match a literal comma in a pattern condition, use \, (backslash comma).

  • Pine automatically runs filters on all messages when a mailbox is opened and on new (RECENT) mesages when they arrive in the current mailbox or any stay-open mailbox (aka stay-open-folder) that is currently open.

  • To manually run filters on the current mailbox, do one of the following.
    • Type X to eXpunge. This does not work with an NNTP or POP mailbox.
    • Type MSRN (Main > Setup > Rules > filterNow). This is available in Pine 4.63+.
    • Close and re-open the mailbox by using the technique described in Pine's Help about the folder-reopen-rule variable (which is also briefly discussed above).

  • If you want to automatically move all messages from one mailbox to another, you might want to use Pine's built-in fetch (#move) ability instead of a filter. To manually move all messages, you could use the Rename command or aggregate operations.

  • You may want to use server-side filters, for example based on Procmail or Sieve, in conjunction with or instead of, Pine filters. For example, I use Procmail running on my IMAP server to sort my incoming mailing-list messages into mailboxes named --subcription-name. I discuss how to set this up in the Procmail Quick Start.

 

 

Using Pine's pruned-folders Variable

Pine can be set up to automatically rename some mailboxes in your primary folder collection at the beginning of each month. The following Pine variables are used to set this up:

default-fcc  (which, in Pine's default configuration, is a "pruned folder")
pruned-folders  (available in Pine 3.92+)
pruning-rule  (available in Pine 4.30+)
read-message-folder

In order for pruning to work, a pruned-folder . . .

  1. must be in your primary folder collection (the collection listed first in your folder-collections list); and
  2. must be specified as a name that is relative to your primary folder collection.

For example, set your default-fcc to simply sent-mail rather than the fully qualified {my.default.server/user=MyUID}mail/sent-mail.

To force a pruning at some time other than the beginning of the month, set the hidden variable last-time-prune-questioned so that the year field is a number before the current year. For example, if the current year is 2005, set the year field to anything less than 105. One way to do this is to run something like the following on the command line:

pine -last-time-prune-questioned=100.1

Note that 100.1 means year 2000, month 1. The year field is specified as the number of years since 1900, which is the Pine epoch.

Starting with Pine 4.61, you have the option of setting this feature:

[X]  prune-uses-yyyy-mm

This will make Pine use a purely numeric date as the pruned mailbox name extension. This is especially useful when doing an ASCII sort of a list of mailbox names.

 

Pruning Tips     
  • With some pruning-rule settings, Pine offers to delete old folders. To avoid accidentally deleting an old folder, I recommend that you set your pruning-rule to one of the three options that "don't delete."
    pruning-rule                     =
                Set    Rule Values
                ---  ----------------------
                ( )  ask about rename, ask about deleting   (default)
            ->  ( )  ask about rename, don't delete
                ( )  always rename, ask about deleting
            ->  ( )  always rename, don't delete
                ( )  don't rename, ask about deleting
            ->  ( )  don't rename, don't delete
    The three "ask about deleting" options are holdovers from the days when disk space was expensive and many users had 10 MB (or less!) of disk space for storing email. If you have disk space problems, I recommend that you get an account with one of the IMAP service providers that offer gigabytes of inexpensive robust backed-up IMAP-accessible disk space.

  • In Pine 4.21 and earlier, which was before the pruning-rule variable existed, the only way to turn off Pine's offer to delete an old pruned folder was to set last-time-prune-questioned to a date in the future. For example, to set it to 999.9, which means September of the year 2899. This turns off pruning entirely (at least until the year 2899!).

  • If you want more pruning control and flexibility, use one of the following.
    • A Pine Filter with a CONDITION based on
      • Age interval (available in Pine 4.50+; an example is in the Filter Tips in the previous section)
      • Beginning of Month? (available in Pine 4.62+)
      • Beginning of Year? (available in Pine 4.62+)
      and an ACTION that moves messages to a folder with a name that possibly includes a date token. For example, in my latest mailbox-naming experiment, which I discuss in the Procmail Quick Start, I use a Pine filter to automatically move “done” messages to a mailbox named ==done-_CURYEAR_. Note that being able to use the _CURYEAR_ token requires Pine 4.62+.

    • Run the command  mailutil prune search-argument  — but note that this command deletes & expunges the pruned messages. Details about mailutil, which is part of the Pine package, are in Using mailutil below.

 

Using Pine's incoming-archive-folders Variable

You can have Pine automatically move the read (seen) messages in a folder to another folder by using the incoming-archive-folders variable (and read-message-folder for your primary INBOX) to associate an incoming folder with its corresponding archive folder. In a pinerc file, incoming-archive-folders pairs look like this:

incoming-archive-folders=folder1  archive-folder1,
                         folder2  archive-folder2,
                         :        :
                         folderN  archive-folderN

The first part of the pair, e.g. folderN, can be either an incoming-folder nickname (discussed above) or a fully qualified folder specification (discussed in Step 7F above and in Server Name Syntax at the UW PIC). The second part of the pair, e.g. archive-folderN, can be either a name relative to your Pine primary collection or a fully qualified folder specification.

If the feature auto-move-read-msgs is not set, Pine will ask if you want the move to be performed; otherwise the move will happen without any prompting. Note that this moves only read (seen) messages and not the entire mailbox (unless all messages have been marked read). If you want all messages — both read and unread — to be moved, use a move folder or use a filter.

Tip 1: If you want your archive folders to be in a subdirectory of your primary collection, use pairs that look like this:

folderN  Archive/folderN-2007
                ^
                hierarchy delimeter is usually slash (/), dot (.), or backslash (\)
Make sure that the subdirectory, e.g. Archive, exists in your Pine primary collection!

Tip 2: To avoid problems when (if) you change your Pine primary collection, you may want to use a fully qualified folder specification to specify the second part (the archive folder) of an incoming-archive-folders pair. This way your archive folders will not depend on the way folder-collections list is ordered (the first in this list is considered your primary collection).

 

See Also: To learn about Pine incoming folders, which are related to incoming-archive-folders, see Using the Incoming-Folders Collection (Pine Shortcuts) above.

 

Using SFTP, FTP over SSL, or FTP to Move a Mailbox

Sometimes it is faster to transfer a mailbox (or mailboxes) using SFTP, FTP over SSH2, FTPS (FTP over SSL/TLS), or FTP. What I usually do is move the mailboxes that I want to transfer into a directory named something like Tmp4Transfer and then “get” the folders using an FTP client on my local computer. The key is to do a binary, not an ascii, transfer. The following folder formats work in both PC-Pine and Unix Pine:

So if you use any of these folder formats and are using the latest Pine (4.64), you should not have any problem transferring these folders from Unix to Windows, or vice versa, and using Unix Pine or PC-Pine to process them (as long as you do a binary transfer).

Three advantages of first moving the folder(s) into a directory named Tmp4Transfer are 1) you'll know what folders you've downloaded;  2) if a folder is an incoming folder, you won't have to wonder which messages got downloaded and which messages arrived during or after your download;  and, most importantly, 3) if a folder is an incoming folder, you don't need to worry about it being corrupted if messages are delivered to it while it is being FTP'd.

 


Note
   
  • Usually when you transfer an ascii text file between two different platforms (Unix, DOS, Win/NT, Mac, etc.) you want to do an ascii transfer rather than a binary transfer so that the end-of-line characters are converted appropriately. Since PC-Pine has no problem with the Unix end-of-line, which is line feed (LF), and Unix Pine has no problem with the PC end-of-line, which is carriage return/line feed (CRLF), I prefer to always do a binary transfer of Pine files. This way each and every byte is preserved and there is less chance of corrupting the file.

    Another reason to do a binary transfer is that some Pine folder formats, such as c-client MBX, are not text files. The beginning of a c-client MBX folder contains binary data that is used for indexing the folder so it is essential that you do a binary transfer of c-client MBX folders.


  • If you use PC-Pine to process local traditional Unix mbox folders, PC-Pine will sometimes display this message:
    New mailbox modification time but apparently no change
    If you want to avoid seeing this message, convert the folders to c-client MBX format by selecting all messages and saving them to a new mailbox. PC-Pine will create the new folder in c-client MBX format.

 

Using (or Turning Off) the mbox Driver

To have Pine automatically fetch the messages that are in your default incoming mail spool and move them to a mailbox named mbox, you can use the mbox driver. The mbox driver is invoked if a file named mbox exists in your $HOME directory and if it is either empty or in traditional Unix spool (mbox) mailbox format. To find out more about the mbox driver, see:

To disable the mbox driver (which is what I do), do both of the following.

  1. Move or rename mbox so it no longer exists in your $HOME directory. Also see Tip D below. (*)

  2. Put the following in your pinerc:
    disable-these-drivers=mbox
    If you want to disable more than one driver, separate them with comma (,) followed by newline followed by whitespace. For example:
    disable-these-drivers=mbox,
       maildir,
       md
    This is a hidden variable so you need to directly edit your pinerc file using, for example, vim or pico -w. Alternatively, you could set Pine's expose-hidden-config feature, which is one of my favorite Pine settings, and then edit this (and other hidden variables and features) from the Pine SETUP CONFIGURATION screen.
mbox
Driver
Tips
   
  1. PC-Pine does not support the mbox driver so there is no need to disable it in PC-Pine.

  2. If mbox contains messages that you would like to keep and manage with Pine, rename mbox and move it to your Pine local folder collection. For example, if your local folder collection is $HOME/Msgs and if you are on a Unix-like system, type:
    cd
    mv -i mbox $HOME/Msgs/mbox-old
    Then start Pine, type L to go to your FOLDER LIST, and check that mbox-old is listed and can be accessed by Pine. If you want to move these mbox-old messages to another mailbox, for example to your INBOX, you can use pine's aggregate operations to select and move messages in a mailbox.


  3. To find out what encryption, authenticators, and mailbox drivers are supported by your version of Pine, and if any have been disabled, run:
    pine -supported
    If a maildir driver is supported and if you do not use maildir-formatted mailboxes, I recommend that you disable it. Some details about why you might want to disable any maildir driver are in this comp.mail.pine message.

  4. (*) To ensure that another program does not create the mbox file, you could create mbox but make sure that it is neither a 0-byte file nor in mbox format. For example, you could create an mbox directory.

 

[Updated!] Using mailutil

mailutil, which is described here, is a command-line tool that is distributed with Pine 4.50+ and with the UW (University of Wasington) IMAP software 2002+. It can...

For example, to copy all mailboxes from the default IMAP home of an old IMAP server to the default IMAP home of a new IMAP server, you might use a command like this.

mailutil transfer -merge append "{old.imap.server/user=UID/tls}" "{new.imap.server/user=UID/tls}"

To copy all mailboxes from the default IMAP home of an old IMAP server to a directory named Old on a new IMAP server, you might use a command like this.

mailutil transfer -merge append "{old.imap.server/user=UID/tls}" "{new.imap.server/user=UID/tls}Old/"
                                                                                                ^^^^
                                                   Important: Use the appropriate path and delimiter

If new.imap.server is a default Cyrus or Courier IMAP server, the path will probably begin with INBOX and the delimiter will probably be dot (.), e.g.:

mailutil transfer -merge append "{old.imap.server/user=UID/tls}" "{new.imap.server/user=UID/tls}INBOX.Old."

In any case, mailutil will create the Old directory if it does not exist.

To copy all mailboxes from the default IMAP home of an IMAP server to traditional Unix mbox formatted mailboxes in the $HOME directory of your local system (the system on which mailutil is running), you might use this:

mailutil transfer -merge append "{imap.server/user=UID/tls}" "#driver.unix/"

To copy all mailboxes from the default IMAP home of an IMAP server to traditional Unix mbox formatted mailboxes in $HOME/SubdirectoryOfHOME on your local system, you might use this:

mailutil transfer -merge append "{imap.server/user=UID/tls}" "#driver.unix/SubdirectoryOfHOME/"

To copy all mailboxes from the default IMAP home of an IMAP server to traditional Unix mbox formatted mailboxes in /absolute/path/to/directory on your local system, you might use this:

mailutil transfer -merge append "{imap.server/user=UID/tls}" "#driver.unix//absolute/path/to/directory/"
                                                                          ^^
                                                                          Note!

If you want the target mailbox to be in c-client mix format rather than Unix mbox format, replace #driver.unix/ with #driver.mix/ in the above three examples.

To create a new mailbox in mix format in your local $HOME/Msgs directory, use a command like this:

mailutil create #driver.mix/Msgs/example.mix
                                        ^^^^
                                        optional extension that signifies mailbox format

You do not need an extension in the mailbox name, but I like to use an extension for mailboxes that are in a non-default mailbox format. To create a new mailbox in the default mailbox format, use a command like this:

mailutil create Msgs/example

The default mailbox format depends on the operating system and what version of mailutil you are using.

In all of the above examples, mailutil will prompt you for the passwords on the IMAP servers.

 

To learn more about mailutil, see:

For a reminder of the mailutil arguments, run mailutil without any arguments, e.g. run one of these:

mailutil
/absolute/path/to/mailutil

Starting with mailutil version ~2006f, this command will also display the mailutil version number.

Note 1:  To use mailutil on MS Windows, you need to be using an updated MS Windows 98 or later, and you need to run mailutil as a Windows command, not as a DOS command. Details are in the 2004-Nov-10 comp.mail.pine message Re: How send password with mailutil? by Mark Crispin.

Note 2:  As stated in the mailutil manual page:

mailutil replaces the old chkmail, imapcopy, imapmove, imapxfer, mbxcopy, mbxcreat, and mbxcvt programs.”

chkmail and Co. were replaced by mailutil in 2002.

 

Tip 1: To avoid problems with special characters, such as octothorpe (#), left brace ({), & right brace (}), surround folder specifications with quotation marks and run mailutil commands from a Bourne shell. Examples of Bourne shell scripts are in the sections Using a PASSFILE with Unix and Mac Pine and Using a Shell Script to Launch Pine above. The second of these includes an example of using a continuation backslash to split a long line into multiple lines.

Tip 2: To prevent mailutil from trying to use rsh or ssh to connect to a server, which often causes unnecessary slowdowns, include the /norsh qualifier in the server specification. Note that if a server specification includes the /tls or /ssl qualifier, mailutil will not try to use rsh or ssh (so you do not need to specify /norsh in these cases).

Tip 3: To make it easier to specify a server and all its qualifiers as an argument of a mailutil command, you might want to specify the server in an environment variable. Specifying a server in an environment variables is also useful for setting up and maintaining Pine configuration files and is discussed in Using Environment Variables to Specify Folders and Collections above.

 

[New!] Question: When mailutil is used to snarf messages from an NNTP server, is a .newsrc file used and, if so, what is its location?

 

 

Using Other Sync and Snarf Tools

On the Infinite Ink All About Pine page in the section Syncing and Snarfing Mailboxes, I am collecting a list of tools that you can use to synchronize or snarf mailboxes. This list includes mailutil, which is discussed in the previous section, and a lot more.

Important:  If you care about flags, keywords, and any other IMAP metadata, make sure that you use a tool that preserves these. Most tools that use the IMAP protocol -- for example UW's mailutil (discussed in previous section), Cone's mailtool, and Gilles Lamiral's imapsync -- will preserve IMAP metadata.

 

 

Saving Your Trash

In the IMAP world, removing a message from a mailbox is a two-step process: 1) Mark the message for deletion and 2) Expunge. This means that one way to save your trash is to do step 1, but do not do step 2 (expunge) until you really want to throw out the trash. Starting with Pine 4.30, you can set the following feature:

[ Advanced User Preferences ]
           :
          [X]  expunge-only-manually


And then when you are ready to expunge all messages that are marked for deletion in a mailbox, type X (eXpunge).

To make your deleted messages less obtrusive, I suggest that you do one or both of the following


Another option for saving your trash is to set up a Pine filter (discussed above) to automatically move deleted messages to a "Trash" or "Expunged" mailbox. This is described in Can I have my deleted messages go to a trash folder instead of being deleted?, which is part of Gopi Sundaram's FAQ for comp.mail.pine. Note that this type of filter might not work in Alpine.

Yet another option is to use Eduardo Chappa's Rules patch, which is discussed at Eduardo's Define your own rules and make pine flexible! and Patches for Pine.

 

Warnings    
  • In Pine 4.53 and earlier, it is possible to lose messages if you use IMAP, Pine filters, and have set expunge-only-manually. Because of this, I recommend that you use expunge-only-manually only in Pine 4.55+.

  • If you use another client to access a mailbox, it may automatically expunge messages that are marked for deletion. Note that “expunge” is called “compact” in Mozilla-based clients and “purge” in some other clients.

  • Some IMAP servers are set up to automatically expunge deleted or trashed messages. For example, both FastMail.FM and Tuffmail.com have user-customizable auto-purge features.

  • [New!] The Gmail IMAP server ignores the Pine expunge (X) command. Instead it immediately expunges a deleted message unless it is in the special [Gmail]/All Mail folder. In the special [Gmail]/All Mail folder, both delete (D) and expunge (X) commands are ignored. To learn more about the Gmail IMAP server, see Setting Up Your Gmail Collection above.

  • Some IMAP clients, for example Pine and Thunderbird 1.5+, and some IMAP servers can be set up to automatically delete & expunge old messages independent of whether they have already been marked for deletion. This type of deletion is called aging, expiring, or pruning.

  • For more about all this, see The IMAP Way of Deleting a Message in my blog.

 

Importing Mailboxes from Other Mail and News Clients

If you have a mailbox that was created by another client, use one of the following procedures to try to import it into Pine.

1. Move it to Your Pine Message Directory
Mail and news clients that are based on Internet standards often use one of the folder formats that Pine supports. Make a copy of the folder in your Pine message directory (e.g., %HOME%\Msgs) and try to open it from the Pine Folder List screen. Note that you do not need to rename the folder since Pine does not care about the file name or extension.


2. Use the Other Client to Export it to a Different Folder Format
Start your other client and see if it has a command to export a folder (aka “mailbox”) to another folder format. If it can export to one of the folder formats that Pine supports, such as traditional Unix mbox, export it and then move the exported folder to your Pine message folder directory and try to open it with Pine.


3. Use the Other Client to Move the Messages to an IMAP Folder
If your other client supports IMAP, open the folder with your other client and copy the messages to a folder on your IMAP server. Then you can use Pine to open the IMAP folder and process or download the messages. If you don't have access to an IMAP server, check out my list of free and reasonably-priced IMAP service providers.


4. Use a Conversion Tool
If none of the above procedures work, try a conversion tool.

 

Sample Macro: Automatically Copy Your IMAP-Accessible Address Book to Your Local Address Book

If you use Pine on multiple machines, you will probably want to keep your address book on an IMAP server so you can access it from anywhere. In order to use PC-Pine when you're off line and also to make a backup of your address book, you can periodically delete all the records in your local address book and then copy all the records from your IMAP-accessible address book to it. I automate this procedure by running Pine with the following initial-keystroke-list “macro”:

pine -I S,A,N,D,D,Y,E,A,CR,;,A,A,S,S,^N,CR,M,A,N,CR

To test this, start Pine and type the sequence of commands. Do not type the commas and press ENTER for CR (carriage return).

Note     On some systems, you need to escape semicolon (;), less than (<), and greater than (>) with a backslash (\). For example:
pine -I S,A,N,D,D,Y,E,A,CR,\;,A,A,S,S,^N,CR,M,A,N,CR
                           ^^
                           note!
You can sometimes avoid needing to escape special characters by running the command from a Bourne shell script. Examples of Bourne shell scripts are in Using a PASSFILE with Unix and Mac Pine and Using a Shell Script to Launch Pine above.

 

¡Warning!     Do not use this until you have backed up both your remote and local address books and you have stepped through the commands by hand. This sequence of commands works only if your address books are configured the way mine are (and it is likely that yours are configured differently from mine!).

 

Another example of an initial-keystroke macro is in the message Re: status of mails in sent-mail in comp.mail.pine.

 

Doing Things Pine Was Not Designed To Do

Using Pine When You're Off Line

The current release of Pine was not designed for disconnected or offline operations, but you can convince it to access only local folders & address books, and let you compose and postpone messages locally, by starting it with a command like this:

C:\Progra~1\Pine\pine.exe -p C:\MyHome\Pine\pinerc -x C:\MyHome\Pine\pinerc-disconnected

where pinerc is your regular pinerc file and pinerc-disconnected, which will override the settings in pinerc, contains something like this

 ## These can NOT be inherited from the -p pinerc
 personal-name=Nancy McGough
 user-id=nm
 last-version-used=4.64
 window-position=77x25+0+0b
 last-time-prune-questioned=999.9
 ## 999.9 means month 9 of year 2899 so it won't prompt you about pruning!
 

 ## These override settings in the -p pinerc
 inbox-path=C:\MyHome\Msgs\~BogusINBOX.cMBX
 address-book=abook-local
 
  
 ## Set smtp-server only if -p pinerc has it blank
 # smtp-server=bogus


 ## Set postponed-folder only if -p pinerc uses a remote folder
 # postponed-folder=C:\MyHome\Msgs\postponed

 

Notes    
  • I put a tilde (~) at the beginning of the name my bogus local Inbox (~BogusINBOX.cMBX) so it is alphabetized at the end of my list of folders. The file extension .cMBX is to remind me that it is in c-client MBX format.

  • Before you run this, make sure that the inbox-path folder, ~BogusINBOX.cMBX, exists. You can create it by doing one of the following.
    • Save a random message to it and, if it doesn't exist, Pine will ask if you want to create it. In PC-Pine, the default mailbox format is c-client MBX. In Unix Pine, the default mailbox format is unix mbox.
    • Make a copy of an existing mailbox.
    • Use the  mailutil create  command, which is discussed above. The advantage of using mailutil is that you can specify the mailbox format. I recommend that you use either c-client MBX or mix format for the inbox-path because you will then be able have multiple instances of Pine running and simultaneously accessing this inbox.


  • The -x command-line argument was introduced in Pine 4.30. If you are using an earlier version of Pine, you can use -P and -p (rather than -p and -x) to compartmentalize your pinerc settings.

  • Non-empty settings in the -p file override settings in the -P file.

  • Non-empty settings in the -x file override settings in the -p file.

  • For more information about using the command-line arguments -P, -p, and -x, see Compartmentalizing and Sharing Your Pine Configuration.

The next time you connect to the Net you can send the messages that are in your local postponed folder. If you do this regularly you will probably want your default pinerc to use a local folder for postponed messages. Another advantage of using a local folder for postponed messages is that it speeds up Pine because Pine does not need to access the IMAP server each time you compose a message to see if there are any postponed messages.

As I discussed above, you can avoid typing a long command by setting up a shortcut on your desktop or start menu.

 

Accessing and “Popping” POP Inboxes

Pine was designed to be an IMAP client so if you would like to take full advantage of all Pine's features, you'll want to store your messages on an IMAP server. If you can't convince your ISP to install an IMAP daemon, or if you can't switch to one of the ISPs that offers IMAP, you can set up Pine to access POP INBOXes.

To set up your primary INBOX to be accessed using POP, specify something like the following as your inbox-path.

inbox-path={your.pop.server/user=LoginName/pop3}INBOX
                                          ^^^^^
                                          this is the key!

To set this, use Pine's configuration screen, which is described in step 5I above. Alternatively you could directly edit your pinerc file.

If you have more than one INBOX, you can list them in the incoming-folders variable in your pinerc like this:

   incoming-folders=nickname1 {imap1.server/user=LoginName1}INBOX,
      nickname2 {imap2.server/user=LoginName2}INBOX, 
      nickname3 {pop3.server/user=LoginName3/pop3}INBOX, 
      nickname4 {pop4.server/user=LoginName4/pop3}INBOX 

The first two above are IMAP INBOXes and the second two are POP INBOXes. When you view your Incoming-Folders in Pine using ML (Main > Folder List), the INBOX specified in the inbox-path variable is displayed in Pine as simply INBOX. All the INBOXes listed in your incoming-folders variable are displayed in Pine as their nicknames.

Disadvantages of using POP rather than IMAP are that Pine does not tell you about recent messages that arrive while you are accessing a POP INBOX and message keywords (labels) & flags, such as New, Answered, and Important, are not remembered between sessions.

 

Tips    
  • To use incoming folders, set the enable-incoming-folders feature in MSC (Main > Setup > Config). For more information about incoming folders, see the section Using the Incoming-Folders Collection above.

  • Most POP clients access a POP INBOX in offline mode, which means the messages are automatically copied to the POP client's local system and can be accessed when the user is offline. Pine, however, accesses a POP INBOX in online mode, which means that Pine leaves the messages on the server and they can be accessed only when the Pine user is online. In other words, Pine does not automatically download (or “fetch” or “snarf” or “slurp” or “retrieve” or “pull” or “pop”) messages that are in a POP INBOX. If you would like that behavior, you can set up a “maildrop” folder, which is discussed in the section Using Pine's Built-In Fetch (#move) Ability above.

 

 

[little green bug] Bugs and Debugging

If you find a bug in Pine or the Pine documentation:

  1. [Updated!] Make sure you are using the latest Pine. The current released version is Pine 4.64 (or 4.64L if it is a modified Pine). The current testing version is Alpine 0.999999.
  2. Determine what, if any, patches for Pine were used to build your version of Pine.
  3. Report the bug, your Pine version & patches, and your operating system (Debian Linux, FreeBSD, Mac OS X, MS Windows, etc.) to one of the Pine discussion groups or directly to the Pine Team.

I prefer to publicly post bugs because that way other people will learn about the bug and know it has already been reported. Also, you and everyone reading the discussion group — both now and in the future — might learn that it's a feature rather than a bug!

Important: If you find a bug that could be exploited by a malicious attacker, report it privately to the Pine Team.

 

The first thing I do when I'm trying to figure out what's going on with Pine is type MJ (Main > Journal) to look at the  REVIEW DEBUGGING  screen. The commands listed in the key menu at the bottom of that screen can be used to get more information. For example, typing T displays the timestamp of each journal entry and typing D lets you change the amount of debug information that is displayed.

To learn more about bugs and debugging in Pine, see:

Debugging Tips

 

(to be written: discuss the hidden variable debug-memory and the files ~/.pine-crash, .pine-debug[2,3,4], ~/.pine-interrupted-mail, pico.save, *.save, & pine.core)

 

See Also

     

 

Enjoy Pine and let me know if you have any suggestions for improving these instructions!

 


Power Pine: Getting the Most Out of Unix-, Mac- & PC-Pine
<http://www.ii.com/internet/messaging/pine/pc/>
Copyright © Infinite Ink & Nancy McGough

 
updated 27-Nov-2006
tweaked 10-Dec-2007