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


Click here to return to the 'A script to automatically link your Mail.app mailboxes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to automatically link your Mail.app 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 Mail.app '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):

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


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

#!/bin/sh
source_mbox_path="$1"
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 Mail.app 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 Mail.app mailboxes
Authored by: avit on Oct 31, '02 08:17:53PM

Dang!

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 | # ]