|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16004 @imap_msgno() and @imap_header() display warnings
Submitted: 2002-03-11 16:24 UTC Modified: 2002-06-26 19:36 UTC
From: dshadow at zort dot net Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.1.2 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dshadow at zort dot net
New email:
PHP Version: OS:


 [2002-03-11 16:24 UTC] dshadow at zort dot net
When processing an email with a header of 'To: ""<>', imap_msgno() and imap_header give errors of "Unexpected characters at end of address: <> (errflg=3) in Unknown on line 0", even when I call the functions with an @ preceding the function name to surpress error output.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-27 18:02 UTC]
This error comes from c-client itself. What version
you have compiled PHP with?

 [2002-03-27 19:20 UTC] dshadow at zort dot net
I'm not sure; I will check tomorrow when I have access to the server and post another followup.
The problem, isn't the error, though. The problem is that putting the @ infront of imap_msgno() and imap_header() _should_ supress the error output, and it is not. The error should not be appearing, but it is.
 [2002-03-27 19:41 UTC]
Afaik this is related to how the current error handling in the ext/imap extension is implemented.

Can you try settings error_reporting(E_NONE); _before_ you call the function in question and see if it does not output the error message? 
 [2002-03-28 09:44 UTC] dshadow at zort dot net
Putting error_reporting(0) supresses the errors. I can use this temporarially, but it's not an effective long-term solution.

E_NONE does not seem to be defined! Should I file a separate bug for this?
 [2002-03-28 09:59 UTC]
E_NONE just doesn't exist :)
 [2002-03-28 10:05 UTC] dshadow at zort dot net
Actually, it's slightly more complex than I thought:

if I bracket the line giving the errors with

$__old_err = error_reporting(0);

I still get the error output. If, however, I leave error_reporting disabled through script completion, the errors are supressed.

Some additional testing reveals that if I simply put an error_reporting(0) at the very end of the script, then the errors are not displayed, regardless of there being @'s in fromt of imap_header() and/or imap_msgno(). But other warnings (like accessing undefined variables) are still thrown.
 [2002-03-28 10:20 UTC]
Sorry for the E_NONE ;-)

Chances are that the error goes to output only on script shutdown ... hmm ...

Will not set this to feedback this time as this should be investiged (I will if I find the time). Remind me that we've similar bug reports for this behaviour.
 [2002-06-26 19:36 UTC]
This should be fixed in PHP 4.2.1 and properly fixed in PHP 4.2.2-dev found here:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Jan 30 09:05:52 2023 UTC