Duplicate messages are received by qmail users

Created:

2017-01-05 13:50:01 UTC

Modified:

2017-08-08 13:40:59 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Duplicate messages are received by qmail users

Applicable to:

  • Plesk 12.0 for Linux

Symptoms

  • Duplicate email messages are received by clients in the qmail environment. The following messages are extensively logged in /var/log/maillog:
    /var/log/maillog:Jan 5 04:07:06 dynamic-test qmail: 1483560426.115054 delivery 12779: deferral: Connected_to_203.0.113.2_but_connection_died._(#4.4.2)/
    /var/log/maillog:Jan 5 05:47:06 dynamic-test qmail: 1483566426.544448 delivery 13056: deferral: Connected_to_203.0.113.2_but_connection_died._(#4.4.2)/
    /var/log/maillog:Jan 5 07:40:24 dynamic-test qmail: 1483573224.752836 delivery 42: deferral: Connected_to_203.0.113.2_but_connection_died._(#4.4.2)/
    /var/log/maillog:Jan 5 09:47:07 dynamic-test qmail: 1483580827.204381 delivery 240: deferral: Connected_to_203.0.113.2_but_connection_died._(#4.4.2)/
  • Server is running under OpenVZ containter.

Cause

UCB parameters were incorrectly configured. Failcounters exist.

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. Check it using:

# cat /etc/sysctl.conf
net.ipv4.tcp_mem = 8388608 1048576 12582912

If qmail is running inside of OpenVZ containers, one must apply these values to the VPS Hardware Node and restart the OpenVZ service for the changes to take effect. The following links can be used:

Resource shortage - OpenVZ

Have more questions? Submit a request
Please sign in to leave a comment.