procmail
[Top] [All Lists]

Re: file name of attachment after line break

2001-09-05 12:08:24
On Wed, 5 Sep 2001, David W. Tamkin wrote:

 :0B # slow regexp there's no other way

I think you can speed it up with something like:

:0
* ^Content-Type:.*\<multipart\>.*\<boundary="\/[^"]*
{
 BOUND="$MATCH"

 :0B
 *$ ^--$\BOUND$(.+$)?Content-(Type|Disposition):(.|$[    
])*\.(list|of|bad|ex|ten|sions)
 action
}

The brackets still enclose a space and a tab.

The remaining problem with this is that it works only for the first bad
extension encountered.  I think that's OK in this case, but if the intent
is to do something with each such attachment, you have to resort to an
external program.

(Aside:  It's too bad "formail -dcs" can't be told what string to split
the digest upon.  If it could be told to treat the MIME boundary string as
the message separator (and preserve it as such in the output), then
passing the body of the message once through formail could unfold all the
embedded Content- fields or be used to invoke procmail on each attachment
separately.)

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail