Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Port 25 failure - RedHat 2.4.20 kernel 2

Status
Not open for further replies.

srwagner

Programmer
Aug 22, 2003
9
US
I am (or was) running sendmail 8.11.6 on a 2.4.20 kernel (Red Hat Linux 7.3). The installation has been running without problems for many months.

A few days ago, upon reboot, sendmail began failing with the following entries in maillog:

Aug 21 12:12:40 mymachine sendmail[2421]: starting daemon (8.11.6): SMTP+queueing@01:00:00
Aug 21 12:12:40 mymachine sendmail[2421]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Cannot assign requested address

(Note - the following are done with sendmail disabled.)
Port 25 behaves the same on all interfaces (lo:, eth0:, and eth1:)
Behavior does not change whether iptables are on or off.
netstat -an shows no reference at all to Port 25.
Not surprisingly, telnetting to Port 25 (on any interface) fails.
nmap -sS -p 25 -vv localhost reports Port 25 closed.
Attempts to hook services other than an MTA to Port 25 are unsuccessful. (I tried httpd, telnetd, and ftpd.)
Attempts to port forward Port 25 do not work. (I tried NAT forwarding Port 25 to a printer httpd port on my network - no success. However, NAT forwarding Port 26 to the printer httpd port worked fine.)

Does anyone have any ideas? Thanks in advance!
 
You can turn off your iptable and enable back sendmail.
And you can telnet to port 25.
If that isn't a problem.You check your iptable rules again.
Good Luck...:)
 
Sorry - I was not very clear on this ...

One of the first things I did was to turn off all firewalling (stop iptables, check to be sure all firewalling rules were flushed.) The port 25 problem is the same whether iptables are applied or completely cleared (flushed).

-Scott Wagner
 
Sorry,I meant you still got a problem.You check the iptables rules again.
Did you check your dns for your sendmail ?
What can I read this message below here ?

Aug 21 12:12:40 mymachine sendmail[2421]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Cannot assign requested address

Did you install any anti spam program into your sendmail before you did the reboot ?
 
>Did you check your dns for your sendmail ?
Has not changed since sendmail was working.
>What can I read this message below here ?
This is an excerpt from /var/log/maillog. (The machine name has been changed.)
>Did you install any anti spam program into your sendmail before you did the reboot ?
No anti-spam stuff. Unmodified (except for site configuration) sendmail - I even tried uninstalling sendmail, downloading a fresh RPM, and reinstalling.
 
Just a stabb in the dark, check your /etc/services file has not been changed (by someone/something) look for port 25

ssh 22/udp # SSH Remote Login Protocol
telnet 23/tcp
telnet 23/udp
# 24 - private mail system
smtp 25/tcp mail
smtp 25/udp mail
time 37/tcp timserver
time 37/udp timserver

Sounds strange to me !!

Laurie
 
/etc/services looks OK (it matches the excerpt posted.)
-Scott Wagner
 
haven't you changed ip before the reboot? maybe the sendmail daemon is bound to the old ip in its configs
 
I don't think so. eth0: ip has not changed, and (of course) lo: ip has not changed. eth1: is acquired by DHCP, and is of course subject to change, but 1) changes in assigned ip have not affected me previously, and 2) assigned ip did not change on this reboot.

Please note that it seems nothing can bind to Port 25 - even when I shut off sendmail and try to experimentally bind to Port 25 with another service, it does not work.
 
Whats your routing table look like?

netstat -rn

Also as 'piti' says check your sendmail files:

Search for DAEMON_OPTIONS in your .mc file or DaemonPortOptions in your .cf file and see if one of them has "Addr=a.b.c.d", where "a.b.c.d" is an old IP address different to what you have (ifconfig).

Good Luck,
Laurie.
 
Thanks to piti and tarn!

(note that I mangled the IPs below for security reasons!)
There was an entry in sendmail.cf:

O DaemonPortOptions=Port=smtp,Addr=634.615.608.641, Name=MTA

which was different from the current eth1: address 734.745.712.726 .

When I changed sendmail.cf to match the eth1: ip, everything began working.

This still leaves two questions ...
1) How do I keep DaemonPortOptions synchronized with the DHCP-assigned ip address on eth1: ?
2) (mostly philosophical) Why was I unable to bind anything else on Port 25

I'm now convinced that these forums are worthwhile; I'll check them and see if I can help others periodically from now on. Thanks for helping me out!

By the way,
$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
734.745.712.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 734.745.712.1 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 192.168.10.10 0.0.0.0 UG 0 0 0 eth0
 
Ok try this:

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

Thats what I have in my test machines here .... try it and see how you go.......

I also thought of trying 0.0.0.0 which would indicate "everything" ?

But that would be trial and error.

Worst come to worst you could script an IP check and search & replace with: perl -pi -e 's/..... sendmail.cf and slap the current IP address in then restart sendmail ?????

Now thats a nice little UK Bank Holiday project for you!!

Good luck let me know how you get on,

Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top