Jim Popovitch <jimpop(_at_)yahoo(_dot_)com> writes:
I am trying to write a recipe that will strip out MIME encoded
attachments and then run a command. To be more specific, I want to
accept an anticipated email that has 3 zip file attachments. I want to
decode each and run a command to extract them. This will be used to
allow someone else to automatically update a website.
I had thought of just letting my .procmailrc decode the body of the
emailand then running a perl program to decode the individual zip files
but I would like to do it all with procmail if possible.
You'll definitely need to invoke outside help to do all this;
procmail is brilliant, but by itself it doesn't know how to decode
MIME and update a website with the result. It is really good at
cooperating with other programs, however, so it'll seem as though
procmail is doing the work. :)
Assuming you've absorbed the procmailrc man page, study the examples
in the procmailex man page, and seek out examples from gurus who
make them freely available (is aks still on line?) I'd expect the
procmail archives, wherever they are now, to have a wealth of good
The general strategy will be something like:
* <recipes to recognize the anticipated mail>
| <some outside command to mess with the mail body>
| <another such command>
| <final command to update the website>
I always use the "w" flag on filters, and often you need the "i"
flag to prevent procmail from quitting after a harmless error
such as a shell command not accepting the mail on its stdin
when it's not in the nature of the shell command to do so, but
it's in procmail's nature to pass the mail to stdin anyway.
procmail mailing list