The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> Mail Server Help
|
All sent mail says "Wed, December 31, 1969 7:00 pm"
Discuss All sent mail says "Wed, December 31, 1969 7:00 pm" in the Mail Server Help forum on Dev Shed. All sent mail says "Wed, December 31, 1969 7:00 pm" Mail Server Help forum discussing tips, tricks, techniques and Spam containment solutions. Topics include mail servers such as Sendmail and Qmail, webmail interfaces such as Squirrelmail and Horde and spam solutions such as SpamAssassin and Bayesian
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 16th, 2003, 09:29 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
All sent mail says "Wed, December 31, 1969 7:00 pm"
On our LAMP server, whenever our php application sends emails out, the date on the emails is Wed, December 31, 1969 7:00 pm, which I figure to be UNIX time for ZERO, adjusted (?) for time zone? Maybe.
For some recipients this is a major problem, because the mail automatically gets sorted to the very bottom of their inbox, never to see the light of day again.
I doubt this has anything to do with the problem, but here's the code that sends the email out (simplified):
<?php
include_once("newsite.php");
include_once("newdatabase.php");
include_once("htmlMimeMail.php");
function email($resp) {
$subject = "Status Update";
// create email object
$mail = new htmlMimeMail();
);
// Add the text, html and embedded images.
$html_data = fetch_page("email_contents", $assigns);
$mail->setHtml($html_data);
// Set some headers
$mail->setFrom('"My Website" <me@mysite.com>');
$mail->setSubject($subject);
$mail->setHeader('X-Mailer', 'HTML Mime mail');
// Send it using SMTP.
$mail->setBcc("scott.williams@fidello.net");
$result = $mail->send(array($resp->resp_email), "smtp");
if (!$result) {
echo "<li><font color=red>Error: $mail->errors</font></li>";
}
return $result;
}
if ($sendit) {
error_reporting(E_ALL || ~E_NOTICE);
$recs = $db->get_results("SELECT * FROM user WHERE email_sent IS NULL");
foreach($recs as $rec) {
echo "<li>email sent to $rec->user_name";
if (email($rec)) {
$db->query("UPDATE user SET email_sent=now() WHERE user_name=$rec->user_name");
}
$row++;
}
echo "<li>$row emails sent";
}
?>
Any ideas, pointers on where to look at the documentation, anything, I'd really appreciate it. I don't really administer this server, but I'm as likely a candidate as any to fix this particular problem. Thanks a lot.
Regards,
Scott Williams
Penfield NY
|

October 17th, 2003, 07:07 AM
|
 |
Full Access
|
|
Join Date: Jun 2000
Location: London, UK
Posts: 2,019
Time spent in forums: 3 sec
Reputation Power: 15
|
|
If the application injecting the email doesn't include a date field, then the MTA (e.g. sendmail, qmail) will add one in.
However, whether you use PHP to add a date field or leave this to your MTA, both these will produce an incorrect date field if your system clock is wrong.
What does the output of the date command say?
There is also the slim possibility that you have a broken MTA which doesn't add a date field when required. If you provide the source of one of the email messages, then we can verify this.
See http://216.239.37.104/search?q=cach...&hl=en&ie=UTF-8 for further discussion.
__________________
Alex
(http://www.alex-greg.com)
|

October 17th, 2003, 12:38 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: Originally posted by alexgreg
There is also the slim possibility that you have a broken MTA which doesn't add a date field when required. If you provide the source of one of the email messages, then we can verify this. |
Here's the "visible" information:
Subject: Status Update
From: "My Website" <me@mysite.com>
Date: Wed, December 31, 1969 7:00 pm
To: URL
Priority: Normal
"Full" header info:
Return-Path: <me@mysite.com>
Delivered-To: URL
Received: (qmail 2720 invoked from network); 17 Oct 2003 17:17:35 -0000
Received: from unknown (HELO URL) (me@192.168.1.26)
by 0 with SMTP; 17 Oct 2003 17:17:35 -0000
MIME-Version: 1.0
From: "My Website" <me@mysite.com>
Subject: Status Update
X-Mailer: HTML Mime mail
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Message-ID: <hmwwir.b6t@URL>
To: URL
So, where is that 1969 date coming from??
Thanks.
|

October 18th, 2003, 03:49 PM
|
 |
Full Access
|
|
Join Date: Jun 2000
Location: London, UK
Posts: 2,019
Time spent in forums: 3 sec
Reputation Power: 15
|
|
Quote: | Here's the "visible" information: |
"Visible" where? The incorrect date field (and the priority) is "visible" in whatever you're using to view the mail, but not in the "full" header information.
You also didn't answer my previous question: What does the output of the date command (run on your server) say?
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|