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.

etc/localdomains and /etc/remotedomains

Discussion in 'E-mail Discussions' started by penutz, Feb 27, 2008.

  1. penutz

    penutz Member

    Joined:
    Aug 23, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    In my current setup most of our clients use email that is not located on our cPanel server. In turn I have created different packages for accounts. We have a package called standard-noemail. So I add any accounts using this package if their email is elsewhere.. the problem i run into is each time I add an account i have to add it to /etc/remotedomains and make sure its removed from /etc/localdomains...

    Is there a solution to make this automated? I want accounts with no email solutions whatsoever. The reason this becomes a problem is if they have contact forms, etc.. they email the local server unless our admins remember to add it to /etc/remotedomains.

    On another note I have 2 domains that I have issues with sneeking back into /etc/localdomains.

    I remote them from /etc/localdomains and move them to /etc/remotedomains and the next day when i look they are back in localdomains, yet still in /etc/remotedomains.. this causes a big issue for the two clients..

    Any thoughts would be great.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    One method is to create a /scripts/postwwwacct script as described at: http://www.cpanel.net/support/docs/hooks.htm#postwww

    Here, you can analyze the name of the package and if it has something like -noemail, you can script the tasks your admins are currently performing manually.

    With the domains that creep back into /etc/localdomains, is it possible that they are going to the MX entry editor in the cPanel interface and checking Always accept mail locally even if the primary mx does not point to this server?

    There may be a way to create a hook to intercept that as the code that is being executed can be found in /usr/local/cpanel/base/frontend/x3/mail/dosetmx.html:

    Code:
    <cpanel Email="changemx($FORM{'domain'},$FORM{'mx'},$FORM{'priority'},$FORM{'alwaysaccept'})">
    
    I am unsure if this API1 function has been ported over to have hooks support as described in /usr/local/cpanel/hooks/README
     
  3. micho101

    micho101 Member

    Joined:
    Sep 29, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Why not just make this in cPanel itself? (not WHM). Again, your competing product which I won't name, has this solved elegantly, by a simple checkmark. No admin intervention needed.

    cPanel is superior to most or all control panels out there, but I keep scratching my head sometimes, why so simple and obviously many times used features aren't implemented yet...
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This thread was about setting this up automatically upon account creation for accounts in a specific package. If you believe that MX entries should be able to be set on a per-package basis, you may want to submit a feature request for that. This thread is the first request I've heard for such functionality. You may even want to put in an official feature request for this functionality if you feel so strongly about this: cPanel Bugzilla Main Page

    If you will be using a remote mail server for all new accounts, just edit the MX entry/entries in the DNS Zone template as needed.

    For individual cPanel users that want to set this up, they just set up their remote MX entry by clicking the MX Entries icon in their cPanel interface.
     
Loading...

Share This Page