I have a Debian 10 server with posfix, amavis and spamassassin.
Another server managed by me sends every day a mail containing no content and only a gif as attachment. I have whitelisted the from address in the local.cf of spamassassin.
The header of the received mail contains the following:
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ~~~.~~~.net
X-Spam-Level:
X-Spam-Status: No, score=-93.2 required=5.0 tests=ALL_TRUSTED,BAYES_50,
DC_GIF_UNO_LARGO,DC_IMAGE_SPAM_TEXT,MISSING_HEADERS,PYZOR_CHECK,
SB_GIF_AND_NO_URIS,TVD_SPACE_RATIO,USER_IN_WHITELIST autolearn=no
autolearn_force=no version=3.4.2
which say that the mail is not considered spam because the from address is in the whitelist.
The problem is that the subject field contains [SPAM]
which is the spam marker. This spam marker is defined in my spamassassin local.cf and in amavis. I don’t know yet which one of the two is adding this spam marker.
According to the amavis configuration, it should not put the spam tag because I have this in the configuration
$sa_tag2_level_deflt = 5.0; #add spam tag to subject for score greater than this value
$sa_spam_subject_tag = '[SPAM]';
As we can see, the score is lower. amavis should not add this spam tag.
So how can I get a spam tag in the subject line ?
I’m sure the problem is in my mail server because when I send that message to another address I don’t get the spam tag.
Another strange thing is that when I send the exact same mail from my desktop with the same from address, it doesn’t get the spam tag.
EDIT: I have two other mails with inconsistent behavior of amavis.
With one mail I have this:
Received: from localhost by xxx.xxx.net
with SpamAssassin (version 3.4.2);
Wed, 11 Nov 2020 17:08:01 +0100
From: huixin0010 <huixin0010@126.com>
Subject: [*SPAM*] [~SPAM~]Re: Leather bags manufacturer with 14 years experience
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on xxx.xxx.net
X-Spam-Flag: YES
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.3 required=5.0 tests=BAYES_50,DEAR_SOMETHING,
FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,
HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,PYZOR_CHECK,
RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L5,RDNS_NONE,T_SPF_HELO_PERMERROR
autolearn=no autolearn_force=no version=3.4.2
where [*SPAM*]
is the spam tag added by spamassassin and [~SPAM~]
the spam tag added by amavis.
The rule is set for amavis to add a spam tag when the score is above 5.
What is unexpected is this other mail below where amavis did not add the spam tag in the subject even though the score is above 5.
Received: from localhost by xxx.xxx.net
with SpamAssassin (version 3.4.2);
Wed, 11 Nov 2020 18:08:24 +0100
From: liyulan029 <liyulan029@126.com>
To: xxx <xxx@xxx.net>
Subject: [*SPAM*] Re: new design eyeglasses frame and sunglasses
Date: Thu, 12 Nov 2020 01:10:33 +0800 (CST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on xxx.xxx.net
X-Spam-Flag: YES
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.2 required=5.0 tests=BAYES_50,DEAR_SOMETHING,
FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,
HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,RCVD_IN_RP_RNBL,
RDNS_NONE autolearn=no autolearn_force=no version=3.4.2
Nothing was changed on the server between these two mails.