procmail
[Top] [All Lists]

Re: Match if "no other but base64 encoding"

2006-12-22 08:46:20
=- Bart Schaefer wrote on Thu 21.Dec'06 at 13:40:09 -0800 -=

{ Why look for text/plain? }

Because if there is no text/plain, it may be a valid binary data-
only mail. Might as well be spam, but haven't seen such a thing
yet. Other MIME (html) cases are caught elsewhere in the header.rc.

: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.

Thank you, this looks fine.
While analyzing why my original rule failed on "binary", I
discovered this

    :0 BH:
    * ^content-type:.*text/plain
    * ^content-transfer-encoding:
    * ! ^content-transfer-encoding: *([^ b]|b[^a]|ba[^s]|bas[^e])
    $BASE64

which let's "binary" pass but catches "base". I was just confused
by the logic of double negations involved.
Thanks for all ideas.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
Even if it seems insignificant, in fact EVERY effort counts
for a shared task, at least to show your deserving attitude.

____________________________________________________________
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