Can I filter emails before they are forwarded?

Corystes

Registered
Apr 18, 2019
1
0
1
Dorset
cPanel Access Level
Website Owner
I have a webmail account and a forwarder for the same email address to a gmail account.
The email address is severely spammed. If I have filters on my webmail will they apply to forwarded emails, or is it an unfiltered copy that is forwarded? Need to do something as gmail has started to bounce some emails due to 'exceeding the max defers and failures per hour'.
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,779
331
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
Your webmail rules would not apply to the email before they are forwarded.

You should make sure spamassassin is on, and in the exim configuration, in the last section under spamassassin settings, there is two options that start with do not forward relating to spamassassin scores. Enable one of those. If you are going to use the first one, make sure that the settings at the very top regarding setting a spamassassin score is set to something reasonable like 8.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello @Corystes,

I recommend contacting your web hosting provider to see if they can enable the following option in WHM >> Exim Configuration Manager >> Basic Editor:

Do not forward mail to external recipients if it matches the Apache SpamAssassin™ internal spam_score setting

This option allows Apache SpamAssassin to scan and reject messages in the forwarder queue with a higher spam score than Apache SpamAssassin's internal spam_score setting of 5.

Otherwise, you'd need to delete the forwarder and setup a filter rule instead. You can create the filter so that it checks for spam-like conditions first, and then redirects the email to the forwarded address. You can read about filter rules on the links below:

How to Configure Mail Filters - cPanel Knowledge Base - cPanel Documentation

Thank you.