[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please help with cleaning up after a mess I made with my email



On Tue, 12 Aug 2014 15:36:01 -0600
Paul E Condon <pecondon@mesanetworks.net> wrote:

> I have been cleaning up old email files and in the process created a
> mess I have several mail directories containing emails from different
> times and collected under slightly different operating condition. I
> want to merge them into a single directory with the emails arranged in
> threads by topic and in chronological order. More detail follows:
> 
> I'm running Wheezy. I get my email from several places using
> fetchmail.
> 
> My .fetchmailrc works. I type 'fetchmail' at an xterm command line
> whenever I want to get another batch of accumulate email, which is
> what I want to do.  No, bell signaling arrival of mail interrupting
> some useful work for me.
> 
> I have procmail configured to deliver email to several mbox format
> files, all in a directory whose name is ~/mail. I have about 60
> delivery mbox files in ~/mail. Procmail also runs bogofilter for
> spam suppression.
> 
> I read my email using Mutt. My problems with SMTP and Mutt from some
> time ago are solved.
> 
> >From my investigations of other email arrangements I have accumulated
> other directories of email folders, mostly in mbox format, but also
> one in Maildir format. All these other email directories are also in
> my home directory (of course with different names ;). I want help to
> devise some command line that will read emails from one of these old
> directories and move copies into my current email directory. I think
> this can be done starting with cat and using formail and ending with
> procmail, but I'm getting a lot of emails that purport to come from
> foo@bar , which I know is because I've some formail options wrong.
> Here is an example of things I've tried:
> 
> cat mail-20140812_004037/* | formail +1 -tzeds procmail
> 
> I've renamed all the old email directories to contain a timestamp
> extension. The above shows one of them. I don't really understand +1,
> but a lot of email magic seems to have it. I'm hoping that this will
> feed the emails to procmail and it will process them as if they were
> coming from fetchmail, which I know works for currently arriving
> email. I know that many of the emails don't have a envelope From line,
> but I don't know how to get formail to pick out a string that can be
> made into a functional From line. My understanding is that the
> envelope From line is only used in routeing the email throug the
> internet and once it arrives at a destination the data in it is
> ignored in deference to the actual headers that contain a colon, and
> the text of the body. So, I guess I'm looking for a way to get emails
> that have missing parts to appear to be whole to formail and procmail.
> Only I don't really know what they look for or why. Suggestions?
> 
> TIA
> 
> --
> Paul E Condon 
> pecondon@mesanetworks.net

Hi Paul,

I don't think I fully comprehend your need, and others who do might
have exactly the suggestion you need.

If not, consider what I say here a plan B...

There are something like four varieties of mbox. You have both mbox,
maildir, and something you called "mailbox". It sounds like you want
all email in one folder, which I personally wouldn't recommend.

When confronted with a situation similar to yours, that being mail from
years and years and years saved in different formats by different
clients and programs, what I ended up doing was creating my own Dovecot
server, adding a new IMAP email account to my source email client (or
situation), copying all my emails, a folder at a time, to the new IMAP
email account mapped to the new Dovecot, and then just using Dovecot to
hold all emails (I'd suggest using maildir for Dovecot, works well for
me, and works well for rsyncing only new or changed emails on backup).

I tried every which script every which way, and the only way I could
convert my menagerie of email formats to one unified one was this IMAP
copy process.

By the way, a big benefit is that from now on, I can use any IMAP aware
email client as a window into my IMAP, and *only* a window into my IMAP.

If you choose to do this, here are my writings on how I did it:

* http://www.troubleshooters.com/lpm/201202/201202.htm

HTH,

SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Reply to: