Global Wildcard Email Filter Possible?

Dave__W

Registered
Jun 29, 2017
3
0
1
UK
cPanel Access Level
Root Administrator
Hey everyone,

I am trying to setup email forwarding so we can use wildcard addresses to send to certain accounts. Eg "usera*@domain.com" > "[email protected]" where * is wildcard so anything sent to [email protected]/[email protected] etc will be forwarded to "[email protected]".

There are no full email accounts or forwarders setup for this domain.

So i have created a rule in 'Global Email Filters' to redirect all mail that begins with "usera" to redirect to another email address and then discard the message.

However when i send a mail to any of these addresses they just bounce back and say the address doesn't exist?

Do accounts need to be setup in cPanel for the global email filters to work? If so this obviously makes what we're trying to do pointless as we'd have to setup separate email accounts for each possible address which is what we're trying to avoid.

Does anyone know if what i'm trying to do should work and, if so, is there anything you could suggest as to what i'm doing wrong/how i can make it work?

If you need any other info about the setup then let me know.

Thanks very much,

Dave
 

Dave__W

Registered
Jun 29, 2017
3
0
1
UK
cPanel Access Level
Root Administrator
Hello,

You can browse to the "Default Address" option in cPanel to set the default behavior for unroutable emails:

Default Address - Documentation - cPanel Documentation

It needs to be set to an option such as "Forward to your system account" in order to avoid bounces for messages sent to email accounts that do not exist.

Thank you.
Hi Michael,

Thanks so much for your quick reply, that makes perfect sense :) However I did want to check something if you'd be so kind? We are happy to discard any mail that does not match the Global Email Filter rules (there are no actual email accounts or specific forwarders setup for this domain). If I use the 'Default Address' options to 'Forward to your system account' then presumably this will fill up with all inbound mail (spam and everything else)?

So presumably the best method would be to set the Default Address to 'Forward to your system account', add the Global Email Filter rules that we need and add one or more additional Global Email Filter rules to catch ALL other emails that aren't covered by other rules and discard or fail these messages. So i think that should mean any mail that matches one of the existing rules should be forwarded, and all other mail will be discarded, which will prevent any mail actually being sent to the 'system account'?

Would you mind confirming that my logic/process is correct and is the best way to achieve this (and will prevent the build up of unwanted email in the system account)?

Thanks so much for your help, it's massively appreciated

Dave
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,216
463
So presumably the best method would be to set the Default Address to 'Forward to your system account', add the Global Email Filter rules that we need and add one or more additional Global Email Filter rules to catch ALL other emails that aren't covered by other rules and discard or fail these messages. So i think that should mean any mail that matches one of the existing rules should be forwarded, and all other mail will be discarded, which will prevent any mail actually being sent to the 'system account'?
Hello,

As I understand, yes that should work as you intend it to. You may want to send some test messages upon setting up the filter rules just to make sure it works as expected.

Thank you.
 

Dave__W

Registered
Jun 29, 2017
3
0
1
UK
cPanel Access Level
Root Administrator
Hello,

As I understand, yes that should work as you intend it to. You may want to send some test messages upon setting up the filter rules just to make sure it works as expected.

Thank you.
Thanks so much for the clarification Michael, i will go ahead and test the filter rules after setting it up like this to ensure all is as expected.

Thanks again, Dave