emails are delayed
I did search for a long time before posting this, but I could not find anything related to my problem (or if it was, then it was too complex for me to understand).
I am setting up a simple website where users register to events; Upon registering, an email is sent to confirm registration has been received and yaddah yaddah.
Thing is, emails take a very long time to get to destination. Sometimes 2 hours, sometimes more. Is this normal?
I am simply using PHP's mail() function, as I am reluctant to install a PEAR package or a command-line app for such a simple task (but I will if it is the solution to my problem)…I like my apps to be as independent as possible.
For all means and purposes, here is a sample header:
Delivered-To: jad@y---o.com
Received: by 10.147.40.6 with SMTP id s6cs40117yaj;
Mon, 4 Apr 2011 04:11:50 -0700 (PDT)
Received: by 10.14.22.13 with SMTP id s13mr3224501ees.89.1301915509244;
Mon, 04 Apr 2011 04:11:49 -0700 (PDT)
Return-Path: <www-data@xannax-rv408-rv508>Received: from xannax-RV408-RV508 ([80.83.25.142])
by mx.google.com with ESMTP id q47si13002090eeh.0.2011.04.04.04.11.46;
Mon, 04 Apr 2011 04:11:48 -0700 (PDT)
Received-SPF: neutral (google.com: 80.83.25.142 is neither permitted nor denied by best guess record for domain of www-data@xannax-rv408-rv508) client-ip=80.83.25.142;
Authentication-Results: mx.google.com; spf=neutral (google.com: 80.83.25.142 is neither permitted nor denied by best guess record for domain of www-data@xannax-rv408-rv508) smtp.mail=www-data@xannax-rv408-rv508
Received: by xannax-RV408-RV508 (Postfix, from userid 33)
id 086FF3463; Mon, 4 Apr 2011 02:55:25 +0300 (EEST)
To: jad@y---o.com
Subject: PASTEUR: Your guest list was refused, Jad Sarout for the event My First Time!
X-PHP-Originating-Script: 1000:pasteur_functions.php
From: pasteur@p---s.com
Reply-To: pasteur@p---s.com
MIME-Version: 1.0
Content-Type: text/html; charset=ISO-8859-1
Message-Id: <20110403235526.086FF3463@xannax-RV408-RV508>
Date: Mon, 4 Apr 2011 02:55:25 +0300 (EEST)
Dear Jad Sarout, you have been refused. Sorry!</www-data@xannax-rv408-rv508>
p–-s.com being the domain (email are google apps based, but of course in this case I go through my own server and I am not using gmail's SMTP).
I code websites for a living, I use PHP/JS/actionscript/Java daily, and I am under ubuntu, at home and at work, and I use to command line for most of my management. I can set up an apache server no problem, etc.
I just never had to deal with sending emails from a website until now. In other words simple guidelines will do the trick, I can google more info, I just need to know how to go from here, because I am frankly a bit lost right now.
Any suggestions?
5 Replies
which is strange
In any case, the mail logs on 80.83.25.142 may be able to tell you what it was doing with that message for 11 hours.
I mean it really doesn't.
VISP (the domain this IP address points to), is our office's internet provider here, in Lebanon.
But my server is on Linode, in the UK, and sends email through it's internal sendmail function to an address using google apps, on google's servers. The email is filled through a simple form, submit through POST, then handled by my script.
Where does my ISP, which operates only in Lebanon, fit in all this?! How is it even possible that it is an actor in that transaction?
I am missing a piece here. This seems like dark voodoo to me. Pointers please!
I will note that your mail host is announcing itself to the receiver (Google in this case) as host xannax-RV408-RV508 which neither is a fully qualified name, nor shares domain information with the addresses being used (which are .com domains). So maybe it's getting hung up or throttled since it appears spam-like.
Also, oddly, I can't reverse resolve your 80.83.25.142 address - is this a Linode? Typically they resolve at least to a members.linode.com address. Or is that some external host you are using as a "smart" gateway? In that case, I'd definitely suggest just putting postfix (or equivalent) on your Linode, pointing php's mail at localhost and letting it handle the queueing/delivery.
– David
@xananax:
But my server is on Linode, in the UK, and sends email through it's internal sendmail function to an address using google apps, on google's servers. The email is filled through a simple form, submit through POST, then handled by my script.
And then what does your script do with it?
> Where does my ISP, which operates only in Lebanon, fit in all this?! How is it even possible that it is an actor in that transaction?
Best guess is that you've explicitly configured part of your mail delivery chain to use your ISP's mail gateway to deliver mail. You just need to figure out what part. Does the the ISP host address or name show up in any configuration file beneath /etc or anywhere in your applications code/configs?
Given that the first Received line in your posted headers use the ISP host, my first bet would be your own application configuration (or some general configuration for php internal mail transmission) is pointing there.
– David
This is just my stupidity: Those are the emails I sent while testing the website on my test server!
For my defense, I was never able to send emails through my test server before, it seems like something in my ISP's config changed. Always had to upload on a production server to use the mail() function…So I really wasn't expecting those emails to ever arrive.
Thank you for your time and sorry to have wasted it!