Help for Pine - Compiling
You are in Home > Compiling


Building Pine is not difficult. There are several advantages about building Pine that you can not get if you only get a precoompiled version. For example, you can fix a bug as soon as a patch is available. The price that you must pay in order to receive the advantages of compiling your own source code is usually minimal and we will try to explain how to build pine from scratch.

Getting the Source

The source code of Pine can be obtained from their ftp server at There are a few mirror places, for example A more extensive list of mirror sites can be found here.

Also note that you can get the binary precompiled for many versions of Pine. They do not however include SSL support.

What is the Latest Version of Pine?

The easiest way to determine what's the latest version and what improvements it contains is to visit this web page. The latest version is always at the top of the list.

What else do I Get by Compiling Pine?

A few other software is included when you build Pine from source code. Here is a list:

  1. c-client.a, is the compiled version of the c-client libary. This library is located in the "/imap/c-client/c-client.a". You should know that library is used to compile the imap server (imapd) and Pine. We will talk about this library later.
  2. imapd, is the IMAP server. It's source code is in "/imap/imapd/imapd.c"
  3. mtest, this is a test mail client, you can learn how to use the c-client library just by reading its source code.
  4. libpico.a is the Pico library. Used to compile Pico and Pine. It is located in "./pico/libpico.a".
  5. Pico, this is an easy to use text editor, compiled using the libpico.a library.
  6. Pilot, is a file browser, also compiled with the libpico.a library.
  7. Pine, the main star. It's compiled with both the libpico and c-client library (in other words is huge!)
  8. rpdump, a program used to copy configuration files kept in an imap server to a local file.
  9. rpload, a program used to copy your configuration files to an imap server, so that you don't have to create a new pinerc file for every computer where you install Pine. The same configuration can be read from the IMAP server, no matter where you go.

How Do I build Pine

In order to build all of the above you must move into the directory that contains the source code of Pine and write a command of the form.

./build xxx

The only trick is to know what "xxx" is. Here is a table showing what you should write (Note that this list was obtained from the makefile of the c-client library. I can't test all of these claims. The actual codes in the build command for Pine is a much smaller set, but I decided to list all of these in the hope that if you can try them and make something out of it. It also explains the real set of codes that you can use to build Pine much better than the build script for Pine).
CodeOperative SystemRemark
a32AIX 3.2 for RS/6000
a41AIX 4.1 for RS/6000
aixAIX/370not RS/6000
am2AmigaDOS with a 68020+
amaAmigaDOS using AS225R2
amnAmigaDOS with a 680x0 using "new" socket library
aosAOS for RT
artAIX 2.2.1 for RT
asvAltos SVR4
bs3BSD/i386 3.0 and higher
bsdgeneric BSD 4.3
d-gDG/UX prior to 5.4
d54DG/UX 5.4
do4Apollo Domain/OS sr10.4
dpxBull DPX/2 B.O.S.
gasGCC Altos SVR4
gh9GCC HP-UX 9.x
ghpGCC HP-UX 10.x
ghsGCC HP-UX 10.x with Trusted Computer Base
go5GCC 2.7.1 (95q4 from Skunkware _not_ 98q2!) SCO Open Server 5.0.x
gscGCC Santa Cruz Operation
gsoGCC Solaris
gulGCC RISC Ultrix (DEC-5000)
hppHP-UX 9.x
hpxHP-UX 10.x
hxdHP-UX 10.x with DCE security
iscInteractive Systems
lnxLinuxtraditional passwords and crypt() in the C library
lnpLinux with Pluggable Authentication Modules (PAM)
lrhRedHat Linux
mntAtari ST Mint
ntoQNX Neutrine RTP
os4OSF/1 4Digital UNIX
osxMac OS X
qnxQNX 4
s40SUN-OS 4.0not Solaris
sc5SCO Open Server 5.0.x
scoSanta Cruz Operation
shpHP-UX with Trusted Computer Base
sgiSilicon Graphics IRIX
sg6Silicon Graphics IRIX 6.5
sl4Linuxusing -lshadow to get the crypt() function
sl5Linuxwith shadow passwords, no extra libraries
slxLinuxusing -lcrypt to get the crypt() function
snxSiemens Nixdorf SININX or Reliant UNIX
solSolariswon't work unless "ucbcc" works -- use gso instead
sosOSF/1 with SecureWare
ssnSUN-OSwith shadow password security
sunSUN-OS 4.1 or betternot Solaris
sv2SVR2 on AT&T PC-7300incomplete port
sv4generic SVR4
ultRISC Ultrix (DEC-5000)
uw2UnixWare SVR4.2
vulVAX Ultrix
vu2VAX Ultrix 2.3e.g. for VAXstation-2000 or similar old version

Will Pine Build on my System?

If your system is not in the above list, it may be possible to have Pine available in your system, but probably there must be a portability issue, and you will probably have to get it through a third party vendor.

What are the most common parameters that people need to consider before compiling Pine?

There are several, I'm not going to talk about the 60MB of disk space that you need in order to build Pine, this section deals with parameters that affect the end result of this compilation.

Defining a Password file

A password file allows users to save their passwords in a file, so that they do not have to enter them every time that they connect to their e-mail server.

You can only enable password file support when you build Pine. This is not binding, in the sense that even if you enable it you must still create the password file in order to be able to use it. The only sure way to define a password file is to edit the file pine/pine.h and add the following line to it:

#define PASSFILE "path/to/password/file"

and after this, build Pine (again if necessary). I usually enter the above definition normally almost at the top of the file, around the area where the Pine version is defined. This is a change in the source code of Pine, not in the configuration of Pine.

If you are using a version of Pine older than Pine4.41, then the path specified above is relative to the directory where the pinerc file of the user using Pine is located (this is normally the $HOME directory, but it may be a different place). You can also specify a full path if you like.

At this time the password file feature was thought to be used only by the person compiling pine, not for use in a system, that means that if you want to use this system, you will have to compile your own version of Pine.

Starting in version 4.43, PC-Pine allows you to define any path for the password file, and all you need to do is to start PC-Pine as

Pine -passfile C:\full\path\to\location\passfile.pwd

Once you have a working version of Pine with password file support, if you are using version 4.55 or later you can change the location of the default location (defined by the PASSFILE variable), by using the -passfile command line.

If you want to use the passfile option as a user, you need to create an empty file with the name as specified in the PASSFILE variable as discussed above. When Pine is started, Pine removes all permissions for group and world to access your password file, so that your password file can not be read by other users in your system.

When Pine finds a match on the server and username it uses the password found in the password file. If no good password is found, or none exists in the password file, you will be prompted to enter your password, and later be offered to save the password in the password file. You can avoid that Pine saves your password in the password file if you use the option -nowrite_passfile when you start Pine.
See Also:


About Fixing Bugs

Bugs are Nature's Bugs

Fixing a bug requires recompiling Pine, that's no news. Sometimes, for unknown reasons to me, bugs are fixed but not publicized, and this is especially true when the bug is in the imap part of the code of Pine (that is to say the c-client library).

Given that many times patches are not distributed to fix bugs, all I can recommend is that you try to upgrade the imap part of the code in Pine. In order to do this, try removing the imap/ directory from the distribution of pine and replacing this directory by a new imap directory (with the same name as before) from the distribution of the server code at


About Header Files

Pine is distributed with the c-client and pico libraries. Each of these libraries has specific header files, which are included by default in the file pineX.YZ/pine/headers.h.
If you are creating a new module for Pine, make sure you include headers.h. You do not need to include any other headers file, unless it's specific to your module. For example, the files pine.h and os.h are included by including the file headers.h.
Notice that as of the current version of Pine (4.44), the file os.h is included before pine.h. What this means in practice is that if you are inserting a #define statement, it's usually easier to insert it in the file pine.h, and that overriding definitions in the file os.h can be done by inserting them in the file pine.h by undefining the definition of the file os.h. In case a black hand changed the order of the inclusion of the files os.h and pine.h, this trick won't work anymore, and it's recommended to use this trick in the file headers.h, after all files have been included.

How Do I Build Pine in...

You are in Home > Compiling