procmail
[Top] [All Lists]

Re: splitting up mbox with formail?

1998-08-26 16:12:26
From: Christopher Lindsey <lindsey(_at_)ncsa(_dot_)uiuc(_dot_)edu>

To: lewst(_at_)yahoo(_dot_)com

I have a very large mailbox file with 6 months worth of messages in
it.  I would like to split this file up into 6 smaller mbox files
based on month.

Obviously, entering the large mailbox file and manually saving each
message to the appropriate file is too tedious.  How could I use the
procmail tools to automate this task?


<Chris' solution (which *looked* nice at a glance) deleted>

My only complaint is in swatting flies with bazookas.  I don't
think, in the scenario outlined by the initial message writer,
that it *does* have to be very tedious to save the messages
in a UNIX mail program.

For example, in /usr/ucb/mail, supposing there were, say, 1,000 or
so messages in this file: they are already sorted by date by default.  I
would just 

        & s1-154 Jan
        & s155-278 Feb
        & s279-420 Mar

etc., etc.; using "h ###" (where "###" is a number) to navigate
my cursor to the appropriate screenful of messages to look for the
starting message number of the next month.

I would think I'd have the job done inside two minutes without rushing.
So why (other than for the intellectual exercise and to collect yet
another model of application) would you want to do this one-time task in
procmail?  Admittedly, if he will later continue to store by month then
the extended recipe has more value.

On another note, I was hoping someone would have responded to my
question of yesterday to this list re. how I might use mail from work to
trigger the wholesale shipping of my home mail spool to my work address.
I had provided a draft recipe that I was afraid to test because my
procmail coding is so rusty. . . .  Did that somehow not get posted to
the list?  I forgot to pay attention to whether it appeared here.

--
  __                               ___               dman(_at_)netcom(_dot_)com
 (/ \  _   /) /) _ _ _  _    _    (/__) _   _   _    Dante Strasse 53
 /`  )(_(_( _(__/|/|/(_(_(_/| (   / (  (_)_/_)_/_)_  69115 Heidelberg
(___/                          ` (   \               Germany