Have configured postfix on an EC2 instance. Can send and receive emails locally. Have also configured SES, with verified domain. Outgoing works perfectly well. However, receiving mail to SES returns
<[email protected]>: host inbound-smtp.eu-west-1.amazonaws.com[176.32.109.132]
said: 550 5.1.1 Requested action not taken: mailbox unavailable (in reply
to RCPT TO command)
No entry is shown in the postfix log, so I suspect SES is not even trying to talk to my EC2 instance.
dig MX mydomain.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> MX mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1395
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mydomain.com. IN MX
;; ANSWER SECTION:
mydomain.com. 60 IN MX 10 inbound-smtp.eu-west-1.amazonaws.com.
;; Query time: 77 msec
;; SERVER: 172.31.0.2#53(172.31.0.2)
;; WHEN: Thu Jan 04 13:32:12 UTC 2018
;; MSG SIZE rcvd: 95
dig mydomain.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51289
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mydomain.com. IN A
;; ANSWER SECTION:
mydomain.com. 34 IN A 52.50.184.26
;; Query time: 0 msec
;; SERVER: 172.31.0.2#53(172.31.0.2)
;; WHEN: Thu Jan 04 13:34:10 UTC 2018
;; MSG SIZE rcvd: 59
I have port 25 open for inbound traffic. I can telnet to it from home. Replace mydomain.com with kummelvagen.se unless you are an evil bot.
What am I missing?
Based on the question and its comments I get the impression that there is some confusion regarding the role of SES at the core of this.
From my understanding of your goal (sending outbound mail through SES, getting inbound mail delivered to your own custom postfix mail server) the obvious solution would be to point the
MX
record at your EC2 instance running postfix instead of at SES, using SES for outbound mail only.If you actually want to use SES for inbound, I believe you may need some custom code deployed in an AWS Lambda (or some other similar solution) to handle the delivery to your own server. See Amazon SES Email-Receiving Concepts for details.