procmail
[Top] [All Lists]

Re: questions/answers

1999-05-31 19:37:21
"Eugene Lee" <eugeneeugenelee(_at_)hotmail(_dot_)com> writes:
I am having real difficulty trying to figure out how to seperate an 
attachment from an email using procmail.  I am trying to seperate the 
attachment, create a new folder for each new attachment and place the 
attachment into it.  As for the name of the folder will be the same name as 
the attachment name.

Parsing MIME is too complicated to do in procmail alone (well, it can
be done, but it would take forever to write, forever to run, and be
impossible to debug).  I would suggest that you feed the message into a
program designed to deal with MIME, either written in C, say,
mhn/mhstore from the MH/nmh mailsuite, or a custom written script in
some scripting language like Perl or Python, probably based on the
appropriate languages MIME libraries (for example, for Perl, the
MIME-tools module suite).  Each choice has its pros and cons:
mhn/mhstore doesn't read stdin and requires your account be at least
partially configured for MH (even if you don't use it normally), but it
should be fast and relatively memory efficient (though I haven't
actually looked at its source).  A custom script on the other hand can
do whatever you want, albeit more slowly, but you also have to write
it, a highly non-trivial factor.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • Re: questions/answers, Philip Guenther <=