SendMail: Connection refused by [127.0.0.1]

I followed the procedure to Integrate Amazon SES with Sendmail in Ubuntu as given in the guide. The error log at /var/log/mail.log shows this error:

Apr 26 18:57:42 ABC sendmail[21040]: 33QDRMnm021040: to=demo@gmail.com, ct laddr=admin@demo.com (0/0), delay=00:00:20, xdelay=00:00:00, mailer=relay, pri=30060, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

This error was caused by the wrong placement of the code:

define(`SMART_HOST', `email-smtp.ap-south-1.amazonaws.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 25')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
FEATURE(`authinfo', `hash -o /etc/mail/authinfo.db')dnl
MASQUERADE_AS(`demo.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl

in the file /etc/mail/sendmail.mc

The code should be put in the bottom before the code

MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl

Leave a Reply

Your email address will not be published. Required fields are marked *