procmail
[Top] [All Lists]

Decoding inline base64; a working solution for you to trash. =)

2003-01-04 13:02:14
 Would anyone care to comment on this one, it was meant to be a quick hack late
last night, which is why I did the shell-switching instead of figuring out how
to "fix" it (not really broken, but...).

 Right now it will only check if the e-mail is multipart, if there's a
text-part and if there's a part that's base64; not perfect, but this one
shouldn't falsely hit often enough to be a major resource-waster.

SHELL=/bin/tcsh
:0bfw
* ^Content-Type: multipart/mixed;
* B ?? Content-Type: text/
* B ?? Content-Transfer-Encoding: base64
        | perl -ne 'if (/^Content-Transfer-Encoding: base64/) {\
                print "Content-Transfer-Encoding: binary\n";\
                while (<>) {print if /^$/;last if /^-/;push @b64, $_;}\
                print `echo "@b64" | base64 -d`; print "\n$_"} else {print}'
SHELL=/bin/sh


-- 
      /\___/\                                              /\___/\
      \_@ @_/                                              \_@ @_/
 +--oOO-(_)-OOo------------------------------------------oOO-(_)-OOo--+
 | Per scientiam ad libertatem! // Through knowledge towards freedom! |
 +---ôôô---ôôô--------------------------------------------ôôô---ôôô---+
     \O/   \O/      (c)1998-2003  tony(_at_)svanstrom(_dot_)com      \O/   \O/


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

<Prev in Thread] Current Thread [Next in Thread>