0

Sendmail not following smart_host alternative port macro.
Using Exchange server, exchange.redacted.com, we are using port 2525 for internal devices and some Linux based machines, allowing them send outgoing email without authentication. The 'receive connector' allows relay for devices on our intranet and external with explicit IP address authorization.
Linux based devices MTA is sendmail.

I edited /etc/mail/sendmail.mc adding:

define(`SMART_HOST',`relay:[exchange.redacted.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 2525')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 2525')dnl
define(`SMTP_MAILER_ARGS' , `TCP $h 2525')dnl
define(`SMTP8_MAILER_ARGS', `TCP $h 2525')dnl
define(`DSMTP_MAILER_ARGS', `TCP $h 2525')dnl

Just in case, I added all the _*MAILER_ARGS trying to specify the port to use with no success.

The generated sendmail.cf, shows the SMART_HOST selected but not the alternative port.

# "Smart" relay host (may be null)
DSrelay:[exchange.redacted.com]
...
Mrelay,     P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP/MasqRelay, E=\r\n, L=2040,
      T=DNS/RFC822/SMTP,
      A=TCP $h

modifying the Mrelay, adding 2525 works as intended:

Mrelay,     P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP/MasqRelay, E=\r\n, L=2040,
      T=DNS/RFC822/SMTP,
      A=TCP $h 2525

How can I specify the port on the .mc source without the need of a manual edit the resultant .cf?

3
  • Have you defined RELAY_MAILER_ARGS in sendmail.mc file before MAILER(smtp)? [The trivial reason to rule out before checking more sinister exaplanations]
    – AnFi
    Commented Sep 23, 2020 at 6:02
  • yes. I did. I place it at the top. In fact, looks like the the only MAILER_ARGS processed is SMTP_MAILER_ARGS. I check also smtp.m4 and I can't find a good reason to fail
    – fcm
    Commented Sep 23, 2020 at 14:14
  • 1
    Try to get help via news:comp.mail.sendmail
    – AnFi
    Commented Sep 23, 2020 at 17:08

1 Answer 1

0

You need to edit your sendmail.mc file by adding the following line.

define(`SMART_HOST', `host.domain.com')dnl
define(`RELAY_MAILER_ARGS',`TCP $h 2525')
dnl # Above line for Smart Relay to use Port 2525 instead of 25

Make sure to change the first line to the relay server hostname domain that is running SMTP Port 2525.

Run the following command in your /etc/mail directory to update your sendmail.cf

m4 sendmail.mc > sendmail.cf 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .