php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37659 imap_headerinfo vs message_id
Submitted: 2006-05-31 19:36 UTC Modified: 2006-06-02 10:47 UTC
From: mad at dactar dot ch Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.1.4 OS: HP-UX
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: mad at dactar dot ch
New email:
PHP Version: OS:

 

 [2006-05-31 19:36 UTC] mad at dactar dot ch
Description:
------------
Message_id retrived by imap_headerinfo is empty when mail is local. Message_id retrived by Thunderbird for exemple is correct event if mail is local.

Reproduce code:
---------------
Very simple code : 

$mbox=imap_open($MAILSERVER,
               $PHP_AUTH_USER,
               $PHP_AUTH_PW);
$header=imap_headerinfo($mbox,
                       $num,
                       80,80);
echo "Message_ID : $header->message_id<br>";


Expected result:
----------------
Always see the Message_id if it is set on the mail server.

Actual result:
--------------
Message_id's content is lost when we use PHP/imap and if the mail is local. There's no problem with mails from outside.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-31 20:19 UTC] judas dot iscariote at gmail dot com
Does imap_fetch_overview() works for you in this case ?

this is unlikely to be a PHP bug,though.
 [2006-06-01 08:39 UTC] tony2001@php.net
PHP uses c-client as the underlying library for ext/imap.
If c-client returns empty/invalid data - there is not much PHP can do about it.
 [2006-06-01 12:46 UTC] mad at dactar dot ch
Thanks for your answer.

> Does imap_fetch_overview() works for you in this case ?

No, it's the problem is also present with imap_fetch_overview.

> If c-client returns empty/invalid data - there is not much PHP can do about it.

It's right, but PHP, PHP's users and website's visitors are impacted. 

So, I can open a bug to c-client's mainteners. I need debug data for that. Is there a way to obtain such info ? 

Thanks for your answer.
 [2006-06-01 14:15 UTC] mad at dactar dot ch
Change status
 [2006-06-01 14:21 UTC] tony2001@php.net
>It's right, but PHP, PHP's users and website's visitors are impacted. 

As well as everybody else using c-client.

>So, I can open a bug to c-client's mainteners. I need debug data for that. Is there a way to obtain such info ? 

You should ask them about it.
 [2006-06-02 10:14 UTC] mad at dactar dot ch
Sorry for the misunderstood, but is it possible to have debug messages with php and a particular extension (in this case imap/c-client) ?

I would have php debug data for imap-client with the php code I've provided.
 [2006-06-02 10:39 UTC] tony2001@php.net
I've no idea what debug messages are you talking about.
Please keep this bug as bogus.
 [2006-06-02 10:47 UTC] mad at dactar dot ch
I'm talking about debug messages for an extension. But if PHP doesn't have a debug mode for the extensions, there's no debug messages available of course.
 [2011-01-26 09:41 UTC] willieyam2003 at yahoo dot com dot hk
I faced similar problem. 
 System info: PHP 5.1; Linux: RHEL 5.x; Qmail_Ldap/courier-imap-4.x

Some mails (about 20% mails)
 imap_headerinfo() & imap_fetcheader() both get empty message_id.

use strlen($msgid); I got the length = 47
But if echo $msgid; the result is empty.

How to fix this problem, please advise.
 [2011-01-27 03:32 UTC] willieyam2003 at yahoo dot com dot hk
I found out what goes wrong.
When echo strstr($msgid,1,$msgidlen-1), the result is normal.
Those 20% email sent by outlook, the message id looks like this: 
<xxxxxxx@yyyyy.com> (html tag). Other mail client message id looks similar but 
imap_headerinfo will change '<' to '&lt;' and '>' to '&gt;' automatically.

$msgid = str_replace('<','',$msgid);
$msgid = str_replace('>','',$msgid);
echo $msgid; 

then the echo result is normal.
 [2014-12-29 23:28 UTC] p at seyfert dot at
thank you, willieyam, that fixed the problem;

message_id appear now. 
same occours with gmx-mails (freemailer) and gmail.

cheers
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 19:01:31 2025 UTC