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.

How to enable SPF and DomainKeys by default?

Discussion in 'General Discussion' started by electric, Sep 4, 2008.

  1. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Hello,

    Anyone know how to do this?

    Both SPF and DomainKeys are disabled by default for new cpanel accounts, but we'd like them to be enabled.

    Is there a reason they are disabled by default? (ie: Any "gotchas" or something that we should be concerned about or aware of?)

    Thanks.
     
  2. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    You can setup SPF records in the DNS zone templates from WHM, such that any new accounts created will have those included..
     
  3. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    What are the DNS records supposed to look like that will work automatically?

    Also, how do we switch "on" the checkboxes in the cpanel page so the customers sees these are enabled?
     
  4. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    For the SPF record, you would add something like this in your DNs templates :

    Code:
    %domain%. IN TXT "v=spf1 a mx ptr ~all"
    Now, for the Domainkeys, I think your best option would be to write a /scripts/postwwwacct that would grab the username of the account that is being created and run /usr/local/cpanel/bin/domain_keys_installer <<username>>
     
  5. speckados

    speckados Well-Known Member

    Joined:
    May 21, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Acequias :: Granada :: España
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    SPF records and Ip aditional

    Hello.

    I'm using a diferent Ip of hostname for shared IP.

    Exim use Ip of hostname for sending messages, and DNS records point MX to shared IP.

    It's confusing for DNS zones, and hotmail.com and anohter email systems, dont' work.

    I use this on templates.
    %domain%. IN TXT “v=spf1 a mx -all”

    This put
    domain.extension. IN TXT "v=spf1 a mx ip4:XXX.XXX.XXX.XXX ?all"

    XXX.XXX.XXX.XXX it's primary IP forn netcard interface, and not IP for shared or dedicated hosting.

    How can add IP for domain also tu DNS zone on templates?

    Also if any solution for modify all records.

    Thanks for help
     
  6. iLLuSi0nS

    iLLuSi0nS Active Member

    Joined:
    Jun 9, 2007
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Ok the SPF was easy, but I am stuck with the Domainkeys.

    How do you "write a /scripts/postwwwacct that would grap the username of account that is being created and run /run/local/cpanel/bin/domain_keys_install <<username>>

    I dont have a file called postwwwacct in my /scripts folder, I do however have a wwwacct file in the /scripts folder
     
  7. Serra

    Serra Well-Known Member

    Joined:
    Oct 27, 2005
    Messages:
    213
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Florida
    Here is a way to turn all domain keys on... it writes stuff and deletes stuff with -rf, use at your own risk:

    Code:
    #!/bin/sh
    cd /root
    rm -rf users
    mkdir users
    cd users
    
    ls -A /var/cpanel/users/ > users
    
    for account in `cat /root/users/users`
    do
    
    echo "$account creating domainkeys.."
    /usr/local/cpanel/bin/domain_keys_installer $account
    echo done
    
    done                          
               
    
    The directory /root/users should not exist. (or if it does, it's toast.)

    The cpanel script seems to be smart enough to ignore domains with domain keys already on, at least that is my experience.

    Let me know if anyone sees a problem.
     
  8. johneve

    johneve Member

    Joined:
    Apr 4, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    And if you modify the script a little bit you can also turn on SPF for all accounts:

    Code:
    #!/bin/sh
    cd /root
    rm -rf users
    mkdir users
    cd users
    
    ls -A /var/cpanel/users/ > users
    
    for account in `cat /root/users/users`
    do
    
    echo "$account Enabling SPF record.."
    /usr/local/cpanel/bin/spf_installer $account
    echo done
    
    done
    Use at own risk of course.
     
  9. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    Why doesn't cPanel have this as an easily enable/disable option in WHM?

    - Vince
     
  10. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thank you for your input.. I hope they develop something similar soon.. :)
     
  11. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    where do i save this script
     
  12. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    how is it possible ??????

    i am doing this manually after create account & login to cPanel then i enable DK & SPF

    it would be such a great if this added automatically whenever i create new account

    let me know how to do this ????
     
  13. sohaileo

    sohaileo Registered

    Joined:
    Jul 3, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
  14. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
  15. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    i tried but it does not works

    i have added this code

    then created new account but A new account doesn't add SPF & DK as per the code

    i attached jpg for your further reference
     
    #15 crazyaboutlinux, May 1, 2009
    Last edited: May 1, 2009
  16. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    cPanel staff must look into this
     
  17. learner

    learner Registered

    Joined:
    May 5, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I found this code also %domain%. IN TXT “v=spf1 a mx -all”
    only 2 days ago and have it added to the zone file for creating spf on new zones.

    I have it added at the end of both templates
    WHM > DNS > Edit Zone Template - Simple/ Standard

    My question:

    Does it need to be added to the FQDN of the server.

    I added record WHM > Edit zone file - host.mydomain.com. IN TXT “v=spf1 a mx -all”

    Am I right or wrong?

    Does it need to be added to the private nameservers of the server aswell?

    Thanks
     
  18. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    try to create an account and see whether SPF record is added automatically or not ?

    if not, update on this

    cPanel staff will look into this & will do anything & update on this

    be patience
     
  19. sohaileo

    sohaileo Registered

    Joined:
    Jul 3, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have done this several times, i wrote the code when i tested on my productive server and i just test it by creating another account. Even one of my client use it by its own and everything goes fine.

    First tell me what version of CPanel you have? Because reading ARG can be differnent on older versions.

    Another thing just go and test it again but as soon as you done go and look the following log file

    /usr/local/cpanel/logs/error_log

    it will show the exact error you are getting.

    If you have any question please feel free to ask.

    Regards,
     
  20. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    cPanel 11.24.4-S35075
    WHM 11.24.2 - X 3.9


    let me tell you one thing that i didn't get any error message
    account was created successfully

    but when i checked SPF record & domain key by login to cPanel it appears disabled to me as i have clarify in .jpg file

    there isn't any error

    hope you got it
     
    #20 crazyaboutlinux, May 13, 2009
    Last edited: May 14, 2009
Loading...

Share This Page