Setting up pine for Mac OS X

You might want to set up a Unix application to read your email via a remote connection instead of using Eudora or Outlook express. This document explains how to obtain, compile and configure Pine for use on Mac OS X to read email from a pop3 account. You don't need sendmail: you will read your email directly from your POP3 server. I will gladly add any instructions for other configurations if you send them to me. The original information was posted on MacFixIt by CapVideo who took it from Kapu.net, but I made a few changes and completed the explanations for activating the automatic password cache. Also, the man pages are expected to go in /usr/local/share/man (since this is the default MANPATH).

The layout for the code (black outline, dark background) is identical to the one used on the very useful Stepwise. I thought it looked good.

Two very simple ways

By far the two simplest ways are two use one of the two "package" managers that Mac OSX/Darwin supports (Fink and DarwinPorts). With fink, type fink install pine. With Darwinports, type port install pine. If you don't have access to either one (or don't feel like installing anything new except pine), read on. Note, with Darwinports, there is no variant to use the password file (i.e. you have to type your password every time).

Downloading and compiling pine

You need to first download the package and then compile it. You must have the Developer Tools installed. Get them from Apple (free regsitration required, click Join ADC Now). A very useful feature that pine has is the ability to cache passwords in a .pine.pwd password file (more on that in the Configuration section). You have to activate it by hand though. Finally, you don't really want to copy all the files (Mac OS X comes with pico for instance, and imapd and mtest are not important if you do not plan to do anything fancy). The --passive option to wget is not necessary if you are not behind a firewall, but it won't hurt if you are not. To use the password file PASSFILE, you need to pass an argment to the build script. I don't know why, but I can't for the hell of me figure out how to escape the bloody thing ('-DPASSFILE=.pine.pwd' compiles but does not work, '-DPASSFILE=\".pine.pwd\"' should work (and used to work) but does not if you call it first, etc...). In the spirit of all the web pages that say "This-is-what-I-did-and-it-works", I found the ugliest workaround ever: I compile it twice with different options. If you know the solution, please email it to me at dccote@novajo.ca. I know the problem is on the line 834 of imap/src/osdep/unix/Makefile:

`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c,
but I gave up. Here is the "solution":

To download and compile pine:


cd
on OS X 10.0.4:
wget --passive ftp://ftp.cac.washington.edu/pine/pine.tar.gz
on OS X 10.1 and later  :
curl -O ftp://ftp.cac.washington.edu/pine/pine.tar.gz

gnutar zxf pine.tar.gz
cd pine*/
./build osx EXTRACFLAGS='-DPASSFILE=.pine.pwd'
Upon error:
imap.c: In function `passfile_name':
imap.c:3182: error: parse error before '.' token
imap.c:3183: error: parse error before ')' token
imap.c:3188: error: parse error before '.' token
make: *** [imap.o] Error 1
type the following:

./build osx EXTRACFLAGS='-DPASSFILE=\".pine.pwd\"'

To install pine:

sudo install -o root -g admin -m 755 -d /usr/local/bin
sudo install -o root -g admin -m 755 -d /usr/local/share/man/man1

sudo install -o root -g admin -m 755 -c bin/pine bin/pilot /usr/local/bin
sudo install -o root -g admin -m 644 -c doc/pine.1 doc/pilot.1 /usr/local/share/man/man1

Configuring pine for POP3 accounts

You only need to modify a few lines in the configuration file to be ready to go. The instructions here are for my service provider (sympatico.ca). Replace with your servers, ids, passwords.

First, you need to create an empty configuration file. Then you need to create an empty password file .pine.pwd for pine to store the POP3 passwords for subsequent connections. You modify the permissions to make it readable by you only.

Setting up the files:

cd
rehash
pine -pinerc .pinerc
touch .pine.pwd
chmod 700 .pine.pwd

and now modify the .pinerc file. Assuming your POP3 user id is pop3userid, then modify these lines:

type pico ~/.pinerc and modify the following lines (15 through 29):

# Over-rides your full name from Unix password file. Required for PC-Pine.
personal-name=Daniel Cote

# Sets domain part of From: and local addresses in outgoing mail.
user-domain=sympatico.ca

# List of SMTP servers for sending mail. If blank: Unix Pine uses sendmail.
smtp-server=smtp1.sympatico.ca

# NNTP server for posting news. Also sets news-collections for news reading.
nntp-server=news1.on.sympatico.ca

# Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox
# Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER).   
inbox-path={pop1.sympatico.ca/user=pop3userid/pop3}INBOX

Using pine

You can now use pine. In the terminal, type pine. Type E to exit the greeting, then you will be asked you pop3 password and whether or not you want to save it for next login. Say yes and you are ready to go: you can remotely check your email without Eudora, Outlook Express or Netscape Messenger. For more information, go to the Pine Home Page.