IBM Support

IBM AIX: How to configure sendmail daemon to listen on a different port than port 25

Troubleshooting


Problem

 For security reasons, a user might need to configure sendmail daemon to listen on a different port than port 25.

Cause

By default, sendmail daemon on AIX® is configured to listen on port 25.
To verify the port that sendmail daemon is listening on, first check if sendmail daemon is active and listening or not:

# lssrc -s sendmail
Subsystem         Group            PID          Status
 sendmail         mail             2621550      active

If not active, start sendmail daemon:

# startsrc -s sendmail -a "-bd -q30m"
0513-059 The sendmail Subsystem has been started. Subsystem PID is 2621550.

And check the port that sendmail listens on by using the following commands:

# netstat -Aan | grep *.25            
f1000e000425cbb8 tcp4       0      0  *.25                  *.*                   LISTEN
# rmsock f1000e000425cbb8 tcpcb
The socket 0xf1000e000425c808 is being held by proccess 2621550 (sendmail).

Resolving The Problem

To configure sendmail daemon to listen on a different port(say 25000) than port 25, follow these steps.

1. Edit DaemonPortOptions line in /etc/mail/sendmail.cf:
# vi /etc/mail/sendmail.cf
Change this line from:
O DaemonPortOptions=Name=MTA

Change the line to:
O DaemonPortOptions=Name=MTA,Port=25000
2. Or edit /etc/services and change the smtp lines:
# vi /etc/services
Change these lines from:
smtp                    25/tcp          # Simple Mail Transfer
smtp                    25/udp          # Simple Mail Transfer
To set sendmail port to listen on a different port(say 25000), change these lines to:
smtp                    25000/tcp          # Simple Mail Transfer
smtp                    25000/udp          # Simple Mail Transfer
When the sendmail port configuration in /etc/mail/sendmail.cf and /etc/services is set to different ports, the configuration in /etc/mail/sendmail.cf takes precedence.
3. Stop and restart sendmail for the changes to take effect.
# stopsrc -s sendmail
# startsrc -s sendmail -a " -bd -q30m"
4. Verify the port that sendmail daemon is listening on:
# netstat -Aan | grep *.25            
f1000e0003cb83b8 tcp4       0      0  *.25000               *.*                   LIST
# rmsock f1000e0003cb83b8 tcpcb       
The socket 0xf1000e0003cb8008 is being held by proccess 2621548 (sendmail).

Sendmail daemon should be now listening on the desired port.

SUPPORT:

If the instructions in this document do not lead to resolution of the problem, follow these instructions to open a case.  The product must be under warranty or have an active and valid support contract.

a.  Document or take screen captures of all symptoms, errors, or messages.

b.  Capture any logs or data relevant to the issue.

c.  Contact IBM to open a case.

   -For electronic support, visit the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, visit this web page:
      https://www.ibm.com/planetwide/

d.  Provide a detailed description of the issue and reference this technote.

e.  Upload all of the details and data to the case.

   -You can attach files to the case in the IBM Support Community, or
   -Upload data to IBM test case server analysis at this URL:

    http://www.ibm.com/support/docview.wss?uid=ibm10733581

f.  Click here to submit feedback for this document.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
02 October 2020

UID

ibm16339031