I am configuring my server to use relay server to send mail. I made the following entries in /etc/mail/sendmail.mc
define(`SMART_HOST', `corprelay.example.com')dnl
MASQUERADE_AS(`example.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
systemctl restart sendmail
I am getting the following error in maillogs and mails are getting deferred:
Sep 28 08:00:51 ve4-fsdb-l-p01 sendmail[3242]: 18SC0pTv003242: from=ram, size=229, class=0, nrcpts=1, msgid=<[email protected]>, relay=ram@localhost
Sep 28 08:00:51 ve4-fsdb-l-p01 sendmail[3243]: 18SC0peL003243: from=<[email protected]>, size=521, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Sep 28 08:00:51 ve4-fsdb-l-p01 sendmail[3242]: 18SC0pTv003242: [email protected], ctladdr=ram (1011/1011), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30229, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (18SC0peL003243 Message accepted for delivery)
Sep 28 08:05:51 ve4-fsdb-l-p01 sendmail[3245]: 18SC0peL003243: timeout waiting for input from corprelay.example.com. during client greeting
Sep 28 08:05:51 ve4-fsdb-l-p01 sendmail[3245]: 18SC0peL003243: to=<[email protected]>, ctladdr=<[email protected]> (1011/1011), delay=00:05:00, xdelay=00:05:00, mailer=relay, pri=120521, relay=corprelay.example.com. [20.11.7.5], dsn=4.0.0, stat=Deferred: Connection timed out with corprelay.example.com.
Note: IPs and hostname are dummy.
Thanks and regards