On 9/21/2016 9:48 AM, Thomas Barth wrote:

Am 20.09.2016 um 13:12 schrieb Paul Stead:

Hi Thomas,

The RelayCountry plugin would answer your needs:


Hello Paul,

I ve activated that Plugin and installed the geoip modul (aptitude install libgeo-ip-perl), seems to work. I ve tested it with my own address. I ve also reduced the score for MESSAGEID_LOCAL because I ve found a past mail of one of our partners with .local in the message-id :)

X-Spam-Status: No, score=3.004 tagged_above=2 required=6.31
    RP_MATCHES_RCVD=-3.096, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
    autolearn=no autolearn_force=no


You all say that bayes is not working in my setup. I dont know why. I followed a documentation for setting up my mailserver.

It says:

nano /etc/spamassassin/local.cf

use_bayes 1
use_bayes_rules 1
bayes_auto_learn 1

It s a virtual user mailsystem described in https://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-ubuntu-14.04-lts-p3

We say bayes is not working because there are not any BAYES_XX rules hitting in the headers you are providing. When bayes is working, you should see a bayes rule hit on almost every email.

Most likely, it has not yet learned from the 200 ham and 200 spam required for it to start scoring. To check this, login as the "amavis" user (or whatever user Amavis is running as) and type the command "sa-learn --dump magic". Take a look at the nham and nspam lines. If they are not at least 200, then bayes needs to learn from more emails. You can either wait for the autolearn process to do it, or (preferably) manually learn from some hand-sorted emails.

In any case, you should set up a process for bayes to learn from misclassified emails. In my case, spam is delivered to a "spam" folder. Once or twice a day, I will scan through the subject lines and sender names that folder to make sure it is all really spam. Any ham that gets there is copied to a "ham-checked" folder and the rest is moved to a "spam-checked" folder. Any spam that gets delivered to my inbox goes to "spam-checked" as well. Occasionally, I'll grab a selection of good mail from my inbox and copy it to "ham-checked" to provide some extra ham for bayes to learn from. I have a script that looks for emails in those folders every couple of hours and runs sa-learn on them if there is anything there. After learning from the messages, you can either delete them or move them to a storage location. If you keep a selection of hand-sorted ham and spam, then you can use that later to re-create the bayes database if it gets messed up.

Also, as others have mentioned, you are being blocked by URIBL. This is probably because you are forwarding your DNS to your ISP. You should set up a non-forwarding DNS server for your mail system to use. Personally, I prefer Bind. It should do what you need by default with very minimal (if any) configuration. You will need to set up your /etc/resolv.conf file to make the server use the local name server.


Reply via email to