d3lt49 wrote: > > On Nov 12, 2007, at 4:45 PM, Alexandru Stanoi wrote: > >> d3lt49 wrote: >>> Hi, >>> I have script running by CRON which is responsilble for receiving >>> email from pop|imap server and then inserting this email to my database. >>> When my server is down, CRON is not working, and no emails are recieved. >>> And when server gets up, CRON launch my script, but all waiting >>> emails gets current datetime as receive time. (what is not true, >>> cause emails come earliel and only because server-down I was unable >>> get them immediately) >>> So my question is - how with ezcMail get SERVER received time ? >>> Currently I'm using 'timestamp' field from ezcMail. >> >> There is a possibility that the Date header is missing from the mails. >> In this case, when you request the timestamp property from the ezcMail >> object, it returns strtotime( '' ) (empty string or null). This >> returns the current timestamp in PHP versions prior to 5.2.3 (see >> http://bugs.php.net/bug.php?id=41964). From 5.2.3 it returns false for >> empty input strings. >> >> Which PHP version do you use? >> >> Try to display $mail->getHeader( "Date" ) to see if the Date header is >> missing. > > thanks for your response, > > I have PHP 5.2.4 > > $mail->getHeader("Date") returns current date.
Then it must be that the Date header is set by the IMAP server to the current date/time. When parsing a mail from IMAP/POP3, ezcMail just reads the mail source from the server and fills its properties with values from the source. The Date header should not be changed by ezcMail. Some more information about your IMAP server and the PHP script would help. Cheers, Alex. -- Alexandru Stanoi eZ Components System Developer eZ Systems | http://ez.no -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
