Question

Zoho email and Digital Ocean

I have set up a Zoho email account to handle my email delivery from my site on Digitial Ocean.

I have an MX record for the site pointing to the Zoho server, and the emails are being delivered, but sometimes flagged as spam, depending on how sensitive the receiving email client is. My Yahoo account receives them fine; my Gmail account receives them but with a warning that sender can’t be confirmed. A third account sends them to spam.

The Zoho help files mentions the following, which may be the issue –

“In case you use webforms in your websites, which sends emails, the email sending server at your web-host, in most cases, tries to deliver the email locally, as the domain name in the ‘To Address’ matches with the domain name used with the website. Hence make sure that you configure ‘Remote Server’ for email delivery to ensure that you receive emails without any errors. Switch off any Local Host or Local email delivery configuration, which causes the emails to not reach the Zoho Mail servers at all.”

Does anyone have any ideas on how to set up my server to switch off local email delivery, or is this perhaps not the issue?

Thanks


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you don’t understand, read about it. You will learn by doing.

Perform a backup of some sort-- snapshot, web server block html folder, database, postfix folder.

I use the portable editions of WinSCP and PuTTY (have had issues with the DO QEMU console).

Digital Ocean Ubuntu NGINX Lemp droplet.

Zoho email service (ie external server).

Need to send email from a PHP form using mail() to an existing email address at Zoho.com.

No credentials required. Authenticates on DMARC, DKIM, SPF, reverse DNS.

  1. Name the droplet as the domain name. This updates the PTR for reverse lookup and HELO. Until I named my droplet with FQDN, the Zoho server gave ‘451 4.7.1 Greylisted’ errors.

Now NSLookup and ping -a return ‘domain.ext’ instead of ‘lemp-s-1vcpu-2gb-sfo2-01.’

  1. Set up DNS Records–

Substitute your domain name everywhere ‘domain.ext’ appears.

You will need A and AAAA records for both www.domain.ext and domain.ext.

Create a CNAME entry for Zoho login URL. For example: webmail.domain.ext to alias business.zoho.com.

https://www.digitalocean.com/docs/networking/dns/how-to/
  1. Configure Email Link Between DO and Zoho–

Use the link below to

  1. Add IP address to the SPF TXT record using the DO DNS manager–

v=spf1 ip4:dropletIPaddress include:zoho.com ~all

Authorizes Zoho to accept messages from stated ip address.
  1. Use the MX Tool Box site to test if desired–

    https://mxtoolbox.com/

  2. Install Postfix as the MTA (more secure than sendmail, widely used)–

    https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-18-04

  3. Modify Postfix Config–

First, open /etc/postfix/main.cf with a text editor like Nano.

Make the following changes and additions (Comment out the original entry with a leading # as backup.). Use your actual domain name in place of domain.ext.

myhostname = domain.ext

mydestination =

(The following three are for hardening Postfix security.)

inet_interfaces = loopback-only

disable_vrfy_command = yes

smtpd_helo_required = yes

Run 'service postfix reload' after saving the file to apply settings.

https://linux-audit.com/postfix-hardening-guide-for-security-and-privacy/

  1. Testing–

If you are confident in your PHP script, then visit the file with a web browser to trigger an email.

Otherwise, to simply test functionality of the PHP mail() command, download a free PHP mail test script.

Note any error messages if any. Look them up on the web for insight and explanation.

Check the mail.log file at /var/log/mail.log to aid in troubleshooting.

I uploaded the phpmailer code to my website and send mails via SMTP. https://github.com/PHPMailer/PHPMailer

Sample php code is at https://www.sitepoint.com/sending-emails-php-phpmailer/

PHPmailer solved my problem.