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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail keeps hanging

Status
Not open for further replies.

Stinney

IS-IT--Management
Nov 29, 2004
2,029
US

For some reason, sendmail is hanging. If I restart it, all of the mail that's queued will send, but then at no specific time or noticible event, it hangs. I have to kill the process and stop and start it again.

I barely figured out how to set it up, so I'm at a loss as to where to start looking.

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 

What is the line in sendmail.cf
O DaemonPortOptions

I am really at a loss. Even if it were DHCP, I believe it doesn't rebind until you stop/start the daemon, and usually sendmail binds on * or all IPs. (I don't have much experience in this area because our Solari are all static).

Are you running any virus scanners like mailscanner? Once sendmail got port 25, others should bounce on binding.

I'd look at crontab just in case someone put something in there to "refresh" sendmail.
 
Mail continued to "dump" every hour on the hour.

Not using DHCP.


# SMTP daemon options
O DaemonPortOptions=Name=MTA-v4, Family=inet
O DaemonPortOptions=Name=MTA-v6, Family=inet6
O DaemonPortOptions=Port=587, Name=MSA, M=E

I may be able to enlist some UNIX talent on site. If I can and they can figure out what's going on, I'll make sure to post it.

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
Yeah, what you are seeing isn't normal for any simple sendmail install. If it died with cause, it would log it. What I normally do in this case is use script, and use truss with the -f option to trace it out or see if it receive a signal or is dumping core.
 
Good catches on the load average causing mail delays. I ran into this recently and it caused me all sorts of grief.

I'm guessing that you have your sendmail locked down. This typically isn't a bad idea, but it is unable to send mail to/through itself.

Check out this website:

I'd recommend the "Outgoing Only" server.

Also, do you have a relay mailer? For instance is there a specific server that you're supposed to be sending all mail through? If so, change your "DS" value in your mail config file (after you've finished configuring this for an outgoing only server).

# "Smart" relay host (may be null)
DSsmtp-relay.your-domain.com

This last part isn't always necessary.
 

Could trusted-users be an issue here?

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
Oh, and you can find out if your system is accepting sendmail connections just by doing the following from the server:

telnet localhost 25

If you get "telnet: connect: A remote host refused an attempted connect operation.", sendmail is not accepting local connections.

You can also see if it is accepting connections from other servers (not recommended unless this server needs to receive mail from an external source).

telnet server-dns-name 25

An "insecure" server will tell you all sorts of useful information about the system:
* hostname
* sendmail version
 
I don't think so, (trusted-user) because that would not make the daemon die. Since you've seen it up with the -bd, the only reason internally would be dumping core and externally if someone is sending it a signal, like with pkill. When the daemon is running, do a "netstat -an | grep 25 | grep LIST" to see what addresses it is bound. (It should be * or 127.0.0.1.

 

spamly,

sendmail.cf file has "Smart" relay host information.

When it's running the telnet localhost 25 produces this:

Connected to localhost.
Escape character is '^]'.
220 *hostname removed*.tempdomain.org ESMTP Sendmail 8.13.6+Sun/8.13.6; Wed, 9 Apr 2008 18:09:29 -0400 (EDT)


telnet server-dns-name 25 returns:

server-dns-name: Unknown host



elgrandeperro,

I've never used truss before. Is the script you use a simple enough script to post here so I can copy and paste it?

This is what the netstat produced:


*.25 *.* 0 0 49152 0 LISTEN
*.25 *.* 0 0 49152 0 LISTEN
*.25 *.* 0 0 49152 0 LISTEN


I was reading some documentation could:

O DaemonPortOptions=Port=587, Name=MSA, M=E

be an issue? Should it be Port 25?


- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
That is there for MSA (message submission agent) but is only enabled with feature msp. I think the default does not enable it.

You have 3 processes listening on port 25! Kill your sendmail and see how many go away!

Then you can use lsof (I can never remember the options, but I just run lsof > /tmp/lsof.out and look for port 25 listening sockets).

You might have other sendmails or other MTAs trying to get port 25 than you know.




 

If I stop sendmail all processes listening on port 25 go away. If I restart all 3 come back.

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 

If I ps -ef | grep send I see this:

smmsp 28475 1 0 18:47:16 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 28476 1 0 18:47:16 ? 0:00 /usr/lib/sendmail -bd -q15m

Is it normal for root and smmsp to be executing sendmail?

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
any children of 28476 or 28475?

ps -ef | grep 28476
ps -ef | grep 28475

Can someone verify that a generic sendmail has 3 listens? There should only be one, the one with the -bd option.

If you install lsof, you can get a list of processes and files open and you should be able to see what is listening on 25. There is probably a way to use pfile to do the same thing but I trust lsof more.
 
elgrandeperro said:
Then you can use lsof (I can never remember the options, but I just run lsof > /tmp/lsof.out and look for port 25 listening sockets).

This should do it:

[tt]lsof -i :25[/tt]

Annihilannic.
 

How crazy is this? I stopped sendmail, verified no processes of sendmail running using ps -ef | grep send.

I left the cron job running and I'm still getting the hourly dump of email messages, even though sendmail isn't running.

How is that possible?

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
You don't need sendmail (daemon mode) to be running in order to get mail to flow out.
mailx (I assume that is what you are using) will invoke sendmail to deliver ( i believe it uses the /etc/mail/submit.cf configuration)

Or one can also invoke sendmail on the command line to send mail, directly.

The only problem is that the resend/requeue function will not be enabled (if your relay is down, it wil not retry) because one needs either the daemon or to periodically invoke a queue runner. You can do this via crontab.

Reread that link about setting up outgoing only, that is one way to avoid daemon mode.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top