Only send spam notifications to specific domain

Questions and answers about how to do stuff
Post Reply
ENFRXB
Posts: 2
Joined: 03 Oct 2023 10:17

Only send spam notifications to specific domain

Post by ENFRXB »

We recently had an issue with user sending a mass email that was marked as spam. This caused all the recipients to receive the "Spam not delivered" message.

Is there a way to set a rule to send the spam notifications only to a specific recipient domain? We only want for our users to receive these notifications.
User avatar
shawniverson
Posts: 3780
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Only send spam notifications to specific domain

Post by shawniverson »

Yes, you can. What you need is a ruleset.

Create a new file in /etc/MailScanner/rules such as spamactions.rules

Define your rules in the file, using tabs to separate fields. Be sure to look at your Spam Actions setting in MailScanner.conf to see what parameters you are using in case you need to put them in the ruleset. For example, you might have custom(spam) instead of notify, depending on your configuration.

Code: Select all

To:          example.org     store notify
FromOrTo:    default         store
Set Spam Actions in /etc/MailScanner/MailScanner.conf:

Code: Select all

Spam Actions = %rules-dir%/spamactions.rules
Post Reply