I have been struggling with sendmail for couple of days with no luck. I am trying to setup relay host, after following the answers in this question
https://stackoverflow.com/questions/10359437/sendmail-how-to-configure-sendmail-on-ubuntu
I got 'DSN Service unavailable' in the log file. Now I am getting 'Connection refused by [127.0.0.1]'
What I am trying to do is sending emails from PHP application on the EC2 instance from another smtp server(smtp.mydomain.com) if that possible, what is the required configuration for sendmail and php.ini?
Thanks
Best Answer
DSN service unavailable sounds relay is not configured properly.
you can edit /etc/mail/sendmail.cf or /etc/sendmail.cf
And change
This mailserver_hostname should be resolved by your box, otherwise create host entry to point where that is supposed to go.
PS: Personal opinion i would use postfix with sasl relay:
Postmap main.cf / restart postfix
Additional:
Add hostname into your hostfile.. /etc/hosts As you are trying to do sasl relay you can rename your hostname from localhost to something else.
And please check this, Link