php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51708 imap_open() improperly trimming spaces from username
Submitted: 2010-04-30 21:05 UTC Modified: 2010-05-03 15:34 UTC
From: slusarz at curecanti dot org Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
 [2010-04-30 21:05 UTC] slusarz at curecanti dot org
Description:
------------
Per RFC 3501 [9], spaces are valid characters in a username.  Thus, 'username' != ' username '.  However, imap_open() appears to be stripping leading/trailing whitespace from the username.

Test script:
---------------
<?php

$mailbox = '{localhost:143}INBOX';
// 'username' is valid user; ' username ' is invalid user
$username = ' username ';
$password = 'password';

$res = imap_open($mailbox, $username, $password, OP_HALFOPEN);

if (is_resource($res)) {
    print "SUCCESS\n";
} else {
    print "FAILED\n";
}


Expected result:
----------------
FAILED

Actual result:
--------------
SUCCESS

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-03 15:34 UTC] iliaa@php.net
-Status: Open +Status: Bogus
 [2010-05-03 15:34 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The trimming (if it happens) is done by c-client lib, not PHP.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 12:03:34 2021 UTC