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!

smtp connections not closing

Status
Not open for further replies.

perfectom

MIS
Mar 28, 2002
1
US
Hello there - I'm having a problem with connections going in and out from my qmail server. Basically, I have a lot connections being opened to qmail to send email, but they're not closing. Therefore, my max number of connections (currently 120 - the maximum allowed, I believe) is maxing out after a while.
Let me briefly describe our setup: We have a qmail server on our DMZ doing two things: a) receiving mail from the outside world and relaying it to another mail server "inside", and b) relaying messages back out.
My number of remote connections will max out at 120/120 after a period of time. When I do a netstat, I see a lot of connections ESTABLISHED from a particular IP (around 100), but these connections are not closing to allow new connections. My only guess at this point is that my server needs to be smarter (?) about closing connections.
I'm temporarily blocking connections to the remote offending mail server, but people need to get things from that server eventually.
The server is redhat 7.2 running qmail.

Anyone got any ideas? :)

Thanks in advance :)
Tom Klopf
 
Definitely something wrong here. Check you smtp run script. Should be in /var/qmail/supervise/qmail-smtpd/run. It should look something like this. (Sorry about the poor text wrapping)


#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" ]; then
echo QMAILDUID, NOFILESGID, or MAXSMTPD is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
exec /usr/local/bin/softlimit -m 2000000 /usr/local/bin/tcpserver -v -R -l 0 -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1

Also check your tcpserver to see if it's running correctly. Qmail should have no problem handling this amount of traffic.
 
the -l 0 -H and -P flags will help a great deal with tcpserver.. as far as not reversing IP's or Hosts..
or doing IDENT requests etc.. try putting those into place
and restarting qmail-smtpd

Nick
 
sorry made a typo with the -P option..
here is an example.. this is my process listing
for qmail-smtpd under tcpserver

/usr/local/bin/tcpserver -v -R
-l 0 -x /home/vpopmail/etc/tcp.smtp.cdb -c 20 -u 514 -g 507 0 smtp


the -l 0 is an L

hope this helps!

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top