By default . olspanel set the permission of /etc/opendkim/keys to www-data . but opendkim needs to read them . so it might fail to send a mail .
all u gotta do is add opendkim user to www-data group
sudo chown -R root:www-data /etc/opendkim/keys
sudo chmod -R 750 /etc/opendkim/keys
sudo find /etc/opendkim/keys -type f -name "*.private" -exec chmod 640 {} +
and then restart postfix
issue no 2 . some domains while added by default doesnt do dkim automatically. you first gotta generate them then add to OLSPanel usually adds subdomains automatically, but you often have to manually add the root domain for your clients.
/etc/opendkim/key.table: Add the link to the private key.
default._domainkey.domain.com domain.com:default:/etc/opendkim/keys/domain.com/default.private
/etc/opendkim/signing.table: Add the wildcard for the root.
*@domain.com default._domainkey.domain.com
In the end
sudo systemctl restart opendkim
sudo systemctl restart postfix
Monitor the logs while sending a test:
sudo tail -f /var/log/mail.log | grep -i dkim
Thanks
Obaidullah