• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Excessive email delays

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Excessive email delays

    Couple of times in recent months I have fannied about trying to discover why emailing from my website forms using mail(... ) in PHP is not working only to discover it is but there are just long delays. One recent mail took 18 hours between the script being invoked and reaching my inbox.

    There is no problem with direct mailing to the same addresses or with the host's normal email forwarding.

    Any brill ideas? Much ta.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    Originally posted by xoggoth View Post
    Couple of times in recent months I have fannied about trying to discover why emailing from my website forms using mail(... ) in PHP is not working only to discover it is but there are just long delays. One recent mail took 18 hours between the script being invoked and reaching my inbox.

    There is no problem with direct mailing to the same addresses or with the host's normal email forwarding.

    Any brill ideas? Much ta.
    Have you tried sending a test email from the command line? Monitor the logs to see what's going on.
    Me, me, me...

    Comment


      #3
      Ta. But would that show anything if direct emailing is ok or am I misunderstanding? I have put echos in the PHP script to show it is all working ok.
      bloggoth

      If everything isn't black and white, I say, 'Why the hell not?'
      John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

      Comment


        #4
        Originally posted by xoggoth View Post
        Ta. But would that show anything if direct emailing is ok or am I misunderstanding? I have put echos in the PHP script to show it is all working ok.
        Are you using the PHP mail function with Sendmail or with SMTP authentication?
        Me, me, me...

        Comment


          #5
          Just sendmail.
          bloggoth

          If everything isn't black and white, I say, 'Why the hell not?'
          John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

          Comment


            #6
            Originally posted by xoggoth View Post
            Just sendmail.
            You have your own SMTP server or going via 3rd party? The issue could be the server rather than the PHP. There are alternative libraries that might be worth trying;

            Powerful component based mailing library for PHP – Swift Mailer
            Me, me, me...

            Comment


              #7
              looked at the headers to see when they are passed between servers
              Always forgive your enemies; nothing annoys them so much.

              Comment


                #8
                Cheers both.

                From properties details:
                The email visible date and another line that says "Received (qmail nnnnn invoked by uid nn)" are both dated 4 Mar 2011 20:04:54
                Yahoo has 2 lines, "Received" and "X-Apparently to" are both dated Sat, 05 Mar 2011 14:22:55

                Various people seem to have this probelm on net but no solutions that I can see without changing method so may look at those linked items.
                bloggoth

                If everything isn't black and white, I say, 'Why the hell not?'
                John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                Comment


                  #9
                  Originally posted by xoggoth View Post
                  Couple of times in recent months I have fannied about trying to discover why emailing from my website forms using mail(... ) in PHP is not working only to discover it is but there are just long delays. One recent mail took 18 hours between the script being invoked and reaching my inbox.

                  There is no problem with direct mailing to the same addresses or with the host's normal email forwarding.

                  Any brill ideas? Much ta.
                  Xoggoth

                  Delays of hours could be being introduced by the sendmail daemon only trying to send infrequently, but I would suspect that the delays are more likely being introduced by the receiving mail server thinking you are a spammer and deliberately deferring the acceptance of your message.

                  Does your IP address appear on any spam blacklists? Is your reverse DNS setup OK. Does it appear on any dynamic IP lists. Many servers refuse to accept mail from dynamic IPs. Have you setup SPF in DNS so that your IP address is listed as a valid sender for your domain. All these could be possible causes for long delivery delays.

                  The best way to track it down is to look for patterns of delays to certain domains when delivery to other domains is OK. I run a large mail server sending 10000+ messages a day and I often see long delays to BT/Yahoo. Todays log extract shows that BT/Yahoo were delaying my messages by an average of 12-15 minutes (maximum 2 hours+) while messages to all other ISPs were delivered in seconds.

                  You should also check your sendmail log for deferral messages

                  delivery temporarily suspended: host mx2.bt.mail.yahoo.com[195.50.106.142] refused to talk to me: 421 4.7.0 [TS01] Messages from XX.XX.XX.XX temporarily deferred - 4.16.55.1; see 421 4.16.55 [TS01] Messages from x.x.x.x temporarily deferred due to excessive user complaints | Yahoo! Postmaster Help

                  If you find delivery to all domains affected then you maybe have a more subtle problem.

                  Good Luck tracking it down

                  Host/Domain Summary: Message Delivery
                  sent cnt bytes defers avg dly max dly host/domain
                  -------- ------- ------- ------- ------- -----------
                  1877 17834k 0 1.4 s 23.0 s marketplace.amazon.co.uk
                  1397 13271k 0 1.2 s 1.8 s hotmail.com
                  1145 10862k 0 1.2 s 2.3 s hotmail.co.uk
                  725 6901k 286 12.2 m 2.1 h btinternet.com
                  593 5631k 0 1.9 s 32.0 s yahoo.co.uk
                  477 4532k 0 1.1 s 8.9 s gmail.com
                  319 3029k 0 2.1 s 7.2 s aol.com
                  248 2355k 0 1.2 s 9.5 s sky.com
                  211 2005k 0 1.0 s 7.5 s ntlworld.com
                  209 1988k 0 1.2 s 7.4 s googlemail.com
                  191 1813k 83 14.2 m 2.1 h yahoo.com
                  175 1660k 0 1.2 s 3.4 s live.co.uk
                  150 1425k 1 8.7 s 19.6 m talktalk.net
                  140 1331k 0 0.4 s 0.8 s tiscali.co.uk
                  119 1379k 0 0.9 s 2.9 s hdntrack.co.uk
                  112 1067k 0 1.1 s 3.1 s blueyonder.co.uk
                  74 703k 38 15.3 m 2.1 h btopenworld.com

                  Comment


                    #10
                    Cheers, will see what a sendmail log and spf are. It is a dynamic IP but aren't many these days? Not enough numbers to go around.

                    I posted a query on the host's support and was told it was due to high traffic, which may be when another site's mail is spammed. It does seem worse on Friday Night/Saturday morning Working fine now, just a few seconds delay.

                    PS Why when I am doing lots of test purchases does somebody always decide to do a real one and confuse the issue? The Great God Sod invariably increases sales.
                    bloggoth

                    If everything isn't black and white, I say, 'Why the hell not?'
                    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                    Comment

                    Working...
                    X