Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Using Pine (UNIX) for POP-based mail UNIX
[Editor's note: Submitted by phlbbrtn on Sat Jul 28]

I came to Macs from being a PC Linux user previously. One thing I have missed in the Macintosh world is my all-time favorite mail reader -- Pine. Pine is a plain-text Mail User Agent. It is designed to be used primarily on networked UNIX systems. Thus it is not set up to perform all the functions of Mail.app or Outlook Express. All you can do with it is read, write and send mail. It also has an Address Book. But for accessing your mail you need a Mail Transport system like Sendmail, Postfix, or Qmail. For POP mail accounts you need, in addition, something like Fetchmail to get your mail from your ISP.

I had been wondering, since installing OSX, if there was a way to use Pine in OSX -- as a Terminal program. The trouble with that is that you would have to make the effort to configure Sendmail [editor: and this has been described to me as one of the tougher things to do in UNIX!]. But mine is a single-user Mac with an ISP and a POP mail account. Sendmail is overkill. Yesterday I figured out how to do it.

Read the rest of the article if you'd like a step-by-step guide on how to install and use Pine with your POP-based email accounts.

Here are the ingredients...

Go to http://www.osxgnu.org/ and download the following:
  1. Python programming language (in utilities)
  2. Pine Email Client (in networking)
Open the Python tgz file with Stuffit Expander, then double-click the Package icon on your desktop. Follow the instructions and install. Do the same with the Pine package.

Then go to this site and download Getmail. Getmail is a Python script. It polls your mail server and directly retrieves mail to a directory of your choice. Untar the Getmail tar file:
gnutar xzvf getmail*tgz
The file "getmail" and those with the ".py" suffix will have to go into /usr/local/bin or anywhere on your command path. Once you've put them there, then type
rehash
Now do the following in the Terminal:
mkdir .getmail
cd .getmail
pico getmailrc
Follow the instructions in the Getmail text files. There is one which gives examples of what goes into getmailrc.

Return to your home directory:
cd ~
Once there, do this:
mkdir mail
cd mail
touch inbox.mbox
cd ~
pine
When Pine is open, navigate to the Setup/Configuration section and enter the full pathname of the inbox.mbox file you just created, where it says "inbox-path" --
/Users/xxxx/mail/inbox.mbox
The same location will be specified in Getmail's rc file. Quit Pine.

At the Terminal prompt type:
getmail.py

And your mail will be retrieved -- assuming you set it up correctly. Then open Pine again and enjoy a different way of using email.

[Editor's note: I have not installed this myself, so I cannot vouch for the instructions. If you have difficulties, please post your comments here...]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,401 views]  

Using Pine (UNIX) for POP-based mail | 18 comments | Create New Account
Click here to return to the 'Using Pine (UNIX) for POP-based mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
a couple of caveats
Authored by: macubergeek on Aug 02, '01 11:56:32AM

1. be sure to use the sample getmailrc file included in the distro. You will want to do
mkdir /Users/username/.getmail
then
move the getmailrc-example file into this new directory and rename it to getmailrc

Then edit this file with your pop information
they list the port for pop3 as 8110, it should be 110 so correct this
comment out the bottom portion of this file by inserting # at beginning of line from the line that reads: [Company Maildrop] down (this assumes all you have is a typical ISP account and not a business account)

2. Python will look for files ConfParser.py and getmail.py in the directory /usr/lib/getmail/
so do
mkdir /usr/lib/getmail and move these two files into this directory from the downloaded distro

3. Assuming you have already installed Pine, navigate to Setup/configuration and create a new mail folder called inbox.mbox....this is where your incoming mail will be stowed.

4. edit /Users/username/.getmail/getmailrc again
on line that begins with postmaster, make sure it reads:
postmaster = ~username/mail/inbox.mbox
note username is of course your ISP account username
note that mail is lower case m

Just experiment with it. It should take you about a half hour to do all this



[ Reply to This | # ]
more caveat
Authored by: Anonymous on Aug 03, '01 11:07:36PM

Looks like http://www.osxgnu.org is dead also.

But Python and Pine are both available on the Softrak
website.



[ Reply to This | # ]
Help? A problem using Getmail...
Authored by: John Lachapelle on May 07, '04 08:32:56AM

I can login to the ips using getmail but get stuck downloading mail files.... I get the error "failed delivering message (destination "/Users/username/mail/inbox.mbox" is not a MailDir or command".

I did set up an inbox using pine, and tried it as a file "inbox.mbox" or separately as a folder "/inbox.mbox", with no help either way.

Any hints?



[ Reply to This | # ]
A few issues...
Authored by: Anonymous on Aug 10, '01 11:01:53PM

I tried installing and configuring the files as indicated in both the main comment as well as the caveat. I have placed ConfParser.py and getmail.py in the /usr/lib/getmail while the other .py files are in /usr/local/bin (had to create ./bin)... created a .getmail directory in my home directory where I configured the getmailrc file as discussed... it seems that I have done everything correctly, but obviously i have not as getmail.py command is not a recognized command whne opening a terminal and when pine is opened, I get a message stating that I have an incomplete maildomain "localhost"

Any thoughts on where I am going wrong?

Thanks a lot!



[ Reply to This | # ]
A few issues...
Authored by: beef on Aug 11, '01 03:05:31AM

hmm...

when I installed getmail thing, I just put the files in ~/bin
then .getmail in ~/

I don't have any problem...

didn't bother to put the files anywhere else...


Does anyone know how to configure Mail.app to look at the mbox files? I use pine for text mails, but some places where I subscribed for newsletter sends html mails...



[ Reply to This | # ]
A few issues...
Authored by: Anonymous on Aug 11, '01 06:49:39AM

Where's this bin directory? In my home? Cause if so, it's not there...



[ Reply to This | # ]
A few issues...
Authored by: beef on Aug 11, '01 12:01:26PM

yes... the bin directory is in my home... I use it to test things I downloaded, and things I write... it's easy to remove things form there, if I decide not to use them for long term...

I created the bin directory and added it to the path in .tcshrc file...

if you had to create /usr/local/bin, or wherever it was that you put getmail.py, you prolly have to add that to your path, too... or your computer won't be looking for it...

go to the directory where you put getmail.py and try ./getmail.py, see if that works...



[ Reply to This | # ]
A few issues...
Authored by: Anonymous on Aug 11, '01 12:34:21PM

Sorry but I'm kinda of new to UNIX... so I should create this bin directory in my home directory and place getmail.py and what else there? Also, what's this .tshsrc file that I need to add things to? As of now, I don't have the files anywhere, i just have a .getmail directory with the getmailrc file in it in home... what else is there to do? Oh and I also have pine installed...

Thanks!



[ Reply to This | # ]
A few issues...
Authored by: Anonymous on Aug 12, '01 05:52:08AM

You can create your own "bin" directory in your
Home directory. I use mine to put shell scripts and
stuff.

"mkdir bin" in the terminal.

Make sure it has executable permissions - "chmod 755 bin"

Make sure all the scripts you put in it are executable also.

If you don't have a .cshrc file make one.

Mine has this line:

set path=(/bin /usr/bin /sbin /usr/sbin /usr/local/bin /usr/local/sbin /usr/X11R6/bin $HOME/bin)

The $HOME/bin is the important one here.



[ Reply to This | # ]
A few issues...
Authored by: Anonymous on Aug 12, '01 07:37:38AM

Got getmail and pine to work just right... now, i'm trying to set up a crontab file (as per my message on the main body here)... any thoughts on that>?



[ Reply to This | # ]
A few issues...
Authored by: beef on Aug 12, '01 11:04:41AM

I get the feeling you want to get things done in CLI... but there's a program called cronnix (or maybe it was one n... forgot) that let's you do things easier with GUI...

I'm not really one to answer about cron...
if you haven't done so yet, I suggest you pick up a book on unix (I don't know if it's important to specifically choose a book on BSD... maybe you might wanna check out a book on csh/tcsh, too... if you have no intention to change your shell anytime soon). You can go to borders and spend as much time as you want in choosing a book you like (I think it's important to pick a book with a style you like/comfortable with when it's about Unix... I think half the books in the bookstores are written in Martian... hmm... am I supposed to understand Martian? Men are from Mars, right?). Anyway... People here are friendly and they tend to write stuffs in very easy to understand manner.... but even then, they can be quite complicated. It's really nice to have a book you can fall alseep on... I mean..... I think my brain fell sleep... I hope you know what I meant to say.

Ok... I think I'm drunk. I wrote a lot of nothing... Night (Singapore time... add about half a day to your time if you're in US... I'm off to Japan to see my grandparents tomorrow.... no net connection there.. :~P)



[ Reply to This | # ]
A few issues...
Authored by: beef on Aug 11, '01 03:08:33AM

huh?

you had to create /usr/local/bin???

maybe it's not in your path



[ Reply to This | # ]
Using Cron to have auto-getmail
Authored by: Anonymous on Aug 11, '01 10:34:27PM

I'm trying to use cron to get getmail.py to run automatically every certain interval... has anyone managed to do this or perhaps another way to auto run it?

This is the crontab file I am using

SHELL=/bin/tcsh
PATH=/Users/sucrose/bin

* * * * * getmail.py>> /Users/sucrose/cronmessage 2>> /Users/sucrose/cronerrormessage

The idea is that it will run getmail.py which is ~/bin and write to a log based on what happens... only it doesn't...



[ Reply to This | # ]
Using Cron to have auto-getmail
Authored by: Anonymous on Sep 03, '01 03:11:27PM

I have my cron check for mail every
ten minutes:

1,11,21,31,41,51 * * * * /Users/phil/bin/getmail.py

The first asterisk field is minutes. Every 30 minutes
would be:

1,31 * * * * /Users/phil/bin/getmail.py



[ Reply to This | # ]
Using Cron to have auto-getmail
Authored by: sungwoo on Dec 01, '01 07:23:58PM

I've set the checking time as every minute, and it works.
The problem is, crontab send the log every minute to the system.log.
How can I avoid sending the log of the getmail activity only?
Thanks.



[ Reply to This | # ]
Procmail
Authored by: autohag on Nov 04, '01 06:48:03AM

Is it possible to get procmail running using this method?

I got Pine installed and configured with little trouble but haven't been
able to get procmail to run (ie. actually filter incoming mail).

Thanks!



[ Reply to This | # ]
Procmail
Authored by: Anonymous on Nov 04, '01 09:20:36AM

I would like to use Procmail also but I don't think there's a way to
make it work with Getmail. Procmail is a "Sendmail sort of thing"
that hinges on an invisible ".forward" file to make it process.

If you want to set up Sendmail that's another story ...



[ Reply to This | # ]
Procmail
Authored by: mhopeng on Apr 24, '04 07:12:41PM


Pine now has a "Rules" feature that allows you to do filtering. You can't use your existing procmail settings, but I bet its a lot easier to set Pine rules than to get procmail running...



[ Reply to This | # ]