procmail
[Top] [All Lists]

Re: mail assistance please

2001-12-26 19:56:25
Catching up on some old mail ...

-----Original Message-----
From: procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE]On Behalf Of 
Michael B.
Weiner
Sent: Tuesday, November 27, 2001 6:26 PM
To: procmail-users(_at_)procmail(_dot_)org
Subject: mail assistance please


I am trying to split up a 1.6G mail box into something more in line that
an email can pop off reasonably. I read the man page, and i am not clear
on the simplest method of doing this:

procmail -des <program> mailbox

Above, not quite what you want. I think that you meant "formail", not
"procmail"? As in:
  formail -des procmail -m ./splitrc < mailbox

where "./splitrc" is the name of a promcail script file written for  the
purposes of filing/separating the mail.

Here are two ideas on how to file the mail,

1) split the incoming messages into folders which contain at most MSGMAX
messages. This method depends on formail's sequencing of an environment
variable called FILENO:

       FILENO
            While splitting, formail assigns the message  number  currently
being
            output  to  this  variable.   By presetting FILENO, you can
change the
            initial message number being used and the  width  of  the
zero-padded
            output.  If FILENO is unset it will default to 000.  If FILENO
is non-
            empty and does not contain a number, FILENO generation is
disabled.

If we take the integer division result of dividing FILENO by MSGMAX, we can
use that as handle to create a filename, which in turn is a mailbox where
the messages will be collected. We would invoke formail as follows:

   (FILENO=0; export FILENO; MSGMAX=500; export MSGMAX; \
    rm -f ./mbox.????; \
    formail -des sh -c 'n=`expr $FILENO / $MSGMAX`; m=`printf mbox.%04d $n`;
cat - >> $m' < mailbox)

where (for example) messages 1..500 are deposited in the file named
'mbox.0000', messages 501..1000 are deposited in the file named 'mbox.0001'
and so on.

2) split the file by time/date sent.  For ideas, refer to:

http://www.rosat.mpe-garching.mpg.de/mailing-lists/procmail/2001-12/msg00419
.html







_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail