Page 1 of 1

Spam filters not working for me

Posted: Thu Feb 11, 2021 12:43 pm
by michael.zietlow
I have a Sophos spam filter that prepends "[SPAM]" in front of the subject line.
I want these messages to be score 10 and moved right into the user's Junk folder.

I created the following rule in /opt/zimbra/conf/salocal.cf, /opt/zimbra/conf/salocal.cf.in, and even tried /opt/zimbra/data/spamassassin/localrules/myrules.cf

header LOCAL_RULE_SPAM_1 Subject =~ /\[SPAM\]/i
describe LOCAL_RULE_SPAM_1 Sophos adds SPAM to subject of highly suspect emails.
score LOCAL_RULE_SPAM_1 10

Yes I restarted
$ zmmtactl restart && zmamavisdctl restart


It just doesn't work. I've been scouring the webs & forums for other zimbra salocal.cf examples and it looks like this should work.

Please, What am I missing?


EDIT: Did the shotgun approach

zmcontrol stop
zmcontrol start


The header filter is correct. Mail going into junk now as intended.
Zimbra had been running non stop for several months so something unrelated must have been holding it up.

Re: Spam filters not working for me

Posted: Tue Feb 23, 2021 1:57 am
by L. Mark Stone
salocal.cf gets rewritten on every service restart by zmconfigd, so your changes get overwritten. This behavior is true of most of the config files.

Better to create a new file, like “zzsauser.cf” and put your customizations in that file. It will be read and executed last, and never overwritten by the configuration daemon.

Hope that helps,
Mark