Req #47253 [Opn->Dup]: IMAP connection throws notices on failure which are not suppressed even by @
| From: | cmb@php.net | Date: | Wed, 06 Jan 2021 16:30:54 +0000 |
| Subject: | Req #47253 [Opn->Dup]: IMAP connection throws notices on failure which are not suppressed even by @ | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231415@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47253&edit=1
ID: 47253
Updated by: cmb@php.net
Reported by: bernie at dcbl dot ca
Summary: IMAP connection throws notices on failure which are
not suppressed even by @
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
Package: IMAP related
Operating System: Gentoo Linux
PHP Version: 5.2.8
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Marking as duplicate of bug #65455.
Previous Comments:
------------------------------------------------------------------------
[2016-03-16 15:56:13] 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.
------------------------------------------------------------------------
[2016-03-16 15:49:11] 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
------------------------------------------------------------------------
[2009-01-30 21:29:45] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47253&edit=1