procmail
[Top] [All Lists]

Re: filtering more than one attachment !

2002-07-17 13:38:49
On 17 Jul, Leandro Rodrigo Saad Cruz wrote:
| Hi all.
| I wrote a message filter that is invoked by procmail wit ha recipe the
| resembles :
| 
| :0 HB f w
| *filename*=? *.*\.\/(list of file extensions goes here)
|| filter.pl $MATCH
| 
| This fails to filter a second attachment ( a third , etc, etc ).
| Is there anyway to tell procmail to keep searching a RE inside my
| message and pass all matches to my filter ??

Without knowing a little more about what you're doing, you might have
two choices. You could rewrite filter.pl to just know which filename
extensions are to be filtered, rather than requiring the extension to
be passed. Since you're feeding the whole message anyway, that would
probably be the most efficient. Otherwise, you would probably need to
recurse the procmail rcfile for each matching filename. With this
solution you'd be passing the whole message to filter.pl once for each
matching attachment, making it less than optimal.

I suspect you're removing or disabling the specific attachments. If not,
and you're decoding them (and depending on how that's accomplished), you
could use a recursive rcfile to process each attachment while still only
feeding the entire message to the pipe one time.  If that's what you're
interested in, I can post an rcfile that uses metamail to do that.  It
decodes the attachments, then "finds" each one of them in turn for
further processing and forwarding. There are undoubtedly examples in
the list archives to so the same.

I suppose it could also be easily adapted to find the attachments one at
a time and pass them to your filter.pl script. But as explained above, I
don't think that's a real good solution.
 
-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


_______________________________________________
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>