Very high delay in receiving mail!

Discussion in 'General' started by tennents, Jul 5, 2007.

  1. tennents

    tennents New Member

    Hi all.

    I'm using ispconfig for about 1 year without any problem.

    Now I've got one!

    When someone sends me an email it takes very long to reach the mailbox. :eek: (more than half an hour in the best cases!!!!)

    outgoing mail goes without any problem/delay...

    I've got about 10 domains with an average of 10 users each and I have the same problem in any of them.

    some times ago I tried the postgrey tool, but now it's uninstalled and no greylisting option is specified in /etc/postfix/main.cf. I have
    Code:
    smtpd_recipient_restrictions = permit_sasl_authenticated,
                           permit_mynetworks,
                           reject_unauth_destination
    
    anyone has some hints??


    Second question:

    In the next future i will change the machine running ispconfig. I would like to make a fresh install, but i don't know how to move all the accounts (and its datas) from the old to the new server....

    thankyou very much!!!!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    How many emails do you have in the mailqueue? You can check this with:

    postqueue -p
     
  3. Herbert

    Herbert New Member

    Its not only me..
    I have the same problem with 0 mails in the mailqueue
    The delay is here also between 5 and 15 minutes
     
  4. tennents

    tennents New Member

    Code:
    root@server:~# postqueue -p
    Mail queue is empty
    
    :confused:
     
  5. tennents

    tennents New Member

    i tried to apt-get remove --purge postfix and then reinstall the whole server following the "perfect setup". I evend deinstalled ispconfig and reinstalled it, but i still have the same problem...
     
    Last edited: Jul 7, 2007
  6. tennents

    tennents New Member

    /etc/postfix/main.cf
    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    delay_warning_time = 1h
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = server.mecbassi.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = server.mecbassi.com, localhost.mecbassi.com, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    disable_dns_lookups = yes
    
    virtual_maps = hash:/etc/postfix/virtusertable
    
    mydestination = /etc/postfix/local-host-names
    
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    How long does it take when you send a email from one local account on your server to another local account?

    Please do not do such things as reinstalling postfix, this may make things even wordse an break your setup.

    Please post the content of /etc/resolv.conf and a excerpt of your mail.log.
     
  8. tennents

    tennents New Member

    Code:
    root@server:~# cat /etc/resolv.conf
    nameserver 192.168.5.50
    nameserver 213.140.2.43
    nameserver 213.140.2.49
    
    where 192.168.5.50 is the ip of my ispconfig server and the others are the dns of my provider.



    for a message from an account of one domain to one account of another domain, both on the same server, takes more than 10 minutes, when the message does not get lost... i sent e message to admin but the message is disappeared from the queue but never reached my inbox!


    Thanks for your kind help!
     
    Last edited: Jul 7, 2007
  9. falko

    falko Super Moderator Howtoforge Staff

    Can you try
    Code:
    nameserver 145.253.2.75
    nameserver 193.174.32.18
    in /etc/resolv.conf instead?

    Can you then check with
    Code:
    dig mx yourdomain.com
    that the MX records of the domains you're sending emails to are pointing to the correct server?
    Also, what happens in your mail log when you send a mail to an account on your server?
    What's the output of
    Code:
    netstat -tap
    ?
     
  10. tennents

    tennents New Member

    hi all,

    I just reinstalled all the server on a new machine (newer and more powerfull than the old one)...
    ubuntu 6.06 following the perfect setup.

    no customizations or anything else

    The email are still with high delay (only incoming email, outgoing ones are in real time...)

    I don't know what to do...

    please help!

    I use fastweb, it's an italian provider the provides a private IP, but i bought also a pubblic static ip that is natted in my cisco router to reach the ipcop-box that makes PAT the the ispconfig-box for the ports 110,25,53,80,81,445.

    postqueue -p:
    Code:
    root@server:~# postqueue -p
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    EC6BF4DD973*    2067 Thu Aug 23 17:49:29  [email protected]
                                             [email protected]
    
    576794DD974*   10420 Thu Aug 23 17:50:18  [email protected]
                                             [email protected]
    
    9A0394DD975*    3708 Thu Aug 23 17:51:28  [email protected]
                                             [email protected]
    
    4A9DE4DD976*    3740 Thu Aug 23 17:51:31  [email protected]
                                             [email protected]
    
    0A4934DD960*    5784 Thu Aug 23 17:51:32  [email protected]
                                             [email protected]
    
    41F9F4DD962*    3692 Thu Aug 23 17:51:32  [email protected]
                                             [email protected]
    
    0D0CC4DD96A*    3705 Thu Aug 23 17:51:34  [email protected]
                                             [email protected]
                                             [email protected]
    
    408244DD963*    3752 Thu Aug 23 17:51:35  [email protected]
                                             [email protected]
    
    95C124DD964*    2582 Thu Aug 23 17:51:35  [email protected]
                                             [email protected]
                                             [email protected]
    
    65F744DD965*     757 Thu Aug 23 17:52:57  [email protected]
                                             [email protected]
    
    2A44D4DD967*    2496 Thu Aug 23 17:51:47  MAILER-DAEMON
                                             [email protected]
    
    026BF4DD969*    6565 Thu Aug 23 17:54:37  [email protected]
                                             [email protected]
    
    C7CE14DD968*    3764 Thu Aug 23 17:51:50  [email protected]
                                             [email protected]
    
    D82BA4DD96C*    3918 Thu Aug 23 17:51:50  [email protected]
                                             [email protected]
    
    20B934DD961*    6632 Thu Aug 23 17:51:55  [email protected]
                                             [email protected]
    
    C82194DD96B     3283 Thu Aug 23 17:19:43  [email protected]
                                             [email protected]
    
    01A334DD96E     2576 Thu Aug 23 17:35:58  [email protected]
                                             [email protected]
    
    444D54DD971    17417 Thu Aug 23 17:37:19  [email protected]
                                             [email protected]
    
    DA15D4DD972     2912 Thu Aug 23 17:40:49  [email protected]
                                             [email protected]
    
    1DAD14DD959  1869878 Thu Aug 23 09:37:59  [email protected]
        (connect to mail.leonferrari.com.ar[200.123.133.99]: Connection timed out)
                                             [email protected]
    
    what can I do???
     
  11. tennents

    tennents New Member

    little update:

    the incoming message reachs in real time the postfix queue, but then takes a while (10 minutes to half an hour!!!) to be delivered to the mailbox...:eek: :confused:
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Please make sure that server.xxxxxxxxx.com as a valid DNS A-Record that points to the IP of your server.
     
  13. tennents

    tennents New Member

    yes, it has...

    in the server:
    Code:
    dig server.xxxxxxxxxxxxx.com
    
    ; <<>> DiG 9.3.2 <<>> server.xxxxxxxxxxxx.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13135
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;server.xxxxxxxxxxxxxxx.com.           IN      A
    
    ;; ANSWER SECTION:
    server.xxxxxxxxxxxxxxxx.com.    86400   IN      A       192.168.5.50
    
    ;; AUTHORITY SECTION:
    xxxxxxxxxxxx.com.           86400   IN      NS      server.xxxxxxxxxxxxx.com.
    
    ;; Query time: 1 msec
    ;; SERVER: 192.168.5.50#53(192.168.5.50)
    ;; WHEN: Fri Aug 24 11:08:30 2007
    ;; MSG SIZE  rcvd: 67
    
    where 192.168.5.50 is the ip of the server.

    Digging in my pc at home gives back:
    Code:
    dig server.xxxxxxxxxxxx.com
    
    ; <<>> DiG 9.3.4 <<>> server.xxxxxxxxxxxxxxxxx.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56477
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;server.xxxxxxxxxxxxxxxxx.com.           IN      A
    
    ;; ANSWER SECTION:
    server.xxxxxxxxxxxxxxxxx.com.    86263   IN      A       81.xxx.xx.x
    
    ;; Query time: 7 msec
    ;; SERVER: 192.168.2.1#53(192.168.2.1)
    ;; WHEN: Fri Aug 24 11:07:53 2007
    ;; MSG SIZE  rcvd: 53
    
    i don't think that the problem is in the dns, cause the message from outside (i.e. gmail) reaches the queue immediatly after being sent... but then stays in the quele for long time before reaching the mailbox... the delay in inside the server...

    till: are you available to "commercial" support?
     
  14. Jcorrea920

    Jcorrea920 New Member

    I have the same problem!

    Tennants said:
    I have the same problem and I have had it for quite sometime. Although sometime emails don't arrive in mailbox until after 12 hours. It's not a dns problem like Till suggested. What's going on? Any updates?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the load on your server, if its high, switch to clamd instead of clamscan antivirus scanning.
     
  16. Jcorrea920

    Jcorrea920 New Member

    Load not a problem..

    On 10th September 2007 11:59
    till said:
    Till load is not a problem. When I run top every service is running average about 0.1% CPU with spurts of 1-3% CPU on some requests. I am running version 2.2.13 on this server. The others are running 2.2.12. I will plan to upgrade soon. But I don't think that is the issue. Although there have been some issues with ntpd, ntpdate, and just syncing the date with a stable time server. I have it running a cron job every 10 minutes ntpdate to time server. I have ntpd stopped. Otherwise the time gets behind quite a bit. Could this be the issue?
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is just writing config files, it is not a MTA. So if you use 2.2.12, 2.2.13 or 2.2.16 does not make a difference.

    Please post the log lines from a typical delayed email.
     
  18. Jcorrea920

    Jcorrea920 New Member

    Maillog output

    Code:
    Sep 12 18:52:02 ccs06 postfix/smtpd[11938]: warning: 121.56.114.91: address not listed for hostname 91.114.56.121.broad.cf.nm.dynamic.163data.com.cn
    Sep 12 18:52:02 ccs06 postfix/smtpd[11938]: connect from unknown[121.56.114.91]
    Sep 12 18:52:02 ccs06 postfix/smtpd[11938]: lost connection after CONNECT from unknown[121.56.114.91]
    Sep 12 18:52:02 ccs06 postfix/smtpd[11938]: disconnect from unknown[121.56.114.91]
    Sep 12 18:52:14 ccs06 postfix/smtpd[11948]: connect from pc-135-162-83-200.cm.vtr.net[200.83.162.135]
    Sep 12 18:52:19 ccs06 sendmail[11956]: l8D1psKW011956: from=web3_username, size=117, class=0, nrcpts=1, msgid=<[email protected]>, relay=web3_username@localhost
    Sep 12 18:52:19 ccs06 postfix/smtpd[11938]: connect from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:19 ccs06 postfix/smtpd[11938]: setting up TLS connection from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:19 ccs06 postfix/smtpd[11938]: TLS connection established from localhost.localdomain[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
    Sep 12 18:52:19 ccs06 sendmail[11956]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
    Sep 12 18:52:19 ccs06 postfix/smtpd[11938]: E4075345919: client=localhost.localdomain[127.0.0.1], [email protected]
    Sep 12 18:52:19 ccs06 postfix/cleanup[11940]: E4075345919: message-id=<[email protected]>
    Sep 12 18:52:19 ccs06 postfix/qmgr[28863]: E4075345919: from=<[email protected]>, size=821, nrcpt=1 (queue active)
    Sep 12 18:52:20 ccs06 sendmail[11956]: l8D1psKW011956: [email protected], ctladdr=web3_username (10034/10003), delay=00:00:26, xdelay=00:00:01, mailer=relay, pri=30117, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as E4075345919)
    Sep 12 18:52:20 ccs06 postfix/smtpd[11938]: disconnect from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:20 ccs06 postfix/local[11973]: E4075345919: to=<[email protected]>, relay=local, delay=0.4, delays=0.07/0.04/0/0.29, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Sep 12 18:52:20 ccs06 postfix/qmgr[28863]: E4075345919: removed
    Code:
    Sep 12 18:52:23 ccs06 postfix/smtpd[11948]: E2454345919: client=pc-135-162-83-200.cm.vtr.net[200.83.162.135]
    Sep 12 18:52:29 ccs06 postfix/cleanup[11940]: E2454345919: message-id=<[email protected]>
    Sep 12 18:52:29 ccs06 postfix/qmgr[28863]: E2454345919: from=<[email protected]>, size=3650, nrcpt=1 (queue active)
    Sep 12 18:52:32 ccs06 postfix/smtpd[11948]: E945434591A: client=pc-135-162-83-200.cm.vtr.net[200.83.162.135]
    Sep 12 18:52:38 ccs06 postfix/cleanup[11940]: E945434591A: message-id=<[email protected]>
    Sep 12 18:52:38 ccs06 postfix/qmgr[28863]: E945434591A: from=<[email protected]>, size=3597, nrcpt=1 (queue active)
    Sep 12 18:52:38 ccs06 postfix/local[11999]: E945434591A: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=7.2, delays=7.1/0.04/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
    Sep 12 18:52:38 ccs06 postfix/qmgr[28863]: E945434591A: removed
    Sep 12 18:52:44 ccs06 postfix/smtpd[11948]: 160CD34591A: client=pc-135-162-83-200.cm.vtr.net[200.83.162.135]
    Sep 12 18:52:50 ccs06 postfix/cleanup[11940]: 160CD34591A: message-id=<[email protected]>
    Sep 12 18:52:50 ccs06 postfix/qmgr[28863]: 160CD34591A: from=<[email protected]>, size=3614, nrcpt=1 (queue active)
    Sep 12 18:52:54 ccs06 sendmail[11988]: l8D1qTGW011988: from=web3_username, size=117, class=0, nrcpts=1, msgid=<[email protected]>, relay=web3_username@localhost
    Sep 12 18:52:54 ccs06 postfix/smtpd[11938]: connect from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:54 ccs06 postfix/smtpd[11938]: setting up TLS connection from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:54 ccs06 postfix/smtpd[11938]: TLS connection established from localhost.localdomain[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
    Sep 12 18:52:54 ccs06 sendmail[11988]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
    Sep 12 18:52:54 ccs06 postfix/smtpd[11938]: EADC734591B: client=localhost.localdomain[127.0.0.1], [email protected]
    Sep 12 18:52:55 ccs06 postfix/cleanup[11940]: EADC734591B: message-id=<[email protected]>
    Sep 12 18:52:55 ccs06 sendmail[11988]: l8D1qTGW011988: [email protected], ctladdr=web3_username (10034/10003), [COLOR="red"]delay=00:00:26, xdelay=00:00:01[/COLOR], mailer=relay, pri=30117, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as EADC734591B)
    Sep 12 18:52:55 ccs06 postfix/qmgr[28863]: EADC734591B: from=<[email protected]>, size=821, nrcpt=1 (queue active)
    Sep 12 18:52:55 ccs06 postfix/smtpd[11938]: disconnect from localhost.localdomain[127.0.0.1]
    Sep 12 18:52:55 ccs06 postfix/local[11999]: EADC734591B: to=<[email protected]>, relay=local,[COLOR="red"] delay=0.59, delays=0.07/0/0/0.52[/COLOR], dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Sep 12 18:52:55 ccs06 postfix/qmgr[28863]: EADC734591B: removed
    Sep 12 18:52:58 ccs06 postfix/smtpd[11948]: disconnect from pc-135-162-83-200.cm.vtr.net[200.83.162.135]
    Code:
    Sep 12 18:53:06 ccs06 postfix/smtpd[11938]: connect from ccs05.ourdomain.com[x . x . 43.50]
    Sep 12 18:53:06 ccs06 postfix/smtpd[11938]: disconnect from ccs05.ourdomain.com[x . x . 43.50]
    Sep 12 18:53:24 ccs06 dovecot: pop3-login: Aborted login: rip=::ffff:x . x . 43.50, lip=::ffff:x . x . 43.185
    Sep 12 18:54:07 ccs06 postfix/local[11941]: 84D3A345918: to=<[email protected]>, orig_to=<[email protected]>, relay=local, [COLOR="Red"]delay=133, delays=0.04/0.01/0/133[/COLOR], dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Sep 12 18:54:07 ccs06 postfix/qmgr[28863]: 84D3A345918: removed
    Sep 12 18:54:15 ccs06 dovecot: pop3-login: Aborted login: rip=::ffff:x . x .180.142, lip=::ffff:x . x . 43.185
    
    Notice the delay. In actuallity it takes much longer than the time stated in the logs. What do you think it may be?
     
  19. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/postfix/main.cf?
     
  20. Jcorrea920

    Jcorrea920 New Member

    /etc/postfix/main.cf

    Took the comments out.

    /etc/postfix/main.cf :

    Code:
    queue_directory = /var/spool/postfix
    
    command_directory = /usr/sbin
    
    daemon_directory = /usr/libexec/postfix
    
    mail_owner = postfix
    
    inet_interfaces = all
    
    unknown_local_recipient_reject_code = 550
    
    alias_maps = hash:/etc/aliases
    
    alias_database = hash:/etc/aliases
    
    debug_peer_level = 2
    
    debugger_command =
             PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
             xxgdb $daemon_directory/$process_name $process_id & sleep 5
    
    sendmail_path = /usr/sbin/sendmail.postfix
    
    newaliases_path = /usr/bin/newaliases.postfix
    
    mailq_path = /usr/bin/mailq.postfix
    
    setgid_group = postdrop
    
    html_directory = no
    
    manpage_directory = /usr/share/man
    
    sample_directory = /usr/share/doc/postfix-2.3.3/samples
    
    readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    mynetworks = 127.0.0.0/8
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    mailbox_command =
    
    virtual_maps = hash:/etc/postfix/virtusertable
    
    mydestination = /etc/postfix/local-host-names
    
     

Share This Page