5 Replies Latest reply: Jun 21, 2013 6:17 PM by l008com
l008com Level 1 Level 1 (35 points)

I've been having a very peculiar problem for a few months now. Any mail sent to my server, via gmail (whether a gmail.com email address or a gmail-hosted private domain), gets delayed for hours before it gets to my inbox. All other servers are able to send essentially instanatly. But Gmail can take an hour, up to as long as 4 hours. Sometimes they do come in right away. If someone sends me 3 test emails, the sceond one might arrive right away, and the third might arrive 10 minutes later, and the first might arrive hours later. The delay seems to be totally random.

 

My server is 10.6.8, running Apple's Mail server. My DNS is all proper, my server's IP is a real, non-dymanic one with proper reverse set up. I have all my MX and SPF records configured correctly.

 

I do use the following four realtime databases on my server, but it doesn't seem like they could be at fault. All the mail does arrive eventually, and only gmail servers are getting delayed.

cbl.abuseat.org

sbl.spamhaus.org

xbl.spamhaus.org

bl.spamcop.net

 

This is one strange problem, that I'm not really sure how to diagnose.


Xserve, Mac OS X (10.6.8), 8 x 3.0 GHz, 8 GB RAM, Early 2008
  • 1. Re: Mail from Gmail Servers is Delayed Hours
    MrHoffman Level 6 Level 6 (12,455 points)

    Check the SMTP mail server logs, as a start.  Look for the connection requests for the delayed messages, and also particularly look for 450 try-again-later responses from your mail server.

     

    If you're seeing 450 errors in the logs, you're probably getting delayed by greylisting, as the OS X Server box learns about the various Google mail servers.    Greylisting will generate that response for the first few contacts with a "new" mail server, as that greatly reduces the volume of spam.  The spam engines don't retry their messages.  Real mail servers do.

     

    Here are some details on disabling greylisting, though I generally don't recommend doing that.

  • 2. Re: Mail from Gmail Servers is Delayed Hours
    l008com Level 1 Level 1 (35 points)

    Placeholder since the forum woudln't let me edit my message

  • 3. Re: Mail from Gmail Servers is Delayed Hours
    l008com Level 1 Level 1 (35 points)

    So I sent myself a test email, from my gmail account, to my main account. The email hasn't arrived, and this is what showed up in the error log (with logging set to "information"):

     

    Jun 11 13:47:08 macfixer postfix/smtpd[1815]: connect from mail-qc0-f174.google.com[209.85.216.174]

    Jun 11 13:47:09 macfixer postfix/smtpd[1815]: NOQUEUE: reject: RCPT from mail-qc0-f174.google.com[209.85.216.174]: 450 4.7.1 <derp@not-gmail.com>: Recipient address rejected: Service is unavailable; from=<derp@gmail.com> to=<derp@not-gmail.com> proto=ESMTP helo=<mail-qc0-f174.google.com>

    Jun 11 13:47:09 macfixer postfix/smtpd[1815]: disconnect from mail-qc0-f174.google.com[209.85.216.174]

     

    If it's greylisting like you say, why is it being such a problem all of the sudden, and why only for gmail?

  • 4. Re: Mail from Gmail Servers is Delayed Hours
    l008com Level 1 Level 1 (35 points)

    I went ahead and disabled the greylisting. We'll see if that fixes things, and if my spam levels go up. I can't have random email take 6 hours to arrive, that's just not going to work.

  • 5. Re: Mail from Gmail Servers is Delayed Hours
    l008com Level 1 Level 1 (35 points)

    So disabling graylisting worked, email is now instant. But now I do get WAY more spam. Mostly "online pharmacy" spam, the shittiest kind. So is there some kind of middle ground. Like using greylisting but ONLY on hosts that do not come from a valid source, as dictated by the SPF record? That should give me the best of both worlds?