[Mimedefang] Spamassassin and headers

Stephen Loeckle stephen at lucidnetworks.net
Wed May 5 11:14:56 EDT 2004


I have and I hope this is what you're talking about. Here's my spam code
snippet. You'll notice at the bottom, I add those two items to mail that
isn't tagged as spam:

   if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 100*1024) {
            my($hits, $req, $names, $report) = spam_assassin_check();
            my($score);
            if ($hits < 40) {
                $score = "*" x int($hits);
            } else {
                $score = "*" x 40;
            }
            if ($hits >= $req) {
                action_change_header("Subject", "***SPAM*** ($hits):
$Subject");
                action_change_header("X-Spam-Score", "$hits ($score)
$names");
                action_change_header("X-Spam-Level", "$score");
                md_graphdefang_log('spam', $hits, $RelayAddr);
                my $container = MIME::Entity->build(
                        Type => 'message/rfc882',
                        Data => [ "" ]
                );
                my $parser = new MIME::Parser;
                open(IN, '< ./INPUTMSG');
                my $originalMsg = $parser->parse(\*IN);
                close(IN);
                $container->add_part($originalMsg);
                my $reportPart = MIME::Entity->build(
                        Type => 'text/plain',
                        Data => [ $report ]
                );
                $entity->parts([$reportPart]);
                $entity->head->mime_attr('content-type' =>
'multipart/mixed');
                $entity->head->mime_attr('content-type.boundry' =>
"----------=_".scalar(time)."-$$-20862148201");
                $entity->add_part($container);
                action_rebuild();
             }
             else
             {
                action_add_header("X-Spam-Score", "$hits $names");
                action_add_header("X-Spam-Level", "$score");
             }

-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Ville
Jorma
Sent: Wednesday, May 05, 2004 9:45 AM
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] Spamassassin and headers


Hi,


I'd like to get MIMEDefang to add a header to all scanned mail
indicating
the Spamassassin tests used and the scores returned.
Has anyone done this?


Regards,

Ville Jorma

_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang





More information about the MIMEDefang mailing list