Prevent creation of forwarders pointing to external domains

brainyron

Member
Apr 7, 2008
19
0
51
Seattle, WA
cPanel Access Level
Root Administrator
Hello,

Is there a way to prevent the creation of email forwarders which are directed to domains hosted outside of the cPanel server? I have users which are creating forwarders to point their email to free email providers, resulting in those providers blacklisting me for the spam which is coming through. I'd really prefer a less heavy-handed solution than disabling email forwarders entirely but I can't have my servers getting blacklisted either.

Thanks,
Ron
 

kdean

Well-Known Member
Oct 19, 2012
369
61
78
Orlando, FL
cPanel Access Level
Root Administrator
Here's a link to the method I use to block a list of domains names so users can't forward to them.

http://forums.cpanel.net/f43/block-forwarding-111609.html#post509561

Note, in addition to the linked posts instructions you can add your own custom error message by changing the lines in the CustomEventHandler.pm for:

Code:
if ($_ eq $domain) {
	$return = 0;
}
with:

Code:
if ($_ eq $domain) {
	$Cpanel::CPERROR{$Cpanel::context} = "Sorry, forwarding to $_ is not allowed.";
	$return = 0;
}
 
Last edited: