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

Use pine to read mail UNIX
Here's how you can download mail using and still be able to read it from anywhere. A little background ... I like to use when I'm at home, and is configured to download all my mail via POP and delete it from the server. When I'm at work, I want to be able to read my mail, so I just use pine to read's mail file. This is a pretty easy one. In a shell, just do the following:
 % cd ~/mail
% ln -s /Users/user_name/Library/Mail/account_name/INBOX.mbox/mbox
Note: The "ln -s" line is shown on two lines, but needs to be entered as one with a space replacing the line break.

In the above, user_name is your local user name, and account_name is the email account you're getting mail from (if you look in that directory, the names are obvious). The final part, (./my_account_inbox) is what you want the mail folder to be called when pine sees it. Since I use AT&T Broadband's email, I called mine att-inbox.

Anyway, now if you run pine and go to the folder list, you'll see your my_account_inbox right there. As long as is running while you're out, it'll keep fetching mail and writing it to your mailbox. pine will notice the changes at regular intervals, or you can hit Ctrl-L while in the index screen to get it to check for anything new. Keep in mind that this just causes pine to check the mailbox file -- it doesn't make Mail check with your mail provider for mail. To do that, you could write an AppleScript that can be run from the command line that causes Mail to wake up and check your email. Run osascript with this:
 tell application "Mail"
check for new mail
end tell
Any new mail will get pushed into your mailbox file, so it'll be available to pine.

One final note: I've only done this with POP accounts, and it sounds like it may not work with IMAP. Also, this should work with any UNIX mail program that lets you choose an alternate mailbox. If you use a UNIX program that notifies you when you have mail, try setting $MAIL to the path to your mailbox file to make the program find the new mailbox.
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)

Use pine to read mail | 23 comments | Create New Account
Click here to return to the 'Use pine to read mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
would this work with Eudora?
Authored by: j-beda on Oct 31, '02 10:42:01AM

I wonder if this would work with Eudora? I seem to recall that Eudora
stores mail in a unix-format mailbox.

Combined with something like "fetchmail", you should not even need your GUI application to be running, and thus would not need to have the user logged in in order to access new mail remotely.

[ Reply to This | # ]
would this work with Eudora?
Authored by: david-bo on Nov 04, '02 09:29:25AM

No, it would not work in Eudora, Eudora uses Mac-line endings and pine chokes on that (and pine uses unix-line endings, which, OTOH, Eudora chokes on)

[ Reply to This | # ]
A script to automatically link your mailboxes
Authored by: mithras on Oct 31, '02 10:58:00AM
I wrote a script (actually, a pair of scripts) to make all of my 'archived mail' mailboxes available in pine. Note that it does *not* automatically link your POP inboxes like the above hint does, so they complement each other nicely.

First create one script, named pine_import (or whatever):

if [ ! -e ~/mail ]; then
mkdir ~/mail
find ~/Library/Mail/Mailboxes -name mbox -exec ./pine_link {} ;

That script calls a 'helper script' named pine_link, which is below:

temp=`dirname "$source_mbox_path"`
source_mbox_name=`basename "$temp"`
destination_mbox_path=`echo "${HOME}/mail/${source_mbox_name}" | sed 's/.mbox//'`

ln -s "$source_mbox_path" "$destination_mbox_path"

Put them both in ~/bin, make them executable, and run pine_import to make your Mail archives readily accessible from pine!

I use this in conjunction with the Java SSH Terminal (which you can download from me) to access my Mail folders from anywhere - handy to look up some old piece of mail.

[ Reply to This | # ]
A script to automatically link your mailboxes
Authored by: avit on Oct 31, '02 08:14:52PM

Nice script! One bug in pine_import:
find ~/Library/Mail/Mailboxes -name mbox -exec ./pine_link {} ;

should have a backslash to escape the terminating semicolon:
find ~/Library/Mail/Mailboxes -name mbox -exec ./pine_link {} \\;

(I realized it's not YOUR bug after I previewed my own post. The forum doesn't do backslashes unless you escape them by typing \\\\)

[ Reply to This | # ]
A script to automatically link your mailboxes
Authored by: avit on Oct 31, '02 08:17:53PM


What's going on here? One minute the backslashes disappear, and the next minute they're doubled after I escape them!

Please view all double backslashes as single backslashes in my previous post.

[ Reply to This | # ]
Why not just use IMAP?
Authored by: rackerby on Oct 31, '02 11:58:01AM

Wouldn't it be a lot easier to just leave your mail on the provider's server and use the IMAP protocol in both and Pine?

[ Reply to This | # ]
Why not just use IMAP?
Authored by: shreddiez on Oct 31, '02 01:46:41PM

Because some mail hosts (ISPs, universities, whatever) don't provide IMAP support. duh.

[ Reply to This | # ]
Why not just use IMAP?
Authored by: area51 on Oct 31, '02 02:06:23PM

With thousands of messages in over 20 different folders, I'd rather keep my archived messages on my laptop rather than use up my university disk and mail quota. Keeping all my archived mail on my own machine also gives me a greater sense of privacy and security.

[ Reply to This | # ]
Why not just use IMAP?
Authored by: klatt on Feb 28, '06 03:35:32PM

You can still read your IMAP mail offline in and it DOES save a copy to your hard drive.

Either way you can export it as you wish from IMAP, or if you ONLY have POP3 you can leave the POP3 mail on the server.

If your big concern is security then this will let you have mail in TWO places which is better than one. Probably a lot more than two places as your work/university should be doing multiple backups of the data. This is much more secure than just on your friggen LAPTOP's hard drive. One drop and all your data is gone!


[ Reply to This | # ]
Working in Eudora??
Authored by: syko on Oct 31, '02 03:18:15PM

I don't think this would work, because it wouldn't 'automatically' update in Eudora if you got Eudora to read the mbox format (you have to change the type creator, etc., as well)..

I'm working on a solution to have my os x machine grab my mail, spam filter it, then allow eudora to read it..
i got about 100 spams a day... grrrrrrrrrrr i'd use but i have thousands upon thousands of messages that would choke on..

[ Reply to This | # ]
Working in Eudora??
Authored by: dborod on Oct 31, '02 06:15:14PM

I've got tens of thousands of messages in dozens of folders that hasn't choked on.

[ Reply to This | # ]
Working in Eudora??
Authored by: syko on Nov 01, '02 06:09:39AM

My Eudora folder is 1.15 GIGs of space...

Eudora handles it with eaaaaase.. now, i'm sure Mail could probably read an text file just as nice as Eudora, but can it search as quickly? or can it 'open' a message as quickly? or use the screen space that is available efficiently? and more importantly, will it be as 'fast' as Eudora?

I've used mail app before and I already know the answers, otherwise I'd be using Apple's mail program..

[ Reply to This | # ]
Working in Eudora??
Authored by: LouieNet on Nov 20, '02 03:19:49AM
syko wrote:
I'm working on a solution to have my os x machine grab my mail, spam filter it, then allow eudora to read it..

I'll assume that you can work out grabbing your mail yourself with either fetchmail, or some kind of mail alias or .forward file to pipe your email through your procmail recipe or other spam filter program. How about using a wrapper program to send your email back up to the SMTP server if your spam filter determines that it's a clean file. You can send it back up to a different username, and use a different personality profile in Eudora to download it again to a format Eudora can read.

[ Reply to This | # ]
pine, imap, ssl
Authored by: mpetit on Oct 31, '02 06:53:33PM
Just for your information: It is eays to set up pine for pop, imap, with or without ssl. E.g. for imap, ssl and user "mumu" write:

inbox-path {}INBOX

[ Reply to This | # ]
Two Problems Using Pine
Authored by: HoxBox on Oct 31, '02 11:41:43PM

I use pine to read mail off my Sun account. I run into two problems in OS X that I did not encounter in OS 9.

I cannot seem to use Ctrl-O to postpone messages. The command does not go through. And then, I can't seem to get print-to-attached-ansi to work. Both of these worked in Nifty Telnet and other flavors just fine.

Anyone know how to get them to work?

[ Reply to This | # ]
Authored by: Xeo on Nov 01, '02 01:40:31AM

Just wanted to post an easier AppleScript to go with osascript. The whole command would look something like:

osascript -e 'tell application "Mail" to check for new mail'

That's it. It's easier when on one line.

[ Reply to This | # ]
Re: osascript
Authored by: jalex on Nov 06, '02 04:47:10PM

That's a good one, thanks for the shorthand! I've never actually taken time to try to learn AppleScript... I just hack until I find syntax that works ;-)

[ Reply to This | # ]
Use pine to read mail
Authored by: mweier on Mar 11, '04 08:53:37AM

Cool! i was wondering how to do this. It seems to work... mostly.
I can view the messages just fine in Pine. When I delete messages & expunge, they are gone from Mail when I next quit/reopen it. Cool!

1.) HOWEVER, when I next quit/reopen Mail, all the read messages are suddenly flagged as unread again, and any flags i'd set are wiped out.

2.) I have checking multiple accounts - is there anyway PINE can be set to be able to send from multiple accounts?


[ Reply to This | # ]
Use pine to read mail
Authored by: mweier on Mar 11, '04 08:56:37AM

note: it's only when you expunge that's messages get flagged as unread (and flags are stripped from them). If you don't expunge, is just how you left it. Also, this expunge issue seems to happen regardless of whether is running while you're in PINE.

Finally, is there any way to link the sent items with Mail's Sent folder for that account? so that items sent in PINE will show up in's Sent folder?


[ Reply to This | # ]
Use pine to read mail
Authored by: tinker on May 31, '04 01:02:36AM
I ran into the same issue -- whole mailboxes marked unread -- when I tried to use rsync to syncronize mailboxes btw. desktop and laptop. It turned out that the timestamps were the issue: if you alter MessageSorting.plist (or maybe MessageSorting.plist.backup, or both, I don't remember which) while isn't running and then fire it up, all hell breaks loose. Run rsync with those excluded, and the problem disappears.

As to having Pine's sent mail show up in Mail's sent-mail folder, why not bcc: yourself and then set one of's rules to be "mail from me gets marked read and sorted into SENT"? It's inelegant, and occasionally you might forget and send yourself something and wonder why it isn't showing up in the inbox, but it works.

What I want to know is this: If you read mail on Pine while is running, and then you delete a message (but don't expunge it), what happens to it when you return to Is it deleted, or is it still sitting there? Is there some way to trash it without creating this marked-unread issue?

[ Reply to This | # ]

Use pine to read mail
Authored by: tinker on May 31, '04 11:55:20AM
Hmm. This is uglier than I thought. I tried implementing Rael Dornquest's hack based on this hint, and I could indeed see all of my folders from Pine -- but all of my read messages showed up as unread in Pine, and any time that I viewed ANY message at ALL in Pine, the entire mailbox was marked unread the next time I used!

Is there a fix for the fix??

[ Reply to This | # ]

Use pine to read mail
Authored by: paul h on Aug 25, '04 01:36:59PM

Did anyone ever find a solution to this?

[ Reply to This | # ]
Authored by: cujo on Feb 27, '06 06:02:14PM

Does anyone know if this tip works in Tiger?

[ Reply to This | # ]