Drop connection when tcpserver -c limit is reached, Is it posible?

Jimmy Spam <[email protected]> Wed, 21 Jul 2010 15:06:21 +0200
Newsgroups gmane.mail.qmail.ldap
Message-ID <[email protected]>
Hi friends,

I know how limit the total concurrent connections that tcpserver can  
handle, but, Is it posible change its behavior to drop connection  
suddenly, instead of defer acceptance?

--------------------------------------------------------------------------------------------------------------
tcpserver:

-c n: Do not handle more than n simultaneous connections. If there are  
n simultaneous copies of prog running, defer acceptance of a new  
connection until one copy finishes. n must be a positive integer.  
Default: 40.
--------------------------------------------------------------------------------------------------------------

When my server receive too many connections, if tcpserver limit is  
reached, the new incoming connections are keep in SYN_RECV status,  
increasing permanently until my MX is KO.

I've notice that my old MX, with Kaspersky MailGateway, send a  
message: "421 4.3.1 mailhost.chg ESMTP Service not available, closing  
transmission channel", when too many connections arrive and with this  
action, keep the server up all time (only the smtp service it's down  
during few seconds/minutes per day).

I've thought that maybe it's a good idea send a "421 message" when  
tcpserver -c limit is reached, in combination with SMTP550DISCONNECT  
variable of qmail-ldap for keep the incoming concurrent connections  
and qmail-smtdp process at correct levels.

Any opinion/advice?

Thank you very much,
Spamis