Allow incoming from particular hosts on a per domain basis

The company who i work for encountered a problem in their mail configuration.
Some domains on a server are using our SpamExperts cluster for their incoming email.
However some spammers are using the A record to deliver the mail, so the mail is being delivered without being scanned by our filter.

To block these email’s a small configuration change in our DirectAdmin Exim config was needed.

The first step is to create the config file to identify the domains for this setup.

Then fire up vi for /etc/exim.conf and look for the following rule

Right below add:

Then search for the following configuration:

Right below that add:

Make sure to change spamhost1 and spamhost2 to your own spamfilter.

Save, and add the domains that have incomming email thru the spamfilter in /etc/virtual/spamexperts_incoming.
Email for this domain coming in thru another route should now be blocked with a “nice” notice.