Changing default settings for default address

rklei3434

Registered
Jul 19, 2016
1
0
1
Chicago
cPanel Access Level
DataCenter Provider
We have several cPanel servers that are not rejecting messages to mailboxes that don't exist -- they are simply passing them on to the default address. What we want is for all domains to have the setting: "Discard the email while your server processes it by SMTP time with an error message."

Is there a way to globally change this for all domains present and future? Maybe with an ACL in Exim?

If not, I suppose we'll have to change this setting for all accounts by hand, but is there a way to make "discard the email . . ." the default for all new domains?

Thanks very much!
 

ssfred

Well-Known Member
Jan 6, 2012
65
4
58
India
cPanel Access Level
Root Administrator
Twitter
Hello

If you are looking to change the "Default Email Account" from cPanel user to "fail" for all accounts server wide, you may check the option available in WHM -> Tweak Settings -> Mail -> Initial default/catch-all forwarder destination .
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
If you are looking to change the "Default Email Account" from cPanel user to "fail" for all accounts server wide, you may check the option available in WHM -> Tweak Settings -> Mail -> Initial default/catch-all forwarder destination .
Hello,

This will change the default value for new accounts. There's no native feature that will change the value for existing accounts, however if you wanted to change it for every account on the system you could use commands like this:

Code:
cp -a /etc/valiases /etc/valiases-backup
for f in /etc/valiases/*; do >$f; done
echo "*: :fail: No such person at this address." | tee -a /etc/valiases/* >/dev/null

Note this will backup the existing /etc/valiases directory to /etc/valiases-backup, remove any existing default address entries for the domain names, and then replace them all with "*: :fail: No such person at this address.".

Thank you.