Page 1 of 1

Increase spam assassin score for gmail

Posted: 10 Feb 2022 12:25
by SelfMan
Hi guys,
is there a way to increase the spam score of all e-mail received from gmail?
Most of the spam these days comes from the fake/overtaken mailboxes at Gmail.
Sadly, most of them manage to pass through the eFa filters.

Thanks

MailWatch Version: 1.2.18
Operating System Version: CentOS Linux 7 (Core)
Postfix Version: 3.5.9
MailScanner Version: 5.4.2
ClamAV Version: 0.103.5
SpamAssassin Version: 3.4.6
PHP Version: 7.4.27
MySQL Version: 10.2.30-MariaDB

Re: Increase spam assassin score for gmail

Posted: 10 Feb 2022 12:53
by shawniverson
Yes.

You could add a custom rule to /etc/mail/spamassassin/local.cf to add a score to anything from gmail.com

https://cwiki.apache.org/confluence/dis ... itingrules

Re: Increase spam assassin score for gmail

Posted: 10 Feb 2022 13:16
by SelfMan
Thanks!
will try that asap.

Re: Increase spam assassin score for gmail

Posted: 11 Feb 2022 11:34
by SelfMan
Hi,
I added the custom rules, but they were not applied.
I found out that I have to run sa-update and sa-compile from /etc/mail/spamassassin/ folder.
Is it enough to run this from the GUI console in webmit or does this need to be run as root? (using sudo)

Are a ny other steps required?

Thanks

Re: Increase spam assassin score for gmail

Posted: 17 Sep 2022 00:11
by barbours
Please share the custom rule that you used. Has it been successful?

Re: Increase spam assassin score for gmail

Posted: 17 Sep 2022 01:31
by SelfMan
I added these 2 lines at the end of the /etc/mail/spamassassin/local.cf

Code: Select all

header LOCAL_DEMONSTRATION_FROM	From =~ /\@gmail\.com/i
score LOCAL_DEMONSTRATION_FROM	2.0
It seems to work partially as I don't see the rule being applied every time a mail from gmail.com is received.