Search code examples
phpcodeigniteremailphpmailerdelay

What's causing a 4 minute delay in receiving mail sent by phpmailer?


This is the email header:

Delivered-To: [email protected]
Received: by 2002:a25:ad43:0:0:0:0:0 with SMTP id l3csp3055642ybe;
        Sun, 3 Nov 2019 07:12:29 -0800 (PST)
X-Received: by 2002:adf:f70f:: with SMTP id r15mr20367618wrp.262.1572793709683;
        Sun, 03 Nov 2019 07:08:29 -0800 (PST)
X-Google-Smtp-Source: APXvYqzj7LPmrNu3admvr9X/ZE60yudyUWT3opOQ25wvHJL2osJMOUnL31sBPF/3TCSsmZoIWPH3
X-Received: by 2002:adf:f70f:: with SMTP id r15mr20367571wrp.262.1572793708960;
        Sun, 03 Nov 2019 07:08:28 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1572793708; cv=none;
        d=google.com; s=arc-20160816;
        b=kmeiTPCferUwQu5xrl4id+RQMmLxaZ0POwV5Xd/4ukrDROfrz64+Oa5w0glrqlZfDk
         3qeAuc84NVs6gTKsBUm3vO5fs4YwLMVgGlTYEVWeA7HhWuq/19C6qmoQToqqj0IxqlpM
         /8ujeHLHVrf5CEYVwCh1yu5/p5SPyh0hdSV0UTh5X6G/2ztgHr6wGrTuLMW6CahUIMw/
         vY+oMff9B/LSR249ZKnA6flZXJgWhNMXsheBKV6fRLsNEp4EGgoqqitha6bI+qaCUWNg
         lDSiIzhsA33Q6fCoPUKefLyCqzxH5IyOl6u5UYHnuC/OkGH6+yPcOcXve7jhfbu+trkh
         TSbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:message-id:subject:from:to
         :date:dkim-signature;
        bh=4NWyZSvwEZJB5UQcYKkWN6mU6LE4zXoLYl9Jdf5NB/8=;
        b=Hy8a/g9uptz7ga2jfSJGpK3R3QFNGFwqPMdSYRxDk0591UMXYqTIQUFNk6kYmcSAb2
         G6gjUzFf+ofmg/84Sf2B8S1/zT+qFvLK7tku10dbycjXKcF5siftBxOOgWhZp0ogmNQL
         SFeEDHHllIfEp8OZhsdVOegnnVGqo0iIAdfFzFDLt4TNJxXShUpZJ2+dbLKbvTgRE3FO
         t9IM/ibMt21yrzymyujvdTVIVGL4BzWLusUWA69uzYAaZS1EFwwrMDd9s6zwp2Muk1Bs
         YC6bxGcZduX1yL1+DNMcRufszZRL0u21NEBLJDYm6uca3YoxjGrp4ajZwu3sS2ovb8qS
         8pdA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass [email protected] header.s=default header.b=sY81zHWu;
       spf=pass (google.com: domain of [email protected] designates 31.168.11.92 as permitted sender) [email protected]
Return-Path: <[email protected]>
Received: from cp92.box.co.il (cp92.box.co.il. [31.168.11.92])
        by mx.google.com with ESMTPS id d129si13994033wmc.201.2019.11.03.07.08.28
        for <[email protected]>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 03 Nov 2019 07:08:28 -0800 (PST)
Received-SPF: pass (google.com: domain of [email protected] designates 31.168.11.92 as permitted sender) client-ip=31.168.11.92;
Authentication-Results: mx.google.com;
       dkim=pass [email protected] header.s=default header.b=sY81zHWu;
       spf=pass (google.com: domain of [email protected] designates 31.168.11.92 as permitted sender) [email protected]
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=chefsbutcher.co.il; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Subject:From:To:Date:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4NWyZSvwEZJB5UQcYKkWN6mU6LE4zXoLYl9Jdf5NB/8=; b=sY81zHWue+bYdn7IQCmo5NgBdn dza3lCceOvhWRE3W4qWg4fG7AqM+yyGRkTQGAnlnqeRUpcQZDpPMuyIxHreSDxjeLQb6RxgTi4lW/ eh4ACBq4pr0/R1pNmwMH/L93F+8Qzm0OGAyJEfdW/u4dv8aoiVNNMr1/aJqbRdPYP4Cs6GSjj2BQo hgJ0xSyI0ucDnDOPaXNSB1Y4JwSuV5azCKROKMcveLCOcuv39iBdm/T6kGWeh1x6OP8NmGQGxCOhL A+Fu2kiq/XeU4hKOmrAQ82tBxp0vRhHzhJsisfckAjfZ1/3wXBoIiFsS1ul4byYhoqkkdbiXT+qNU v9v2eIWQ==;
Received: from [31.168.11.92] (port=41790 helo=chefsbutcher.co.il) by cp92.box.co.il with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from <[email protected]>) id 1iRHUR-0002NA-F3 for [email protected]; Sun, 03 Nov 2019 17:08:27 +0200
Date: Sun, 3 Nov 2019 17:08:27 +0200
To: [email protected]
From: "קצביית השף" <[email protected]>
Subject: כמעט אצלך! הזמנתך מקצביית השף בתהליך משלוח!
Message-ID: <[email protected]>
X-Priority: 3
X-Mailer: PHPMailer 5.2.27 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="b1_e3b476543d89e53426eaeeb9426fa8e1"
Content-Transfer-Encoding: 8bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - cp92.box.co.il
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - chefsbutcher.co.il
X-Get-Message-Sender-Via: cp92.box.co.il: authenticated_id: [email protected]
X-Authenticated-Sender: cp92.box.co.il: [email protected]
X-Source: 
X-Source-Args: 
X-Source-Dir: 

--b1_e3b476543d89e53426eaeeb9426fa8e1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As you can see there's a 4 minute delay in Hop 3 (also why's the from column in that hop empty?)

What could be causing this delay?


Solution

  • Delivery delays are simply an inherent part of how SMTP works. Unlike protocols like HTTP, which connect and happen more or less immediately, even through chains of proxies, messages sent by SMTP can be held up for long periods at any point in their journey. During this time they may be written to disk by any intermediate relaying server and ignored for a while, then picked up and delivery retried later on. This can all happen in seconds, and often does, but you can't rely on it - there is nothing in SMTP preventing it from taking days.

    As a sender, you have little control over this, other than by trying to avoid bottlenecks that you do have control over, such as ensuring that you are sending through a well-connected relay with a long history of not sending spam.

    Large ISPs like Google and Yahoo often use SMTP delivery deferrals (where the receiving server says "I'm busy right now, come back later") as a means of rate-limiting senders they disapprove of for some reason, e.g. they are sending too much, using too many connections, or receivers are reporting messages as spam.

    In short, adjust your expectations; delays like this are common, and what you are seeing is perfectly normal.