[Spambayes] It gets funnier all the time....

Skip Montanaro skip at pobox.com
Wed Feb 12 14:08:35 EST 2003


    Tim> Ya, I just discovered that too... so back to the original mail that
    Tim> started this whole thing.  Was that not base64?  - TimS

What about this?  No c-t-e header, so the base64 crap will come back
unchanged.  If the first "word" of the decoded payload is longer than 60
characters, feed to the base64 fixer-upper:

*** /tmp/skip/tokenizer.py.~1.4~        Wed Feb 12 14:06:51 2003
--- /tmp/skip/tokenizer.py      Wed Feb 12 14:06:51 2003
***************
*** 1331,1336 ****
--- 1331,1339 ----
              # Decode, or take it as-is if decoding fails.
              try:
                  text = part.get_payload(decode=True)
+                 if len(text.split()[0]) > 60:
+                     # just in case it's encoded but no c-t-e header was given
+                     text = try_to_repair_damaged_base64(text)
              except:
                  yield "control: couldn't decode"
                  text = part.get_payload(decode=False)

Skip



More information about the Spambayes mailing list