Force SpamAssassin spamfilter for external forwarders

By | October 8, 2016

Users like to forward email from emailaccounts under their own domain to their personal emailaccount at Hotmail, Google or other thirth party emailproviders. The current techniques does not handle forwarding spam very well, meaning that incoming spam is handled by your server and routed to the thirth party provider. The receiving provider thinks that you are sending spam and at some moment your server is blacklisted, either on public RBL’s or for example Microsoft their private RBL.

To prevent this from happening, the ideal situation would be to filter all spam and never forward spam anymore, however spamfilters are never 100% accurate. Besides this fact, we see many users who do configure their forwarder but do not configure or even enable the spamfilter (SpamAssassin for DirectAdmin). Since the receiving provider does filter the spam, the spam will never reach the customer his emailaccounts and everything works perfectly… for the user.

With the following code you can prevent the creation of forwarders to other domains if the SpamAssassin spamfilter is not configured. If SpamAssassin is not configured with a threshold of 3.0 and set to delete incoming spam the following error is shown when the user creates a forwarder to an other domain:

spamassassin-error-1

Create the following file and paste the code below in it: /usr/local/directadmin/scripts/custom/forwarder_create_pre.sh:

If you need additional spamfiltering or in case SpamAssassin does not work perfectly for you, then try our advanced SpamExperts spamfilter.

Leave a Reply

Your email address will not be published. Required fields are marked *