3

I'm trying to configure a Digital Ocean droplet to use my Gmail account's SMTP server to send outgoing mail, but I am getting the following error:

2015/12/15 22:15:33 [error] 14940#0: *31 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 173.245.54.200, server: kokorugs.com, request: "POST /wp-admin/options-general.php?page=swpsmtp_settings&w3tc_note=flush_pgcache HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "kokorugs.com", referrer: "https://kokorugs.com/wp-admin/options-general.php?page=swpsmtp_settings&w3tc_note=flush_pgcache"

I am running WordPress on HHVM & nginx.

The email is being sent by PHPMailer and this is the specific line which results in a timeout:

if ( ! $mail->Send() )

I've already configured my droplet to de-prioritize IPv6 NS lookups as described here.

If it matters, I'm also using CloudFlare.

What could be causing this timeout?

UPDATE: The email is sent just fine. But the server still times out.

Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158

1 Answers1

0

The problem was that I had no MTA installed on my Digital Ocean droplet.

I followed these instructions:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04

and set up postfix as a send-only smtp server.

Next, I set up a Google Apps SMTP Relay to allow emails to come from my Google Apps address.

This way, sent emails are saved on my gmail's sent folder and emails are much less likely to be marked as spam.

Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158