procmail
[Top] [All Lists]

Re: Match if "no other but base64 encoding"

2006-12-21 14:57:25
On 12/21/06, Bart Schaefer <barton(_dot_)schaefer(_at_)gmail(_dot_)com> wrote:
:0B
* H ?? ^Content-Type: *multipart
* ^Content-Type: *text */ *plain
* 1^1 ^Content-Transfer-Encoding: *base64
* -1^1 ^Content-Type:
{}
:0E:
$BASE64

This says to add one to the score for every base64 c-t-e, then
subtract one for every content-type.  If the resulting score is
positive, then at least one part did NOT have base64 encoding, so do
nothing (the empty braces).  Else, deliver to $BASE64.

Waitaminute, I confused myself there.  If the score is zero, then
every part has base64, but if the score is negative then some part
does not, so the else is backwards in that case.  What I meant to
write was this:

:0B
* H ?? ^Content-Type: *multipart
* 1^0 ^Content-Type: *text */ *plain
* 1^1 ^Content-Transfer-Encoding: *base64
* -1^1 ^Content-Type:
$BASE64

Add one for text/plain, add one for every base64, subtract one for
every content-type.  If the score remains positive, all the body parts
are base64.  If the score is zero, exactly one body part is not
base64, but that's enough.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail