I have an EC2 instance running Magento. I'm trying to get AWS SES set up so that we can send transactional emails to customers and to our staff internally, however, I keep getting timeout errors.
The domain is set up and verified in SES, I have an SMTP user configured. The server is running Debian 10 and Sendmail as its MTA. Sendmail is configured to use SES' SMTP user credentials for sending mail.
Trying to send a test email via command line gives this result:
/usr/sbin/sendmail -vf [email protected] [email protected]
From: [email protected]
To: [email protected]
Subject: AWS SES test email
This is a test message sent from SES using Sendmail
Results:
[email protected]... Connecting to [127.0.0.1] via relay... 220
mta.example-domain.com ESMTP Sendmail 8.15.2/8.15.2/Debian-14~deb10u1;
Tue, 19 Oct 2021 00:23:05 -0400; (No UCE/UBE) logging access from:
localhost(OK)-localhost [127.0.0.1]
EHLO mta.example-domain.com 250-mta.example-domain.com Hello localhost [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES
250-PIPELINING 250-EXPN 250-VERB 250-8BITMIME 250-SIZE 250-DSN
250-ETRN 250-AUTH DIGEST-MD5 CRAM-MD5 250-DELIVERBY 250 HELP
VERB 250 2.0.0 Verbose mode
MAIL From:<[email protected]> SIZE=136 [email protected] 250 2.1.0 <[email protected]>...
Sender ok
RCPT To:<[email protected]>
DATA 250 2.1.5 <[email protected]>... Recipient ok 354 Enter mail, end with "." on a line by itself
.
050 <[email protected]>... Connecting to aspmx.l.google.com. via esmtp... 050 <[email protected]>... Connecting to
alt1.aspmx.l.google.com. via esmtp... 050 <[email protected]>...
Connecting to alt2.aspmx.l.google.com. via esmtp... 050
<[email protected]>... Connecting to alt3.aspmx.l.google.com. via
esmtp... 050 <[email protected]>... Connecting to
alt4.aspmx.l.google.com. via esmtp... 050 <[email protected]>...
Deferred: Connection timed out with alt4.aspmx.l.google.com. 250 2.0.0
19J4N5Q0004977 Message accepted for delivery [email protected]...
Sent (19J4N5Q0004977 Message accepted for delivery) Closing connection
to [127.0.0.1]
QUIT 221 2.0.0 mta.example-domain.com closing connection
If I try to telnet from the server to the SES endpoint, I get this:
telnet email-smtp.us-east-1.amazonaws.com 587
Trying 34.194.114.91...
Connected to email-smtp.us-east-1.amazonaws.com.
Escape character is '^]'.
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-31RAO5EPD a2sb2LhwUqPVXiyXQJod
451 4.4.2 Timeout waiting for data from client.
Connection closed by foreign host.
In my EC2 instance currently, I have all ports open for inbound and outbound traffic (not ideal, I know, but this is temporary until I can figure this thing out). I'm completely at a loss for what's happening here. Any help is greatly appreciated!