Page 1 of 1

Block email with a specific word in "From" or "Subject"

Posted: 23 Oct 2015 09:21
by gabryb85
Hello,
i want to block email with the word "bounce" or "bounces" in the field "From"

For example mail from "2015102307234405fde9543fba4d329a6bece347a04b97@bounces.amazon.it" or from "g-30062504586-30015-3000103031-1445580314051@bounce.e.godaddy.com"

Can you help me?

Re: Block email with a specific word in "From" or "Subject"

Posted: 23 Oct 2015 09:33
by shawniverson
Sounds like a job for SpamAssassin...something like this...

Add to /etc/mail/spamassassin/local.cf:

Code: Select all

header BOUNCE_IN_ADDRESS  From =~ /bounce/i
score BOUNCE_IN_ADDRESS 10
describe BOUNCE_IN_ADDRESS       bounce keyword in from address

header BOUNCES_IN_ADDRESS  From =~ /bounces/i
score BOUNCES_IN_ADDRESS 10
describe BOUNCES_IN_ADDRESS       bounces keyword in from address

Code: Select all

sudo service MailScanner restart

Re: Block email with a specific word in "From" or "Subject"

Posted: 23 Oct 2015 09:47
by gabryb85
Thank you!!!!!!!!!!

Re: Block email with a specific word in "From" or "Subject"

Posted: 23 Oct 2015 12:22
by gabryb85
Hi i try to insert this rule, but the Spam Report not write this rule...

It's not applicated?

Re: Block email with a specific word in "From" or "Subject"

Posted: 23 Oct 2015 12:44
by gabryb85
Now it works

i use "sa-update" before restar service.

Thank you!