Increase spam assassin score for gmail

Questions and answers about how to do stuff
Post Reply
SelfMan
Posts: 17
Joined: 28 Sep 2021 18:02

Increase spam assassin score for gmail

Post 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
User avatar
shawniverson
Posts: 3590
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Increase spam assassin score for gmail

Post 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
SelfMan
Posts: 17
Joined: 28 Sep 2021 18:02

Re: Increase spam assassin score for gmail

Post by SelfMan »

Thanks!
will try that asap.
SelfMan
Posts: 17
Joined: 28 Sep 2021 18:02

Re: Increase spam assassin score for gmail

Post 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
barbours
Posts: 25
Joined: 24 Sep 2019 06:13

Re: Increase spam assassin score for gmail

Post by barbours »

Please share the custom rule that you used. Has it been successful?
SelfMan
Posts: 17
Joined: 28 Sep 2021 18:02

Re: Increase spam assassin score for gmail

Post 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.
Post Reply