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

Questions and answers about how to do stuff
Post Reply
gabryb85
Posts: 4
Joined: 28 Nov 2014 14:37

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

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

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

Post 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
gabryb85
Posts: 4
Joined: 28 Nov 2014 14:37

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

Post by gabryb85 »

Thank you!!!!!!!!!!
gabryb85
Posts: 4
Joined: 28 Nov 2014 14:37

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

Post by gabryb85 »

Hi i try to insert this rule, but the Spam Report not write this rule...

It's not applicated?
gabryb85
Posts: 4
Joined: 28 Nov 2014 14:37

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

Post by gabryb85 »

Now it works

i use "sa-update" before restar service.

Thank you!
Post Reply