I'm trying to send/receive emails on my AWS Ubuntu box. To do so, I'm following the instructions posted by Amazon here. (I skipped the section entitled "To configure integration using a secure tunnel")
However, I'm still unable to send any emails. When I try to send an email to my.user@gmail.com
, it fails:
local_user@ip-172-XXX-XXX-XXX:~$ netcat mydomain.com 25
220 mydomain.com ESMTP Postfix (Ubuntu)
ehlo mydomain.com
250-mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root@mydomain.com
250 2.1.0 Ok
rcpt to: my.user@gmail.com
454 4.7.1 <my.user@gmail.com>: Relay access denied
Here is what log file shows:
$ sudo tail -F /var/log/mail.log
Oct 17 18:06:10 ip-172-XXX-XXX-XXX postfix/smtpd[22869]: warning: hostname ec2-54-XXX-XXX-XXX.us-west-2.compute.amazonaws.com does not resolve to address 54.XXX.XXX.XXX
Oct 17 18:06:10 ip-172-XXX-XXX-XXX postfix/smtpd[22869]: connect from unknown[54.XXX.XXX.XXX]
Oct 17 18:06:31 ip-172-XXX-XXX-XXX postfix/smtpd[22869]: NOQUEUE: reject: RCPT from unknown[54.XXX.XXX.XXX]: 454 4.7.1 <my.user@gmail.com>: Relay access denied; from=<root@mydomain.com> to=<my.user@gmail.com> proto=ESMTP helo=<mydomain.com>
How can I fix this? What is the problem? Please note that my EC2 is in AWS's US West (Oregon)
region. But I have set the relay host to email-smtp.us-east-1.amazonaws.com:25
in the main.cf
file. Is that the issue? I don't think it is.
My main.cf file is posted here