Page 1 of 1

White Listing Local Addresses

Posted: 2017-10-30 20:53
by sergiortc
I have hMailServer and Smapassasin installed in a Windows 2012 R2 Server.

I am trying to white list some local addresses so they don't get email blocked.

I modified local.cf file under C:\Program Files\JAM Software\SpamAssassin for Windows\etc\spamassassin to add the addresses.
So I have something like this:

report_safe 0
all_spam_to A1@localdomain.com
all_spam_to A2@localdomain.com
all_spam_to A3@localdomain.com

After modifying the local.cf file as showed, I stopped and restarted the service using
net stop spamassasin and net start smapassasin

Nevertheless, the addresses are still getting spam email blocked.

Can you help me?

Thanks

Re: White Listing Local Addresses

Posted: 2017-10-30 21:39
by jimimaseye
Normally white list FROM addresses.

To whitelist in spamassassin you use whitelist_from https://wiki.apache.org/spamassassin/ManualWhitelist

Or whitelist_to if you need to.

Or you can white list in hmailserver to stop mail being passed to spamassassin in the first place. https://www.hmailserver.com/documentati ... itelisting

However be aware that AUTHENTICATED senders will not have their emails checked and therefore do not need whitelisting.

Re: White Listing Local Addresses

Posted: 2017-10-31 00:09
by mattg
Yep all_spam_to is something completely different

all_spam_to I use for an account that I don't want any incoming mail spam scored by SpamAssassin.
Eg I have an account that I use for competitions, promo@example.com

I still want the messages that come to this account, and I want all of the newsletters and coupon vouchers that are sent there, I just don't want to read them.

I set
all_spam_to promo@example.com.au in my .cf file

If I'm looking for a pizza voucher, I open that account and search for 'pizza'

Re: White Listing Local Addresses

Posted: 2017-10-31 01:32
by sergiortc
Thank you jimimaseye and mattg,

Excuse me if I don't understand you completely. English is not my native tongue.

What I want is all email sent to a specific account, let's say me@me.com, to reach this specific account. I don't want spamassasin to score any email sent to this specific email address.

I understand that to achieve that goal, I have to add, in spamassasin local.cf file the line

all_spam_to me@me.com

So I did that and then stopped - restarted spamassasin.

I have a rule in hMailServer that applies to all email with a spamassasin score equal or greater to 5. My rule forwards those emails to a spamctach account.

When I check that account, I see that spam email addressed to me@me.com is still being forwarded to my spamctach account.

To tell the truth, I haven't checked if me@me.com received the emails (my rule, besides forwarding the spam email, deletes the original, so the intended recipient does not get it).

But my understanding is that, if I use this "all_spam_to me@me.com", me@me.com should not have any email sent to it evaluated by spamassasin. Am I right?

Re: White Listing Local Addresses

Posted: 2017-10-31 02:46
by mattg
sergiortc wrote:But my understanding is that, if I use this "all_spam_to me@me.com", me@me.com should not have any email sent to it evaluated by spamassasin. Am I right?
Correct

However the message may have been scored higher than 5 by other hMailserver AntiSPAM checks (DKIM, DNSBL, HOST test, SPF test, SURBL etc) - depending on your settings

The way that I get around that, is to set SpamAssassin's mark score at negative 500 by adding this to the .cf
required_score -500.0

And then in hMailserver I set hMailserver to use the SpamAssassin score.

If hmailserver scores a message as 12, but SpamAssassin scores at -100 (100 is deducted from SpamAssassin scores for all_mail_to addresses),
Then the final spam score is -88


Another word of advice, don't use the default local.cf, create a new .cf file
I've seen (not on the JAM version though) the local.cf get overwritten during version update of SpamAssassin

Re: White Listing Local Addresses

Posted: 2017-10-31 10:04
by jimimaseye
mattg wrote: Another word of advice, don't use the default local.cf, create a new .cf file
I've seen (not on the JAM version though) the local.cf get overwritten during version update of SpamAssassin
Its ok with the Jam version. I used (and moddied) the default local.cf and have upgraded since and it remained untouched. So safe to use.

(But cant vouch for any Linux versions, as matt implies).

Re: White Listing Local Addresses

Posted: 2017-11-01 18:54
by sergiortc
jimimaseye and mattg,

I must be doing something wrong. I believe all emails sent to my all_spam_to email addresses, are still being scored by SpamAssasin.
Maybe you remember I am writing an application to process spam email and store some data from them in a SQL Server database.
If I query my database, I can see the emails sent to one of the email addresses I added as all_spam_to in my local.cf is still being processed by Spamassasin. For example, here you have the last 10 spam emails sent to a given address, let's call it me@me.com:

Code: Select all

SpamAssasin Score	hMailServer Score	Total  Score	Date Time Received
12							6						18				11/1/2017 10:17
10							3						13				11/1/2017 10:10
11							0						11				11/1/2017 9:57
12							3						15				11/1/2017 9:27
7							6						13				11/1/2017 9:20
15							3						18				11/1/2017 9:15
7							3						10				11/1/2017 9:01
8							3						11				11/1/2017 8:49
14							3						17				11/1/2017 8:43
7							3						10				11/1/2017 8:18
As you can see al 10 emails have a Spamassasin score and the third one has an hmailserver score of 0.
And I have a line in my local.cf that says all_spam_to me@me.com
?

Re: White Listing Local Addresses

Posted: 2017-11-01 19:37
by jimimaseye
https://wiki.apache.org/spamassassin/AllSpamToFiltering

Check your understanding is correct and that your conditions match what the feature requires to work.

In particular:
However, the mechanism only works if the given email address appears in the TO: or CC: lines of the email itself. It does not examine the delivery envelope, since the MTA generally does not expose this data in the message.
More info: https://spamassassin.apache.org/full/3. ... _Conf.html

Re: White Listing Local Addresses

Posted: 2017-11-02 17:29
by sergiortc
Thank you jimimaseye and mattg,

I found the problem (at least I think so).

I was not really restarting spamassasin, since this action needs elevated permissions.

I have a .bat program to update SpamAssasin rules and I was running it as a user. The program stops-updates-starts Spamassasin.

I saw the error message about not stopping Spamassasin service and ran it as administrator.

Ever since I did that (yesterday noon), the all_spam_to directives are being followed.

Thank you again and have a nice day.