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.

SPF and Domain Keys ...

Discussion in 'E-mail Discussions' started by Spiral, Dec 28, 2009.

  1. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Most all mail servers these days require SPF records in order to receive mail and a significant number are also using domain keys for verification of incoming mail but for some odd reason I still have not figured out, Cpanel has both of these DISABLED as the default when setting up new domains on the server and until these are enabled, you might have difficulty sending mail out to many locations.

    You can just enable these under "Mail Authentication" in Cpanel but if you have a large number of accounts, this could take a long time one by one!

    Cpanel has backend scripts to enable these but again on an account by account basis so I just wrote a quick hack of a script to go ahead and enable SPF and Domain Keys for every account on the server all at once in one single move to make it simple and painless.

    If anyone is interested in the script, here you go:
    Code:
    #!/bin/bash
    IFS="$"
    
    cd /var/named
    #####################################################################
    ###  Script to install SPF and DomainKeys on all accounts at once ###
    #####################################################################
    /bin/ls -- /var/cpanel/users | grep -v "root\|system\|passwd\|cpanel\|nobody\|mysql\|\`\|\-\|\." | while read CPUSER; do
        echo "Installing SPF and DomainKeys for '${CPUSER}'";
        /usr/local/cpanel/bin/spf_installer "${CPUSER}" > /dev/null
        /usr/local/cpanel/bin/domain_keys_installer "${CPUSER}" > /dev/null
    done
    
    ## END OF SCRIPT
    
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    The problem with SPF is that it break the forwarding mails.
    SPF: FAQ/Forwarding

    Currently, cPanel does not offer a solution for this - maybe that's why SPF is disabled by default.
     
Loading...

Share This Page