• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 116265, created on Jun 13, 2013, last review on Aug 12, 2014

  • Applies to:
  • Operations Automation 5.x

Symptoms

Duplicate email messages are received by clients in the qmail environment. The following messages are extensively logged in /var/log/maillog:
--<<--------------------------------
Jan 17 12:09:46 qm07 splogger: 1295233786.151853 delivery 155804: deferral: Connected_to_10.1.11.206_but_connection_died._(#4.4.2)/
-->>--------------------------------

Cause

The xinetd daemon is listening to port 25 on the qmail server. When an external client connects (e.g., via the other relay server) to this port, the daemon invokes the tcp-env program and passes the arguments to start qmail-smtpd, passing the established network connection as the standard input/output to that process.

Then, the execution chain is as follows: tcp-env -> qmail-smtpd -> qmail-queue

At the last point, the message is put into the mail queue and this connection in closed. Duplicate messages may appear due to connection timeouts. If there is an error with delivery, another suitable mail server will be used to send the message. Since the email message was actually received, but the connection was not closed in the proper way, the mail message might be put in the queue anyway and processed twice (either by different servers or in consequent sessions).

Resolution

Network connections may not be closed properly due to a high network load. The amount of simultaneous network connections may hit 3000+ for a single qmail host, which may have not enough TCP buffers for such a load:
--<<-----------------------------------------
net.ipv4.tcp_mem = 90112        94208   98304
-->>-----------------------------------------
In such cases, it would be better to increase the values to these:
--<<-------------------------------------------------------
    # sysctl -w net.ipv4.tcp_mem="8388608 1048576 12582912"
-->>-------------------------------------------------------
If qmail is running inside of Virtuozzo containers, one must apply these values to the VPS Hardware Node and restart the Virtuozzo service for the changes to take effect. See https://kb.odin.com/en/111197 for more info. To have these settings applied on the boot, put them in the /etc/sysctl.conf file.

2554725ed606193dd9bbce21365bed4e caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF