Configure sendmail to smtp authenticate on port 1025

I am trying to configure sendmail to smtp authenticate on port 1025. In the past I successfully configured “Blat” on a Windows server to send emails with smtp authentication on port 1025.

I have configured other systems to smtp authenticate but I did not need to change the port.

I have creates a “client-info” file with the information and added the following to sendmail.mc :

FEATURE(authinfo',hash /etc/mail/auth/client-info’)dnl

I also changed the DAEMON_OPTIONS lines . I commented out the original and added a new line:

dnl DAEMON_OPTIONS(Port=smtp,Addr=127.0.0.1, Name=MTA')dnl DAEMON_OPTIONS(Port=1025,Addr=127.0.0.1, M=Ea, Name=MSA’)dnl

I added port 1025 , smtp and smtps via firewall-cmd

When I try to send an email via sendmail with the -v option I get:

brian@wisl.com… Connecting to [127.0.0.1] via relay…
brian@wisl.com… Deferred: Connection refused by [127.0.0.1]

When I set the DAEMON_OPTIONS back to the original it looks like it was sent but I never receive the email.

Can anyone see what I am missing?

Here is the output of the sendmail with the original options. (It would not let me post this originally because it thought I had more than two links. I changed 127.0.0.1 to 127,0,0,1 and the @ in email addresses to _ to get around the 2 link limit)

DAEMON_OPTIONS(Port=smtp,Addr=127,0,0,1, Name=MTA')dnl dnl DAEMON_OPTIONS(Port=1025,Addr=127,0,0,1, M=Ea, Name=MSA’)dnl

and attempt a sendmail with the -v option I get:

brian_wisl.com… Connecting to [127,0,0,1,] via relay…
220 FAIS.tempus.ca ESMTP Sendmail 8.16.1/8.16.1; Sun, 10 Aug 2025 09:18:23 -0400

EHLO xxxxxxx
250-xxxxxxx Hello localhost [127,0,0,1,], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-DELIVERBY
250 HELP
MAIL From:<admin_xxxxxxx> SIZE=123 AUTH=admin_xxxxxxx
250 2.1.0 <admin_xxxxxxx>… Sender ok
RCPT To:brian@wisl.com
DATA
250 2.1.5 <brian_wisl.com>… Recipient ok
354 Enter mail, end with “.” on a line by itself
.
250 2.0.0 57ADINoH018125 Message accepted for delivery
brian@wisl.com… Sent (57ADINoH018125 Message accepted for delivery)
Closing connection to [127,0,0,1,]
QUIT
221 2.0.0 xxxxxxx closing connection

You don’t need to change DAEMON_OPTIONS for this.
Leave the receive port as default and set the outgoing port to 1025 instead:

m4

define(`SMART_HOST', `smtp.relay.example')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 1025')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 1025')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl

Create /etc/mail/auth/client-info with your credentials, run makemap hash /etc/mail/auth/client-info < /etc/mail/auth/client-info,
then rebuild sendmail config (make -C /etc/mail) and restart sendmail.

This way, sendmail will connect to your relay on port 1025 with SMTP AUTH, without touching the inbound settings.

Hi @BrianParker!

Don’t mess with DAEMON_OPTIONS (it’s for the receiving port). Leave it at the default and set the outgoing port to 1025 to your smart host + AUTH.

define(`SMART_HOST', `smtp.relay.example')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 1025')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 1025')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl

All the best! :v:

Thank you both for the suggestion.

I made the changes but I still do not receive the emails.

Below are the lines from sendmail.mc (including all FEATURE lines)
define(SMART_HOST', ipaddress ‘)dnl
define(RELAY_MAILER_ARGS', TCP $h 1025’)dnl
define(ESMTP_MAILER_ARGS', TCP $h 1025’)dnl
…
DAEMON_OPTIONS(Port=smtp,Addr=127.0.0.1, Name=MTA')dnl ... FEATURE(authinfo’,hash -o /etc/mail/auth/client-info.db')dnl FEATURE(no_default_msa’, dnl')dnl FEATURE(smrsh’, /usr/sbin/smrsh')dnl FEATURE(mailertable’, hash -o /etc/mail/mailertable.db')dnl FEATURE(virtusertable’, `hash -o /etc/mail/virtusertable.db’)dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl

/etc/mail/auth/client-info is:
AuthInfo:ip_address “U:root” “I:user@domain” “P:password”

I performed the makemap hash and rebuilt the sendmail config.