Qmail Send Mail Queue Problems

 

 

I have had a hard time dealing with a Qmail SMTP server today.  The sendmail queue had stacked up to 14 000 mails and over 1000 in preprocessing. 

I tried to speed up the pace a bit by increasing the amount of emails handled at the same time.

Qmails default number for handling this is 20 when sending to remote hosts. You can easily increase the amount by changing the number in a file called concurrencyremote located in /var/qmail/control

This file is not in the directory by default so you have to create it.

Increase the amount to suit your need. If your server is handling a large amount of emails every second you should be able to increase the amount to 200 or higher. In this case I set it to 255.

You must also restart your inetd.conf deamon by entering.

killall -HUP inetd

Emails slowly but steady emptied the queue line in about 3500 emails an hour. thats about one email every second, not so very good but since the server is not a dedicated mail server and has a antivirus is running on the mails and the server does a reverse DNS lookup on the hostname it takes some time to process every email.

A solution for disabling DNS reverse lookups is to add a parameter in /etc/inetd.conf

The original config looks like this on a Debian Etch server.

smtp stream tcp nowait.1000 root /var/qmail/bin/tcp-env tcp-env /usr/bin/env SMTPAUTH=1 END=1 /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

Add -Rt0 after tcp-env and the line should look like this:

smtp stream tcp nowait.1000 root /var/qmail/bin/tcp-env tcp-env -Rt0 /usr/bin/env SMTPAUTH=1 END=1 /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

The emails flowed out a much faster pace but still not as fast as I wanted to. But when there was about 1200 mails left, the server stopped sending mails. I thought it had clogged again and i set out to find a solution for this. 

After several hours of troubleshooting I looked at the mailing-queue and found that all the emails left had some strange hostnames, like @homail.com and @hotnail.com, there obviously was something wrong with the adresses.

By looking at the logs in /var/log/mail.info took the conclusion that the Qmail weren't able to send to these adresses so anyway i checked  the Qmail config and saw that the wait time for throwing failed massages was over two weeks long, this was solved by setting a much shorter time span.

Always check the logs first.