remove all dkim
How do I remove dkim all accounts ?
and then add back in all accounts...
-
Use this to remove DKIM from all users: for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_uninstall $user; done
And to add DKIM back:for user in `ls /var/cpanel/users`; do /usr/local/cpanel/bin/dkim_keys_install $user; done0 -
not work 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 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 at /usr/local/cpanel/bin/dkim_keys_uninstall line 20.0 -
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 [quote="saros, post: 1591782">not work 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 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 at /usr/local/cpanel/bin/dkim_keys_uninstall line 20.0 -
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: grep -l 'HASDKIM=1' /var/cpanel/users/*
The other thing you can do is create a shell script and go for it...#!/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...0 -
[quote="saros, post: 1591782">not work
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.0
Please sign in to leave a comment.
Comments
5 comments