PATCH to ignore uuencoded attachments
Matthias Andree
matthias.andree at gmx.de
Sat Nov 27 02:18:06 CET 2004
David Relson <relson at osagesoftware.com> writes:
> You're absolutely correct, the pattern needs to be anchored at both
> ends, perhaps:
>
> <TEXT>^begin\ 666\ [^ ]*$
>
> To allow exactly two spaces ...
666 is wrong, any octal number with 0 to 3 digits fits here.
>> A nul-length line, that is one matching the regexp ^[` ]$ also
>> ends the uuencoded part.
>
> <UUENCODE>\n$
Perhaps in addition, yes.
>> Microsoft also appears to accept uuencode if the mode is the empty
>> string, i. e. "begin filename" (with two blanks).
>>
>> > +<UUENCODED>{TOKEN} /* ignore tokens */
>> > +<UUENCODED>\${NUM}(\.{NUM})? /* ignore money */
>
> Evgeny's test case included token '$1' within the uuencoded text.
> As '$1' isn't matched by {TOKEN}, it wasn't being discarded.
> So _something_ extra is needed to discard it, and the money
> pattern fit the bill. Odd, eh?
Use this instead of the TOKEN and money stuff:
<UUENCODED>^[!-M][ -`]+ ; /* ignore */
<UUENCODED>^[ `]$ { BEGIN TEXT; }
Easier and faster.
--
Matthias Andree
More information about the bogofilter-dev
mailing list