Fix: Email sent to Gmail from a shared-host bounce back with Unauthorized Email error

Symptoms of the Problem:

  1. Able to receive emails from Gmail, but unable to send emails to Gmail
  2. Sending email to other emails like *.icloud.com works.
  3. Gmail Mailer Daemon respond an error like this:
This is the mail system at host relay.mailchannels.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<xxxxxxxxx@gmail.com>: host gmail-smtp-in.l.google.com[74.125.135.26]
    said: 550-5.7.26 This mail is unauthenticated, which poses a security risk
    to the 550-5.7.26 sender and Gmail users, and has been blocked. The sender
    must 550-5.7.26 authenticate with at least one of SPF or DKIM. For this
    message, 550-5.7.26 DKIM checks did not pass and SPF check for
    [phdevelopers.org] did 550-5.7.26 not pass with ip: [23.83.212.17]. The
    sender should visit 550-5.7.26
    https://support.google.com/mail/answer/81126#authentication for 550 5.7.26
    instructions on setting up authentication.
    b15-20020a63e70f000000b00578889362a2si5330735pgi.663 - gsmtp (in reply to
    end of DATA command)

Fix:

  1. In your cPanel, go to Email section, then Email Deliverability.
  2. Select the domain name and click “Manage”
  3. In your Domain Name Registrar, manage the DNS Records and
    • Add an MX record to register your Mail Server. You can see the Mail Server host name indicated as Mail HELO in Email Deliverability page
    • Add 2 TXT records for DKIM and SPF. Add the Name and Value as indicated in the cPanel for DKIM and SPF.
    • For SPF, I had to open a ticket for my hosting provider and they modified the value to be:
      v=spf1 +mx +a +ip4:184.164.84.220 +include:relay.mailchannels.net ~all
  4. PTR is not required, so you can skip that.
  5. Test by sending to a Gmail account and reply

Screenshots:

  • September 22, 2023