procmail
[Top] [All Lists]

Re: Need help in writing a MIME handling recipe

2001-05-06 16:23:52
Thanks Jim.  I did try and get some stuff from aks yesterday, but I
couldn't connect to that server.  I'll continue as you suggested.  One
question, (not really procmail specific) can mmdecode or metamail
extract multiple MIME components from a file?

Thanks again,

-Jim P.
 

--- Jim Osborn <jimo(_at_)eskimo(_dot_)com> wrote:
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
examples.

The general strategy will be something like:

:0
* <recipes to recognize the anticipated mail>
{
      :0 c:
      debug-backup-file

      :0 fwib
      | <some outside command to mess with the mail body>
      :0 fwib
      | <another such command>
      ...
      
      :0
      | <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.

Good luck,

Jim


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
_______________________________________________
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>