Test scores in log and mail headers reported without recalculation
Recently I updated my Amavis server and added Rspamd to the mix. Later I noticed that some email messages received total score that is lower than sum of all tests - as an example:
X-Spam-Status: No, score=-0.499 tagged_above=-999 required=4 tests=[
DKIMWL_WL_MED=-0.001,
DKIM_SIGNED=0.1,
DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1,
HTML_MESSAGE=0.001,
MAILING_LIST_MULTI=-1,
RCVD_IN_MSPIKE_H4=-0.01,
RCVD_IN_MSPIKE_WL=-0.01,
SPF_HELO_NONE=0.001,
SPF_PASS=-0.001,
T_KAM_HTML_FONT_INVALID=0.01,
RCVD_TLS_ALL=0,
RWL_MAILSPIKE_VERYGOOD=0,
HAS_LIST_UNSUB=-0.01,
R_DKIM_ALLOW=0,
URIBL_GREY=1.5,
MANY_INVISIBLE_PARTS=0.3,
DMARC_POLICY_ALLOW=0,
BAD_REP_POLICIES=0.1,
REPLYTO_DOM_NEQ_FROM_DOM=0,
PREVIOUSLY_DELIVERED=0,
PRECEDENCE_BULK=0,
DKIM_TRACE=0,
MIME_TRACE=0,
MIME_BASE64_TEXT=0.1,
HAS_REPLYTO=0,
RCVD_COUNT_ONE=0,
ASN=0,
MIME_GOOD=-0.1,
TO_DN_EQ_ADDR_ALL=0,
R_SPF_ALLOW=0,
FREEMAIL_REPLYTO=0,
FORGED_SENDER=0.3,
TO_MATCH_ENVRCPT_ALL=0,
ONCE_RECEIVED=0.1,
ARC_NA=0,
RCPT_COUNT_ONE=0,
FROM_NEQ_ENVFROM=0,
FROM_HAS_DN=0
] autolearn=ham autolearn_force=no
I copied the @rspamd_scanner config section from README.rspamd, which includes a score_factor setting:
score_factor => $sa_tag2_level_deflt / 15.0,
Apparently, scores, reported in the X-Spam-Status header and the spam-tag log line are 'raw' scores, not recalculated by the score_factor - which is a bit confusing.
Since the log also includes a separate Local Rspamd rspamd score line, that already shows 'raw' Rspamd scores, the email header and the spam-tag log line should consider the score_factor and report the recalculated value.
OS: CentOS 7.8 Amavis version: 2.12.0 (from EPEL repo) Rspamd version: 2.6 (from rspamd.com repo)