• 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 emails not delivered in GSuite after migration from cPanel to Plesk

  • Thread starter Deleted member 209767
  • Start date
D

Deleted member 209767

Guest
Hi,
We just migrated from cPanel to Plesk and the mails stopped working after the migration. It was working perfectly fine for years with cPanel and we use this domain only for customer support (no newsletter or automated mails) so the domain was never blacklisted

We use [email protected] with GSuite and the DNS is configured both in Cloudflare DNS and Plesk DNS Zone. A test with GSuite Toolbox CheckMX returns "No problems were found with the configuration of this domain"

If I log in my personal gmail account and send a mail to [email protected] it works perfectly and the mail is received in GSuite

But it's not working when the same mail is sent by PHP mail() function. So our contact form is now broken (it was working with cPanel).

To test, we use this PHP script:
Code:
$to      = '[email protected]';
$subject = 'test mail to GSuite';
$message = 'Hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

$to      = '[email protected]';
$subject = 'Test mail to my personal gmail account';
$message = 'Hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

The mail is NOT received in [email protected] (GSuite) .. not even in the spam folder
However the mail is successfully received in [email protected] .. but in the header I can see "dkim=temperror (no key for signature)"

Here's the full header of the only mail i'm receiving in [email protected] ... I noticed the Return-Path is a different address but i'm not sure if it's a problem. I tried to change it to another email in php.ini using sendmail_from and sendmail_path, but it didn't change anything.

I already tried to contact Plesk support but it wasn't helpful. They blamed it on my domain even if it's not blacklisted. It was also working perfectly the day before the migration from cpanel to plesk .... And here's the thing : With GSuite I can send emails from [email protected] and it is always successfully delivered. It doesn't work ONLY when sent by PHP mail() function.
 
I suggest not to use plain php mail function, rather use PHPMailer with SMTP. Also check in mail settings for domain is "use DKIM" checked.
 
I suggest not to use plain php mail function, rather use PHPMailer with SMTP.
But it was working for years on cPanel until the day we moved to Plesk ...

Also check in mail settings for domain is "use DKIM" checked.
Yes, it's checked
 
It was working, but on cPanel you have an option to disable mail function, to use SMTP only. mail() is often used for spamming.
 
Back
Top