[SWLUG] Mail from File and /var/mail/

Daniel Morris danielm at iee.org
Wed Feb 16 10:14:44 UTC 2011


On Wed, Feb 16, 2011 at 09:30:38AM +0000, Jon Reynolds wrote:
> Hi all,
> 
> I have 2 mail questions...
> 
> 
> 1. There is a file in my home dir that is a relic from a period of time
> where mutt was putting copies of sent mail into a file called '~/sent'
> This is therefore just a file, not a directory, with what seems to be
> mail, back to back in it. I use a maildir format and was wondering how I
> could extract the mail from this file and put it into the correct
> maildir place. i.e. ~/Maildir/.Sent Items/cur/

You should come along to the Carmarthen LUG, we've talked long and hard
about converting from mailbox formats a few times!

The file ~/sent will be in good old fashioned mbox format, which is the
default for mutt, mail & many other CLI tools. I think mutt is brilliant
and it works well with all sorts of local formats plus imap etc. You
just need to tell it which to use, or point it at a store and it will
generally work things out. 

Take a look for mb2md-3.0.pl, it should be trivial to convert the file
you. I have 5GiB+ of neatly sorted & archived mbox files and have
several times swept through it converting to maildir, part munged my
muttrc to understand the new maildir format and never quite finished
the job on the other side with procmail doing most filtering (which
obviously also will need to change). I also have multiple setups to
keep some separation between work & personal stuff, and each needs doing
and checking and checking (having multiple backups first, of course)!

I'm ultra paranoid about my mail, and have a few dozen messages that
have been corrupted within mbox over the years that mb2md hasn't fully
converted and hence never quite get to finishing the job before
"needing" to carry on using my working setup...  In the meantime I miss
out on the strength of the search tools that from KDE don't understand
mbox, which is one of the reasons I want to change to maildir.


> 
> 2. I keep getting a message saying I havemail in /var/mail/jonr 
> How do I retrieve that?

Just point your mail client to it. In mutt it is referred to the as the
$spoolfile and normally inherits the $MAIL environment variable. You can
also just change to it as any other mail box.

 Daniel



More information about the Swlug mailing list