1

The Amazon SES account is verified. I have sent emails from gmail using an alias that is the same address I'm using in CiviCRM, and the emails originating from gmail were delivered. But when I send a test email from Administer > System Settings > Outbound Email I consistently get a timeout error, like this:

Mail Not Sent
  Sending test email. FROM: info@mysite.org TO: verified@gmail.com.
  No test mail has been sent.

  An error occurred when CiviCRM attempted to send an email (via SMTP).

  The mail library returned the following error message:
  Failed to connect to ssl://email-smtp.us-west-2.amazonaws.com:587 [SMTP:
  Failed to connect socket: Connection timed out (code: -1, response: )]

Trying to figure out what the problem might be. I'm wondering if I might need an SPF record for my domain (mysite.org in the example above)?

1

An SPF record is recommended, but not the cause of the above error.

That error message indicates failure to make a network connection from CiviCRM's mail library to the configured SMTP server.

According to http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html, port 587 is for STARTTLS connections. ("TLS" is an overloaded term used in a confusing sense here, don't sweat it.)

It looks like you currently have a value of ssl://email-smtp.us-west-2.amazonaws.com:587 in your Admin > System Settings > Outbound Email > SMTP Server field.

I suggest you try using the following - please report back if one or both work?

  • tls://email-smtp.us-west-2.amazonaws.com:587
  • ssl://email-smtp.us-west-2.amazonaws.com:465

I see that for optimal performance, Palante recommend using a local Postfix MTA which then routes email to Amazon SES. Make special note of the SMTP throttling warning at the bottom of that page.

|improve this answer|||||
  • Thanks for the suggestions, Chris. I had already tried ssl:// with both ports (as well as port 25). I have now tried tls:// with both ports. Unfortunately, the result is the same: the timeout error. I am on a shared server at 1and1, and don't think postfix is an option for me -- but perhaps I'm wrong on that? – user1147171 Apr 29 '17 at 4:34
  • Sorry, I don't know. I didn't even realise SES was available outside Amazon network, but now I know otherwise! You might be hitting some network limits from 1and1, or something else ... If no-one else has the answer, I think your best bet will be to engage a developer who can debug it for you or to talk with 1and1 about your options. Shared hosting environments can be limiting for CiviCRM, so getting expert support may really help. – Chris Burgess Apr 29 '17 at 20:15
  • To debug further: If you have SSH access, I'd try using openssl s_client (example) to connect directly from your webhost to SES - just to establish that the connection can be made. If you lack that, I'd try some other SMTP method from the same hosting environment (eg Drupal SMTP module, or an equivalent). – Chris Burgess Apr 29 '17 at 20:17
  • 1
    It turns out that our hosting company, 1and1, blocks SMTP other than their own. That explains all the connection timeouts. – user1147171 May 1 '17 at 5:10
  • Related question: civicrm.stackexchange.com/questions/18406/… – Chris Burgess May 2 '17 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.