[Mimedefang] feed MimeDefanged mail to sa-learn?

Gary Funck gary at intrepid.com
Mon Jan 3 11:54:44 EST 2005


(cross-posted from the SA list. I'd developed this as an interim
method for normalizing the spam message formats. - Gary)

-----Original Message-----
From: Gary Funck [mailto:gary at intrepid.com]
Sent: Monday, January 03, 2005 1:52 AM

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdf2sa.pl
Type: application/octet-stream
Size: 4642 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20050103/36050ebb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdf2sa.rc
Type: application/octet-stream
Size: 239 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20050103/36050ebb/attachment-0001.obj>


More information about the MIMEDefang mailing list