sympl-mail: config/antispam doesn't work as expected
What is expected to happen:
-
With the
antispam
file at/srv/example.com/config/antispam
and empty, spam mail identified as spam should be rejected. -
With the
antispam
file at/srv/example.com/config/antispam
and containingtag
, spam mail should:
- have the
X-Spam-Status: spam
header set, and the mail accepted. - be delivered to the
Spam
mail folder of the user.
What actually happens is that 1
works as expected, but 2
rejects the mail as spam regardless of the tag setting, unless the config/antispam
file is world-readable, which it likely shouldn't be.
In no instance (apparently inherited from Symbiosis) does the mail actually get placed in the users Spam folder, although it would be possible to create a sieve filter to do this, or for Dovecot to handle it, the mail is placed in the normal mail folder.
A quick fix would be to change /etc/exim4/sympl.d/10-acl/50-acl-check-rcpt/80-enable-antispam-check
to:
${if match{${extract{smode}{${stat:VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antispam}}}}{\Nr\N}{\
A fix for tagging spam properly would be to enable the subject rewrites by default, by adding the following to /etc/exim4/system_filter
:
if $h_X-Spam-Status: contains "spam"
then
headers add "Original-Subject: $h_subject"
headers remove "Subject"
headers add "Subject: *** SPAM *** $h_original-subject"
endif
Note this also affects config/antivirus, which has a similar (undocumented) tagging function for virus infected emails in /etc/exim4/sympl.d/10-acl/50-acl-check-rcpt/85-enable-antivirus-check
.