procmail
[Top] [All Lists]

Re: file name of attachment after line break

2001-09-05 16:27:10
On Wed, 5 Sep 2001, Philip Guenther wrote:

Bart Schaefer <schaefer(_at_)zanshin(_dot_)com> writes:
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:

While it'll be more _accurate_, I'm not convinced it'll actually be
_faster_.

It should be faster because the "^--" will fail immediately on most lines
in the body, so the rest of the complicated regex never has to be tried.

If the boundary string is quoted, there may be backslashes protecting
special characters that need to be removed before you can match with it.

Technically this is true.  In practice, boundary strings are nearly always
quoted but almost never contain any special characters.

You could drop the accuracy and retain the speed with just:

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

The '(.+$)?' should be '(.+$)*'.

Oops, yes.

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