php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5699 wrong date format in imap_headers()
Submitted: 2000-07-20 14:56 UTC Modified: 2000-07-21 17:50 UTC
From: vgon at mobilae dot ru Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.0.1pl2 OS: Solaris 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vgon at mobilae dot ru
New email:
PHP Version: OS:

 

 [2000-07-20 14:56 UTC] vgon at mobilae dot ru
 imap_headers() should return array of headers of e-mail
messages. Each header should include date field. This is
code from ext/imap/php_imap.c imap_headers function:
                mail_date(tmp+11, cache);
                tmp[18] = ' ';
                tmp[19] = '\0';
                mail_fetchfrom(tmp+19, ...
So, only 7 chars are reserved for date.
But this is description of mail_date() from imapd-4.5 :
     "This function accepts a message cache element that contains date information, and writes an IMAP-4 date string, that is, one in form:                      
        dd-mmm-yyyy hh:mm:ss +zzzz "

So, date field in header string looks like 
dd-mmm- ( 20-Jul- , for example )

Possible solution: 
	mail_date( tmp+11, cache );
	len = strlen( tmp );
	tmp[len] = ' ' ;
        tmp[len+1] = 0;
	mail_fetchfrom(tmp+len+1 ... 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-20 15:47 UTC] hholzgra at cvs dot php dot net
imap_headers() and it's fixed string layout 
is a dirty hack IMHO
i strongly recommend to use use imap_header()
instead


 [2000-07-21 17:50 UTC] hholzgra at cvs dot php dot net
column size for date increased in cvs
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 20:01:35 2025 UTC