Score:0

configuring sendmail to send mail through relay server in Oracle Linux 7.7

fr flag
d.s

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

in flag
Timeouts usually point toward firewall issues.
Michael Hampton avatar
cz flag
Your config seems OK. I think it's time to talk to whoever runs corprelay.... and find out if they are firewalling you.
d.s avatar
fr flag
d.s
But I am able to telnet to port 25 of the corprelay server.
Score:0
fr flag
d.s

Firewall was blocking the sendmail traffic. Once the firewall rule was in place for port 25, sendmail started working. Surprisingly I was able to telnet on port 25, but I was not able to send the mail using telnet before it was allowed on firewall.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.