The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Prevent creation of forwarders pointing to external domains

Discussion in 'E-mail Discussions' started by brainyron, Feb 2, 2015.

  1. brainyron

    brainyron Member

    Joined:
    Apr 7, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    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;
    }
     
    #2 kdean, Feb 3, 2015
    Last edited: Feb 3, 2015
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page