When using Spam Filters on your cPanel account, it is possible to whitelist certain email addresses so SpamAssassin does not interfere with them. However, if an email is relayed through the server, SpamAssassin will not know what domain it comes from, preventing it from being whitelisted.
** Warning, these steps include modifying the 'local.cf' file for SpamAssassin installed for your cPanel server. Please use caution. **
1. Determine what email address or domain you need to whitelist through SpamAssassin that is being relayed.
We will use the following information as our example for this support article.
email@example.com -- email address
mail2.domain.tld -- PTR (rDNS) address of mail server
2. Review the SpamAssassin page below for the two following entries:
The 'whitelist_from_rcvd' needs two parameters, the email address or domain and the rDNS record of the mail server
The 'whitelist_allows_relays' needs the email address or domain to ensure it is not triggered by a Spamassassin rule
Below is an example from our test domain:
whitelist_from_rcvd firstname.lastname@example.org mail2.domain.tld
3. In the SpamAssassin documentation URL, a more robust explanation is given for the two options. We recommend reviewing them closely before proceeding.
4. Once you have the configuration from Step 2, you will need to add it to the bottom of the following file for Spamassassin.
Please backup the file before modifying the file, just in case.
5. Add the new configurations from Step 2 to the bottom of the file, and save the file.
6. No need to restart Exim, Dovecot, or Spamassassin.