Plesk for Linux
kb: how-to
ABT: Group B
Applicable to:
- Plesk for Linux
Question
How to enable/disable DKIM signing for all domains in Plesk for Linux?
Answer
-
Connect to a Plesk server via SSH.
-
Allow signing outgoing mail by DKIM spam protection on a server level:
# plesk bin mailserver --sign-outgoing-mail true
-
Run the following command to enable DKIM signing for all domains:
# for domain in $(plesk db -Ne 'SELECT name FROM domains WHERE parentDomainId=0;'); do plesk bin domain_pref --update $domain -sign_outgoing_mail true; done
Note: To disable DKIM signing for all domains, switch the value to from true to false.
Additional Information
To learn more about mail protection, see this KB article.
Comments
7 comments
Thanks, this solved it in no time!
3. Run the following command to enable DKIM signing for all domains:
for domain in $(plesk db -Ne 'SELECT name FROM domains WHERE parentDomainId=0;'); do plesk bin domain_pref --update $domain -sign_outgoing_mail true; done
This didn't work for me on CentOS 7 + Plesk 18.
I get:
-bash: syntax error near unexpected token `do'
Hi, Vojkan Cvijanovic!
The command should work there - please make sure you run it as root and that no extra characters are copied over.
Thanks
If you have problems validanting DKIM records first disable all (false) and after enabled all (true).
I have executed the 3rd command with "false" and then run again with "true". But gmail saying my server domain email's DKIM is "FAIL". How to fix it please? Can we regenerate new Key domain domains?
I executed the 3rd command and keep getting bash: plesk: command not found
For the record, I am logged in as root, running Plesk Obsidian on Debian 10. I also tried to append the route to plesk /sbin/plesk on the variable with the same result, can someone assist on this? Thanks to anyone reading this!
Does this DKIM signing overwrite any existing email headers? i.e. if I already send my email signed, will those headers be overwritten with a different value?
Please sign in to leave a comment.