procmail
[Top] [All Lists]

Multiple commands on split

1996-07-28 14:56:31
Maybe the heat has melted my brain, but I can't seem to get formail
to perform a series of commands on each mail that it's split from
a folder. Here's an example of a simple debugging attempt:

formail -s addr=`formail -X From: | formail -r | formail -zx To`;\
    echo "$addr" >>output

I've tried parentheses, putting the commands into a shell function,
and other flailings too numerous to remember, all to naught.

Could someone please explain how this can be done?

FWIW, the goal of this little effort is to extract the From: address
from a SmartList envelope and send each such address a form note.

formail -s formail -X From:

produces all the From: lines in the collected mails, while adding the
pipes shown above reduces the output to only the first address, as
though the pipe is being fed the collection of addresses in one clump
and formail -r is simply grabbing the first as the return addr.

Hope the above is not too muddled...
jimo(_at_)eskimo(_dot_)com

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