Follow these steps to install OpenDKIM on Ubuntu and Plesk.
I will use domain.tld (as the primary domain) and example.com as my domains, I have enabled subdomains so mail from the server mail.domain.tld gets signed too as in this case mail.domain.tld is also the Posfix hostname and mailname…
1. First login as root as run…
1
2
apt-get update
apt-get install opendkim opendkim-tools
2. Create the folder structure…
1
2
mkdir-p/etc/opendkim/keys/domain.tld
mkdir-p/etc/opendkim/keys/example.com
3. Create a key, I’ll use “dkim” as the selector and create 1024bit keys
You will have two files in the folder, dkim.private and dkim.txt, the latter contains the DNS record for you to add in Plesk or at your domains registrar.
1
2
3
4
cd/etc/opendkim/keys/domain.tld
opendkim-genkey-sdkim-ddomain.tld
chown opendkim:opendkim dkim.private
chmod600dkim.private
1
2
3
4
cd/etc/opendkim/keys/example.com
opendkim-genkey-sdkim-dexample.com
chown opendkim:opendkim dkim.private
chmod600dkim.private
4. Now we’ll create the SigningTable and the KeyTable…