I've been trying to configure my sites in CPanel, using the Account Level Filtering and Default Address settings. Here is the process flow I want to happen to all incoming email.
1. Filter against several rules, and deliver matching emails accordingly.
2. Any mails that don't match the rules, should fail with an error message of "no email address at this domain".
Here is what I have tried.
1. I set up a rule in Account Level Filtering. Each rule is similar. RULE = If the "TO" address contains ".email@example.com" OR "+firstname.lastname@example.org", then deliver to "email@example.com".
The filter works exactly as desired. Emails TO "firstname.lastname@example.org" OR "email@example.com" are properly delivered to firstname.lastname@example.org. Also, emails simply addressed to "email@example.com" are delivered properly.
2.Then on the Default Address settings, I set it to "Discard with error to sender (at SMTP time)" with a message of "No such person at this address"
This also works as expected. Emails addressed to "firstname.lastname@example.org" are returned to sender with "not deliverable".
Here is the problem. It seems that the default address setting takes precedence over the filter rules. Emails addressed to "email@example.com" or "firstname.lastname@example.org" are now bounced back to sender as undeliverable. Emails addressed to "email@example.com" are delivered properly.
I tried a couple of other settings and filters, but can't get it to work exactly as I want. Here is what I want.
1. Deliver all mail to exact accounts, ie. "firstname.lastname@example.org" to "email@example.com".
2. Deliver filtered mail, such as "+firstname.lastname@example.org" to "email@example.com".
3. If the TO field does not meet the 2 conditions above, return to sender with error.