[svlug] sendmail NOOP slowdown

Aleksandr Miroslav alexmiroslav at gmail.com
Mon Feb 11 09:32:02 PST 2013


I have a sendmail issue (8.13 running on CentOS 5) that I need some
assistance with.

We have some code that sends out emails to our customers. The way our
code is currently written, it uses the SMTP NOOP command to see if the
connection is still open. We deployed it over the weekend and
everything worked, but we noticed that emails were being sent out
*very* slowly, at the rate of one every 4 minutes.

After a lot of debugging, it turns out that sendmail, after about 20
NOOP commands, starts delaying the responses to these, 1 second, 2
seconds, 4 seconds, etc., up until 4 minutes. This is an antispam
feature apparently.

Apparently, there is a build time parameter (MAXNOOPCOMMANDS) than can
tune this, but we are running on a production system and we'd rather
not recompile sendmail. In the future, we are going to rewrite this to
just inject emails directly to /usr/sbin/sendmail, so this won't be a

What is a problem right now is the code that is actively running. We
need to flush out everything we have.

Is there anyway to tune sendmail to allow these to go through right
now? The only option I see is to kill -hup the sendmail child every 2
minutes or so, the client code then restarts a new connection and
sends out a bunch more emails before being tarpitted again (we have
about 4k emails left to send out), this would flush the queue in a
couple of hours.

But that's a very ugly solution. I wonder if there is something
cleaner we can do.


More information about the svlug mailing list