Emails are not delivered occasionally: warning: read TCP map reply from unexpected EOF (Connection timed out)




  • Avatar
    John MacKenzie

    My server just started getting this error.

    Restarting the service seems to get it stable for 5 minutes or so.

    The output matches the above. Adding the -s as stated in the turning off SRS thread has no impact on whether it occurs or not.

    Any other suggestions?

  • Avatar
    John MacKenzie

    Yes CentOS , SElinux is diabled


  • Avatar
    Alisa Kasyanova


    Then it is needed to investigate the issue thoroughly. Please submit a support request using your available option.

  • Avatar
    Robert Valdés

    I Have the same problem.

    Configuration OK

    grep postfix-srs /etc/postfix/ inet n n n - - spawn user=popuser:popuser argv=/usr/lib64/plesk-9.0/postfix-srs

    Selinux disabled

    SELinux status: disabled


    Nov 20 15:48:42 s3 postfix/smtpd[19836]: warning: read TCP map reply from unexpected EOF (Connection timed out)
    Nov 20 15:48:42 s3 postfix/smtpd[19836]: warning: tcp: lookup error for ""

  • Avatar
    Alexandr Redikultsev

    Hi @Robert,

    Are there any messages like the one below in the maillog as well?

    warning: /usr/lib64/plesk-9.0/postfix-srs: process id #####: command time limit exceeded

  • Avatar
    Robert Valdés

    Yes! a lot

    Nov 26 03:56:53 s3 postfix/spawn[5033]: warning: /usr/lib64/plesk-9.0/postfix-srs: process id 5043: command time limit exceeded
    Nov 26 03:56:53 s3 postfix/spawn[5052]: warning: /usr/lib64/plesk-9.0/postfix-srs: process id 5054: command time limit exceeded
    Nov 26 03:56:53 s3 postfix/spawn[5056]: warning: /usr/lib64/plesk-9.0/postfix-srs: process id 5057: command time limit exceeded

  • Avatar
    Alexandr Redikultsev

    Then let me provide you with some tips on how to troubleshoot this issue. Basically in can occur in case there is one IP that connects to the server and then does not close the connection for some reason.

    1. Find all 'max connection count' in the maillog, it should looks like the example below:

    # grep 'max connection count' /var/log/maillog | tail -n 2
    postfix/anvil[28023]: statistics: max connection count 34 for (smtp: ) at Sep 3 11:47:48
    postfix/anvil[51714]: statistics: max connection count 11 for (smtp: ) at Sep 3 12:25:57

    In this example, there are 34 and 11 connections from .

    2. Then, check this IP with the netstat in order to understand whether or not there are some hanging connections:

    # netstat -tulnap | grep | wc -l
    # netstat -tulnap | grep | head -n 2
    tcp 0 1 FIN_WAIT1 -
    tcp 0 1 FIN_WAIT1 -

    3. Now it's time to check Connect/Disconnect ratio from offending IP:

    This is the normal output (connect matches disconnect):

    # grep 'connect .*' /var/log/maillog | awk '{print $6}' | sort | uniq -c
    603 connect
    603 disconnect

    This is not correct output:

    # grep 'connect .*' /var/log/maillog | awk '{print $6}' | sort | uniq -c
    86 connect
    20 disconnect

    4. In theory, the following script is intended to provide IPs addresses connection ratio statistics:

    # for IP in `grep 'max connection count' /var/log/maillog | awk '{ print $12 }' | sort | uniq | sed 's/(smtp://g; s/)//g;'`; do echo -e "Checking IP.. $IP"; egrep "connect .*$IP" /var/log/maillog | awk '{print $6}' | sort | uniq -c ; done

    Overall in case on step 3 you are getting connect/disconnect ratio mismatch, this means that host  does not close the connection and is causing the issue. Solution would be to either ban this IP address or contact them somehow letting them know that their mail client is malfunctioning.

    As a workaround, it should be also possible to increase number of connection from one IP address at Tools & Settings > Mail Server Settings.

  • Avatar
    Robert Valdés

    Ok thanks, I try to activate fail2ban

Please sign in to leave a comment.

Have more questions? Submit a request