procmail
[Top] [All Lists]

Re: breaking inbox into seperate messages

2000-08-09 05:48:06
On Wed, 09 Aug 2000 07:19:43 -0400 (EDT), Marshal Benton
<post_bote(_at_)post(_dot_)com> wrote:
==>MB| Can formail break the inbox into seperate messages?
==>MB| If so, what is the command line?
I found the -s option before posting. I read the man page.
Please, No RTFM, ARBD (AlReady Been Done).
Now, what follows -s?
I tried
format -s cat > '$FILENO' < inbox
AND
format -s cat > $FILENO < inbox
I got a file called $FILENO with the same
contents (one file with all the messages).

You are redirecting the output of formail. Formail calls up a
subprocess which prints to standard output; all this standard output
is being catenated back into one file by your use of redirection.

One fairly simple way to accomplish what you want is to write a small
shell script which saves to a file named after the value of FILENO,
and pass the path name of that as the argument to -s. Another is to
start Procmail with a simple rcfile, something like this:

SHELL=/bin/sh  # always always always
:0
./
:0
oops

This will deliver each message into a new file, numbered starting with
the lowest available number; so if you happen to have a file called
./20001, you will get the messages in ./20002, ./20003, etc.

(In very concrete terms, if the above script is in ./split.rc, you
would say

  formail -s procmail -m ./split.rc <inbox

You might want to turn on logging to see what's going on, too. I leave
that as an exercise. :-)

Actually it would be a good idea to set UMASK and LOGABSTRACT and
maybe also PATH if you want to call up external scripts, in addition
to SHELL. (LOGABSTRACT=yes with no LOGFILE= causes the log to be
written to standard error.)

Hope this helps,

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

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

<Prev in Thread] Current Thread [Next in Thread>