• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue DKIM in Plesk doesn't work

igork1

Basic Pleskian
I have a problem with enabling DKIM in Plesk for my 2 VPS.

Same problem with a new VPS on Debian 8 + Plesk Onyx 17.8.11 and
old VPS on CentOS 6.7 + Plesk Onyx 17.5.3

I enabled DNS service in Plesk for my domains. Also in domain's registrar service I changed nameservers which now point to my server directly (ns1.mydomain.com and ns2.mydomain.com).

Websites with Plesk DNS are working correctly.

I enabled DKIM in Plesk (Tools & Settings > Mail Server Settings)
And DKIM is enabled in Mail settings of certain domains.

There are two DKIM records in Plesk DNS:
_domainkey.slideshowforum.com. TXT o=-
default._domainkey.slideshowforum.com. TXT v=DKIM1; p=MIGfMA0GCSqGSIb3DQ <...>

However when I send a test email from PHP script mail() I see only SPF = pass and DMARC = pass. No DKIM in headers, and no "DKIM = pass"

Postfix / Dovecot

P.S. I've read this article:
DKIM, SPF, and DMARC Protection
 
Last edited:
You're right. DKIM works only for webmail (mail program), not for phpmail.

But it's very complicated. I hoped that Plesk Onyx may help to simplify use of DKIM.

Earlier I had Plesk 12.5 + external DNS and I manually installed OpenDKIM and created keys. DKIM worked fine for phpmail.

After the upgrade to Plesk Onyx 17.5.3 DKIM became broken. And I couldn't fix it.

I tried to install DKIM manually on a new VPS with Debian 8 + Plesk Onyx 17.8.11 and it also didn't work for phpmail.

So I decided to restore full backup of my VPS and try Plesk DNS with DKIM. And it also doesn't work.

Can I expect that Plesk will offer automatic solution for DKIM soon?
 
Last edited:
You're right. DKIM works only for webmail (mail program), not for phpmail
It looks like you may not have read all that thread properly? ;) i.e. followed the link in Post #2 of that thread and the subsequent guide? PHP Mail with DKIM works perfectly for us (our Plesk setup in shown in our signature)
But it's very complicated. I hoped that Plesk Onyx may help to simplify use of DKIM
To be fair, once you understand how and what data needs to be read by PHP Mailer and where that data is located within Plesk, it's quite easy! There's no need to install / use OpenDKIM at all. It works fine without it (in our case anyway)
Can I expect that Plesk will offer automatic solution for DKIM soon?
Don't hold your breath... :p
 
Hi,

Thanks for your reply!

I'm stuck on the stage: "5) Then amend the PHPMailer file as follows:"

Where to find this file? Sorry for stupid question.
 
I'm stuck on the stage: "5) Then amend the PHPMailer file as follows:"
The file name is class.phpmailer.php Obviously we don't know exactly where that is on your server (it won't be the same setup / packages etc as ours) but you can easily find it now you have the name using CLI / SSH. Take a backup copy when you do then edit it as per that guide and it should be fine. FWIW the first couple of lines when you open it will be something like:
Code:
<?php
/**
 * PHPMailer - PHP email creation and transport class.
 * @package PHPMailer
 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
....etc
 
I didn't find any file class.phpmailer.php in both my VPS - CentOS 6.7 and Debian 8.1

I searched in Midnight Commander via SSH.
 
Ahhhh Okay.
You probably know the differences already then between mail() in php and phpmailer, but if not, this is easy reading and gives a clear enough explanation. Unless you change to using phpmailer, you'll need a different solution from the one we used then, which (unluckily for you it seems now) was: "...successfully applying DKIM to all PHPMailer sent e-mails"
 
Thanks for the explanation. My mistake. I will read more info about phpmailer.

Anyway, I hope that Plesk team will find automatical solution for DKIM + mail(), too.
 
Back
Top