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.

Ensuring appropriate SPF record exists

Discussion in 'E-mail Discussions' started by Haym, Aug 1, 2017.

Tags:
  1. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hello,

    As it stands, cPanel allows us to enable SPF by default but not customise the actual record which is created. The spf_installer script exists to apply a record to all existing accounts, but how can we ensure newly created accounts have the right SPF record too?

    There is a feature request open for this, but I'm looking for an immediate solution. Some people suggest using DNS templates, does this not interfere with cPanel's automatic SPF record creation?

    Thanks for any suggestions, there must be other hosts out there who need to set a common SPF record due to email relays being in place.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    There's no supported method of changing the default SPF record configured when SPF is enabled for accounts. Here's the link to the feature request for this functionality (in-case others viewing this thread would like to vote for it):

    Configurable SPF default template + automatically include assigned IP to SPF (not just main shared IP)

    As a workaround, you could setup an entry in the DNS template. Here's a user-submitted comment about this:

    Configurable SPF default template + automatically include assigned IP to SPF (not just main shared IP)

    If you choose to use this workaround, you'd likely want to disable the "Email Authentication" feature via "WHM >> Feature Manager" to prevent cPanel users from manually setting up different records.

    Thank you.
     
    linux4me2 likes this.
  3. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Thanks Michael. Using the zone templates actually works fine, cPanel even recognises this during the account creation process (see screenshot). So for anybody else doing this, zone templates are your friend.
     

    Attached Files:

    • SPF.png
      SPF.png
      File size:
      207 KB
      Views:
      3
    cPanelMichael likes this.
  4. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I've just realised that resellers have their own zone templates which don't default to the system zone templates.

    How can we configure default reseller zone templates, please?
     
  5. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I found the following advice in this thread from 2005: Reseller dns zone template

    The same directory appears to be in use today. Is this behaviour supported by cPanel? I have noticed the files don't exist by default, so not sure if they are even still used at this point (the non root_ ones).
     
  6. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Okay, my testing indicates this works fine, but the files don't exist by default. So you should copy the root versions into place:

    Code:
    $ cp /var/cpanel/zonetemplates/root_simple /var/cpanel/zonetemplates/simple
    $ cp /var/cpanel/zonetemplates/root_standard /var/cpanel/zonetemplates/standard
    $ cp /var/cpanel/zonetemplates/root_standardvirtualftp /var/cpanel/zonetemplates/standardvirtualftp
    
    So my final question for @cPanelMichael - is this supported or may cPanel drop the behaviour at any time?

    Thanks!
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The officially supported method to modify the zone templates for resellers is to access WHM as the reseller and use the "Edit Zone Templates" option (it's available with the standard reseller privileges). Or, copy the saved root zone templates with commands like this for each reseller username:

    Code:
    cp -a /var/cpanel/zonetemplates/root_simple /var/cpanel/zonetemplates/reselleruser_simple
    This will ensure the changes are preserved through updates. The method you mentioned may not always work in the future.

    Thank you.
     
  8. Haym

    Haym Member

    Joined:
    May 12, 2017
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    So to clarify, there is no supported method to configure the default templates for all resellers rather than altering the reseller's templates individually each time you need to change them or a new reseller is created? As it would be common for every user, including those belonging to a reseller, to require the same default DNS records on the same server (e.g. for SPF record purposes). Perhaps something for you to consider implementing officially (especially since the behaviour is already there :-p)
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    That's correct. There's no functionality to automatically apply root zone template changes to existing or new resellers. The following feature request would likely address this issue:

    Ability to select zone template upon account creation in WHM

    There's an additional feature request here that would also help:

    DNS Templates per Package

    I encourage you to vote and add feedback to these requests if you'd like to see them implemented.

    Thanks!
     
Loading...

Share This Page