Mail Server Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationMail Server Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 16th, 2003, 09:29 PM
80sDweeb 80sDweeb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 80sDweeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry 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

Reply With Quote
  #2  
Old October 17th, 2003, 07:07 AM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
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)

Reply With Quote
  #3  
Old October 17th, 2003, 12:38 PM
80sDweeb 80sDweeb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 80sDweeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #4  
Old October 18th, 2003, 03:49 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationMail Server Help > All sent mail says "Wed, December 31, 1969 7:00 pm"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway