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.

remove all dkim

Discussion in 'E-mail Discussions' started by saros, Mar 9, 2014.

  1. saros

    saros Active Member

    Joined:
    Aug 28, 2013
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    How do I remove dkim all accounts ?

    and then add back in all accounts...
     
  2. robb3369

    robb3369 Well-Known Member

    Joined:
    Mar 1, 2008
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Use this to remove DKIM from all users:

    Code:
    for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_uninstall $user; done
    And to add DKIM back:
    Code:
    for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_install $user; done
     
  3. saros

    saros Active Member

    Joined:
    Aug 28, 2013
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    not work

    Code:
    root@zeus [~]# for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_uninstall $user; done
    /usr/local/cpanel/bin/dkim_keys_uninstall: usage: /usr/local/cpanel/bin/dkim_keys_uninstall <user> at /usr/local/cpanel/bin/dkim_keys_uninstall line 20.
    /usr/local/cpanel/bin/dkim_keys_uninstall: usage: /usr/local/cpanel/bin/dkim_keys_uninstall <user> at /usr/local/cpanel/bin/dkim_keys_uninstall line 20.
    
     
  4. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    It's quite possible that not all users in /var/cpanel/users have DKIM enabled, so that might be why some of them are failing to uninstall when you issue that command.

    Also, keep in mind that if you are wanting to mass deactivate DKIM and then reinstall it with the purpose of upgrading weak DKIM keys to 1024-bit keys, I don't think this will do it.

    Unless something has changed, in order to upgrade an account with 512-bit keys to 1024-bit DKIM keys, you have to (a) uninstall DKIM from the account, (b) remove the associated keys from /var/cpanel/domain_keys/public and /var/cpanel/domain_keys/private, and (c) then re-install DKIM on the account.

    NOTE: Do NOT remove everything from /var/cpanel/domain_keys/public and /var/cpanel/domain_keys/private unless you understand what you are doing.

    mike

     
  5. robb3369

    robb3369 Well-Known Member

    Joined:
    Mar 1, 2008
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    If you just do a grep in the users directory for HASDKIM=1, you will be able to use that as a basis for a list:

    Code:
    grep -l 'HASDKIM=1' /var/cpanel/users/*
    The other thing you can do is create a shell script and go for it...

    Code:
    #!/bin/bash
    cd /var/cpanel/users
    for user in `grep -l HASDKIM=1 *`
    do
            /usr/local/cpanel/bin/dkim_keys_uninstall $user
    done
    Then afterwards change HASDKIM=0 and use dkim_keys_install

    Use at your own risk! TEST it first...
     
    #5 robb3369, Mar 10, 2014
    Last edited: Mar 10, 2014
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The command you used likely worked well, and only failed for the "root" and "nobody" entries in /var/cpanel/users that are not actual accounts. Did you verify to see if DKIM was uninstalled for the accounts?

    Thank you.
     
Loading...

Share This Page