Attached, is a Perl script, mdf2sa.pl, which converts spam messages
that have been marked up by MIMEDefang, into a form that is similar
to the message format used by SA.  Also attached is a simple
procmail script, mdf2sa.rc, which drives the perl script, and
can be invoked via formail as follows:

  formail -s procmail -m mdf2sa.rc < spam.mbox > new_spam.mbox

(the procmail script writes to a logfile named x.log).

The conversion could be made upon delivery to a spam mailbox
as follows:


:0 fbhw
* ^X-Spam-Score:
* ^X-Scanned-By: MIMEDefang
* B ?? ^Content-Type: text/plain; name=\"SpamAssassinReport\.txt\"
| perl $HOME/mdf2sa.pl

:0:
* ^X-Spam-Score:.*\(\*\*\*\*\*
spam-mail

disclaimer: the Perl script is only lightly tested. I'd appreciate hearing
any suggestions to improve the Perl coding style, or bug fixes/improvements.

PS: the code that removes a couple of Received headers when reconstructing
the message header is implmentation and needs to be tuned for your
installation.

Attachment: mdf2sa.pl
Description: Binary data

Attachment: mdf2sa.rc
Description: Binary data

Reply via email to