[Mimedefang] SA-Bayes not working..

Richard J. Kieran Rkieran at rhnet.org
Wed Jun 25 13:01:50 EDT 2008

Tomasz Ostrowski <tometzky at batory.org.pl> writes:
>On 2008-06-25 14:46, Richard J. Kieran wrote:
>> Tomasz Ostrowski <tometzky at batory.org.pl> writes:
>>> How did you save and restore a Bayes database?
>> I did it the same way you did.
>Looks good. Slightly strange location of bayes database and insecure
>permissions of it, but this should not brake it.
>Try this:
># su -s /bin/bash - defang
>$ spamassassin -D -p /etc/mail/sa-mimedefang.cf -t \
>  < /usr/share/doc/spamassassin-*/sample-spam.txt 2>&1 | grep -i bayes
Content analysis details:   (997.4 points, 4.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
1000 GTUBE                  BODY: Generic Test for Unsolicited Bulk Email
-2.6 BAYES_00               BODY: Bayesian spam probability is 0 to 1%
                            [score: 0.0052]
-0.0 NO_RECEIVED            Informational: message has no Received headers
Looks like Bayes worked. However, when sending it from another email server to this one, the tests are:
X-Spam-Hits: -201.002
No sign of Bayes. It's not because I'm a whitelisted recipient, is it?
>Also show us a fragment of your /etc/mail/mimedefang-filter where it is
>running spamassassin. This starts with
>	if ($Features{"SpamAssassin"}
 if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 405*1024) {
            # Only scan messages smaller than 405kB.  Larger messages
            # are extremely unlikely to be spam, and SpamAssassin is
            # dreadfully slow on very large messages.
            my($hits, $req, $names, $report) = spam_assassin_check();
            action_change_header("X-Spam-Tests", "$names");
            action_change_header("X-Spam-Hits", "$hits");

          if ($hits >= $req) {
                md_graphdefang_log('is_spam', "$hits/$req\[$names\]", $RelayAddr);
 # This is the part that bounces the SPAM:
                if(@Recipients == 1) {
                        my($newrecipient)= $Recipients[0];
                        $newrecipient =~ s/\@/-nsdlvb\@/;
                        $bouncemsg="Your message was rejected as spam by our spamfilter. Please resend to ".$newrecipient.". Do not use this as a permanent address. It will change on the first of every month.";
                } else {
                        $bouncemsg="Your message was rejected as spam by our spamfilter. For assistance email help\@rhnet.org.";

                #Quarantine the spam if the score is not astronomical, then reject it.
                if ($hits <= 7.5) {
                        action_quarantine_entire_message("Spam quarantined by hoover.rhnet.org");


            } else {
                md_graphdefang_log('not_spam', "$hits/$req\[$names\]", $RelayAddr);
    # send_quarantine_notifications();

More information about the MIMEDefang mailing list