You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Dieter Scholz <rd...@gmx.net> on 2015/06/17 17:19:43 UTC
SA bayes filter learns ham but no spam
Hello,
I have a new mail setup using Debian Jessie with postfix, amavisd-new,
amavisd-milter and spamassassin. I use the versions from the Jessie
repository. My setup does pre-queue filtering, so Spamassassin does the
checks while the mail is not finally queued. Postfix calls Amavis
through the milter interface.
My problem is: The bayes filter does (auto-)learn ham mails but no spam
mails. In my logs I found spam mails that have a very high score and
should be autolearned. I think my bayes setup is correct, because ham
mails are learned as expected.
What could be the problem? Are spam mails not learned because of the
pre-queue setup? What information do you need for helping me? Any ideas?
Thanks in advance.
Dieter
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
Hello
> you need to find out how these values are set
>
> * bayes_auto_learn_threshold_nonspam -0.001
> * bayes_auto_learn_threshold_spam 9.0
>
>
I have set these lines today. Do these differ from the default values?
Dieter
Re: SA bayes filter learns ham but no spam
Posted by Reindl Harald <h....@thelounge.net>.
Am 17.06.2015 um 17:44 schrieb Dieter Scholz:
>> I have a new mail setup using Debian Jessie with postfix, amavisd-new,
>> amavisd-milter and spamassassin. I use the versions from the Jessie
>> repository. My setup does pre-queue filtering, so Spamassassin does
>> the checks while the mail is not finally queued. Postfix calls Amavis
>> through the milter interface.
>>
>> My problem is: The bayes filter does (auto-)learn ham mails but no
>> spam mails. In my logs I found spam mails that have a very high score
>> and should be autolearned. I think my bayes setup is correct, because
>> ham mails are learned as expected.
>>
>> What could be the problem? Are spam mails not learned because of the
>> pre-queue setup? What information do you need for helping me? Any ideas?
>
> An additional note:
>
> The ham case looks like:
>
> spam-tag, <XXX> -> <YYY>,<ZZZ>, No, score=-0.578 tagged_above=-99
> required=5 tests=[HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.58,
> URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
you need to find out how these values are set
* bayes_auto_learn_threshold_nonspam -0.001
* bayes_auto_learn_threshold_spam 9.0
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
> Hello,
>
> I have a new mail setup using Debian Jessie with postfix, amavisd-new,
> amavisd-milter and spamassassin. I use the versions from the Jessie
> repository. My setup does pre-queue filtering, so Spamassassin does
> the checks while the mail is not finally queued. Postfix calls Amavis
> through the milter interface.
>
> My problem is: The bayes filter does (auto-)learn ham mails but no
> spam mails. In my logs I found spam mails that have a very high score
> and should be autolearned. I think my bayes setup is correct, because
> ham mails are learned as expected.
>
> What could be the problem? Are spam mails not learned because of the
> pre-queue setup? What information do you need for helping me? Any ideas?
>
> Thanks in advance.
>
> Dieter
An additional note:
The ham case looks like:
spam-tag, <XXX> -> <YYY>,<ZZZ>, No, score=-0.578 tagged_above=-99
required=5 tests=[HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.58,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
In the spam case the log looks like:
(17883-05) Blocked SPAM {RejectedInbound}, AM.PDP-SOCK [0.0.0.0]
[0.0.0.0] <XXX> -> <YYY>, Queue-ID: 20752C016A, Message-ID:
<ab...@...>, mail_id: y_cXqKD1UkJx, Hits:
12.181, size: 3530, 5625 ms
20752C016A: milter-reject: END-OF-MESSAGE from XXX[0.0.0.0]: 5.7.0
Reject, id=17883-05 - spam; from=<XXX> to=<YYY> proto=ESMTP helo=<ZZZ>
disconnect from ZZZ[0.0.0.0]
So there is no autolearn information. Does the milter block disturb the
learning? Is there a workaround?
Dieter
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
Hello,
>>> Attached you find the output of the sa-learn execution. The nine
>>> spam E-Mails learned are there because I manually learned a mbox
>>> file with spam. As you can see the ham part seems to work.
>>>
>> is there anyone who could help me on this or anyone who has the same
>> problem?
>>
>> Or is it better to ask on the amavis group because SA is called from
>> the amavis process?
>
> Probably, I've not heard of this happening with spamd.
>
> Autolearning is done as a side effect of scanning, so if it's
> working on ham, it should work on spam. It's hard to see how the
> calling code could discriminate. What I'm wondering is if something is
> removing all the high scoring spam before SA can auto-learn it.
>
> I don't use amavis, so perhaps it's normal for there to be such a big
> difference in the SA logging of rejected mail and other mail, but is
> it possible that it's [mis]configured to send mail through SA twice?
I just found a configuration option in amavis $sa_dsn_cutoff_level which
was set to 10 in the Debian default config. I think this ia a possible
candidate for my problems. I changed this to 99.
I will give feedback on this.
Dieter
Re: SA bayes filter learns ham but no spam
Posted by RW <rw...@googlemail.com>.
On Sat, 20 Jun 2015 14:41:36 +0200
Dieter Scholz wrote:
> > Attached you find the output of the sa-learn execution. The nine
> > spam E-Mails learned are there because I manually learned a mbox
> > file with spam. As you can see the ham part seems to work.
> >
> is there anyone who could help me on this or anyone who has the same
> problem?
>
> Or is it better to ask on the amavis group because SA is called from
> the amavis process?
Probably, I've not heard of this happening with spamd.
Autolearning is done as a side effect of scanning, so if it's
working on ham, it should work on spam. It's hard to see how the
calling code could discriminate. What I'm wondering is if something is
removing all the high scoring spam before SA can auto-learn it.
I don't use amavis, so perhaps it's normal for there to be such a big
difference in the SA logging of rejected mail and other mail, but is
it possible that it's [mis]configured to send mail through SA twice?
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
Hello,
>
>>>
>>>>> My problem is: The bayes filter does (auto-)learn ham mails but no
>>>>> spam mails. In my logs I found spam mails that have a very high score
>>>>> and should be autolearned. I think my bayes setup is correct, because
>>>>> ham mails are learned as expected.
>>>> Autolearning is based on a different score to the one used for
>>>> classification. It uses the rule scores that would be used if Bayes
>>>> were disabled and ignores some type of rule altogether. For spam you
>>>> need 3 points from *both* the headers and the body.
>>>>
>>>> It probably is working correctly, as far as I can tell you haven't
>>>> actually established that no spam is being autolearned.
>>> Ok, there's a different score - I understand. But what worries me is,
>>> that I found mails in the log with a really high spam score and lots of
>>> rule matches. For all the (SA) marked spam mails I do not get a line in
>>> the logs with 'autolearn=no' as is the case for all ham mails. My mail
>>> server is now running for a week with hundreds of ham mails in the
>>> filter but no spams. It's a company server with 300 users and a long
>>> established MX record. So for me it is hard to imagine that there is no
>>> spam mail suitable for filter learning.
>>>
>>> I suspect the milter style of integration reject leads to a
>>> situation in
>>> which the spam learning part is suppressed. So there's no message about
>>> the mail being learned or not in the logs.
>>>
>>> What do you think? Any chance to debug this?
>>>
>>> Dieter
>>
>> As far as I can see, you don't really know whether your setup is
>> actually learning spam or not. The logs just don't mention anything
>> useful about spam email. Could you check the bayes stats so we actually
>> know if there is a problem?
>>
>> Please show us output of "sa-learn --dump magic", probably ran as the
>> user amavisd user.
>>
>> Regards,
>> Tom
>
> Attached you find the output of the sa-learn execution. The nine spam
> E-Mails learned are there because I manually learned a mbox file with
> spam. As you can see the ham part seems to work.
>
Hello,
is there anyone who could help me on this or anyone who has the same
problem?
Or is it better to ask on the amavis group because SA is called from the
amavis process?
Thanks.
Dieter
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
Hello,
>> Hello,
>>
>>>> My problem is: The bayes filter does (auto-)learn ham mails but no
>>>> spam mails. In my logs I found spam mails that have a very high score
>>>> and should be autolearned. I think my bayes setup is correct, because
>>>> ham mails are learned as expected.
>>> Autolearning is based on a different score to the one used for
>>> classification. It uses the rule scores that would be used if Bayes
>>> were disabled and ignores some type of rule altogether. For spam you
>>> need 3 points from *both* the headers and the body.
>>>
>>> It probably is working correctly, as far as I can tell you haven't
>>> actually established that no spam is being autolearned.
>> Ok, there's a different score - I understand. But what worries me is,
>> that I found mails in the log with a really high spam score and lots of
>> rule matches. For all the (SA) marked spam mails I do not get a line in
>> the logs with 'autolearn=no' as is the case for all ham mails. My mail
>> server is now running for a week with hundreds of ham mails in the
>> filter but no spams. It's a company server with 300 users and a long
>> established MX record. So for me it is hard to imagine that there is no
>> spam mail suitable for filter learning.
>>
>> I suspect the milter style of integration reject leads to a situation in
>> which the spam learning part is suppressed. So there's no message about
>> the mail being learned or not in the logs.
>>
>> What do you think? Any chance to debug this?
>>
>> Dieter
>
> As far as I can see, you don't really know whether your setup is
> actually learning spam or not. The logs just don't mention anything
> useful about spam email. Could you check the bayes stats so we actually
> know if there is a problem?
>
> Please show us output of "sa-learn --dump magic", probably ran as the
> user amavisd user.
>
> Regards,
> Tom
Attached you find the output of the sa-learn execution. The nine spam
E-Mails learned are there because I manually learned a mbox file with
spam. As you can see the ham part seems to work.
Dieter
Re: SA bayes filter learns ham but no spam
Posted by Tom Hendrikx <to...@whyscream.net>.
On 17-06-15 20:00, Dieter Scholz wrote:
> Hello,
>
>>> My problem is: The bayes filter does (auto-)learn ham mails but no
>>> spam mails. In my logs I found spam mails that have a very high score
>>> and should be autolearned. I think my bayes setup is correct, because
>>> ham mails are learned as expected.
>> Autolearning is based on a different score to the one used for
>> classification. It uses the rule scores that would be used if Bayes
>> were disabled and ignores some type of rule altogether. For spam you
>> need 3 points from *both* the headers and the body.
>>
>> It probably is working correctly, as far as I can tell you haven't
>> actually established that no spam is being autolearned.
>
> Ok, there's a different score - I understand. But what worries me is,
> that I found mails in the log with a really high spam score and lots of
> rule matches. For all the (SA) marked spam mails I do not get a line in
> the logs with 'autolearn=no' as is the case for all ham mails. My mail
> server is now running for a week with hundreds of ham mails in the
> filter but no spams. It's a company server with 300 users and a long
> established MX record. So for me it is hard to imagine that there is no
> spam mail suitable for filter learning.
>
> I suspect the milter style of integration reject leads to a situation in
> which the spam learning part is suppressed. So there's no message about
> the mail being learned or not in the logs.
>
> What do you think? Any chance to debug this?
>
> Dieter
As far as I can see, you don't really know whether your setup is
actually learning spam or not. The logs just don't mention anything
useful about spam email. Could you check the bayes stats so we actually
know if there is a problem?
Please show us output of "sa-learn --dump magic", probably ran as the
user amavisd user.
Regards,
Tom
Re: SA bayes filter learns ham but no spam
Posted by Dieter Scholz <rd...@gmx.net>.
Hello,
>> My problem is: The bayes filter does (auto-)learn ham mails but no
>> spam mails. In my logs I found spam mails that have a very high score
>> and should be autolearned. I think my bayes setup is correct, because
>> ham mails are learned as expected.
> Autolearning is based on a different score to the one used for
> classification. It uses the rule scores that would be used if Bayes
> were disabled and ignores some type of rule altogether. For spam you
> need 3 points from *both* the headers and the body.
>
> It probably is working correctly, as far as I can tell you haven't
> actually established that no spam is being autolearned.
Ok, there's a different score - I understand. But what worries me is,
that I found mails in the log with a really high spam score and lots of
rule matches. For all the (SA) marked spam mails I do not get a line in
the logs with 'autolearn=no' as is the case for all ham mails. My mail
server is now running for a week with hundreds of ham mails in the
filter but no spams. It's a company server with 300 users and a long
established MX record. So for me it is hard to imagine that there is no
spam mail suitable for filter learning.
I suspect the milter style of integration reject leads to a situation in
which the spam learning part is suppressed. So there's no message about
the mail being learned or not in the logs.
What do you think? Any chance to debug this?
Dieter
Re: SA bayes filter learns ham but no spam
Posted by RW <rw...@googlemail.com>.
On Wed, 17 Jun 2015 17:19:43 +0200
Dieter Scholz wrote:
> My problem is: The bayes filter does (auto-)learn ham mails but no
> spam mails. In my logs I found spam mails that have a very high score
> and should be autolearned. I think my bayes setup is correct, because
> ham mails are learned as expected.
Autolearning is based on a different score to the one used for
classification. It uses the rule scores that would be used if Bayes
were disabled and ignores some type of rule altogether. For spam you
need 3 points from *both* the headers and the body.
It probably is working correctly, as far as I can tell you haven't
actually established that no spam is being autolearned.