php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47253 IMAP connection throws notices on failure which are not suppressed even by @
Submitted: 2009-01-30 21:29 UTC Modified: 2021-01-06 16:30 UTC
Votes:11
Avg. Score:4.2 ± 0.7
Reproduced:11 of 11 (100.0%)
Same Version:1 (9.1%)
Same OS:3 (27.3%)
From: bernie at dcbl dot ca Assigned: cmb (profile)
Status: Duplicate Package: IMAP related
PHP Version: 5.2.8 OS: Gentoo 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bernie at dcbl dot ca
New email:
PHP Version: OS:

 

 [2009-01-30 21:29 UTC] bernie at dcbl dot ca
Description:
------------
IMAP connection throws notices on failure which are not suppressed even 
by @

Notice: Unknown: Retrying PLAIN authentication after Login failed. 
(errflg=1) in Unknown on line 0

Notice: Unknown: Retrying PLAIN authentication after Login failed. 
(errflg=1) in Unknown on line 0

Notice: Unknown: Can not authenticate to IMAP server: Login failed. 
(errflg=2) in Unknown on line 0<

when IMAP command fails, the follow errors are returned and can not be 
suppressed, by changing log status or by using @ infront of the lines

Reproduce code:
---------------
<?php

$mailbox = 'INBOX';
$username = 'emaildoesntexist@example.org';
$password = 'orpasswordnotcorrect';

imap_open ($mailbox, $username, $password);

// regardless of log settings, assuming the imap account is invalid,
// errors are returned to the client 

?>

Expected result:
----------------
should be able to stop errors from being returned to client
should listed to logging levels

Actual result:
--------------
errors are returned to webuser
changing log levels does not affect it

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 20:43 UTC] jani@php.net
-Package: Feature/Change Request +Package: IMAP related
 [2016-03-16 15:49 UTC] sebastian at krebs dot one
Still an issue.

This is related to other kinds of issues with imap_open() or even all imap_*() functions

Trying to connect to an imap-server with /secure, which doesn't support it


----
PHP Notice:  Unknown: Can't do secure authentication with this server (errflg=2) in Unknown on line 0
 [2016-03-16 15:56 UTC] sebastian at krebs dot one
I just found this

https://github.com/php/php-src/blob/b402da28a1d89692f555ce5ef1e191fdd3a943b9/ext/imap/php_imap.c#L1076

On shutdown the imap extension just prints out every remaining error. Thats annoying

- You cannot intercept it
- At that point I'm probably not interested in this issue anymore
- imap_last_error() does _not_ remove errors from the error buffer



As a workaround simply call imap_errors() to clear the error cache. That should be at least documented somewhere.
 [2021-01-06 16:30 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-01-06 16:30 UTC] cmb@php.net
Marking as duplicate of bug #65455.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC