Qmail delays in sending mail

Q I have been experiencing delays in sending mail through my Qmail-enabled mail server. I have tried to make things go faster, but to no avail. Could you give me a list of things to check that might be causing the delays?

A The most common reason behind delays is DNS lookups. First and foremost, please make sure that the server's hostname is resolvable. Also, a PTR record should be created for the IP address that the server uses to send mail out on. You could even speed up lookups by running your own local caching name server. Optionally, you might want to disable DNS lookups altogether. If you run qmail-smtpd through the tcpserver wrapper script you should add the -H flag to its options, so that it doesn't look up the remote host name in DNS; and remove the environment variable $TCPREMOTEHOST.

To avoid loops, you must use this option for servers on TCP port 53. If you're not, you're probably running it through inetd/xinetd; you might want to add the -Rt0 flags to your configuration, under server_args in your inetd/xinetd configuration file. That will prevent Qmail from performing ident requests when an SMTP connection is established. When it does, it manifests itself by causing a delay between the TCP connection being established and the banner being displayed. On a related issue, if you have a queue that is constantly filled to the brim, you might want to add the file /var/qmail/control/queuelifetime and set it lower than the default of seven days, which means that emails that soft bounce will be retried for a week. A value of one to two days is more reasonable. These steps should reduce the time Qmail takes to display the banner.

Back to the list