Bug #69581 [Nab]: filter_var() FILTER_VALIDATE_EMAIL, E-Mail length
| From: | yohgaki@php.net | Date: | Fri, 08 May 2015 06:30:51 +0000 |
| Subject: | Bug #69581 [Nab]: filter_var() FILTER_VALIDATE_EMAIL, E-Mail length | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192572@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69581&edit=1
ID: 69581
Updated by: yohgaki@php.net
Reported by: sebastian at dmwd dot de
Summary: filter_var() FILTER_VALIDATE_EMAIL, E-Mail length
Status: Not a bug
Type: Bug
Package: Filter related
Operating System: Linux
PHP Version: 5.6.8
Block user comment: N
Private report: N
New Comment:
I agree to have RFC compliance in general.
However, most mail system allows "username part == max file name length". It's 255
bytes or so usually. 64 octets limit seems a bit too severe to me. Perhaps, double the limit for
user names? There may be system generated long user names for some purposes. 64 bytes would be long
enough for almost all user names, though.
Previous Comments:
------------------------------------------------------------------------
[2015-05-08 06:12:51] rasmus@php.net
RFC 5322 section 4.5.3.1.1 states:
The maximum total length of a user name or other local-part is 64 octets.
This address is therefore invalid according to the strict interpretation of the RFC
------------------------------------------------------------------------
[2015-05-06 11:50:34] cmb@php.net
Apparently, the behavior has changed as of PHP 5.2.14/5.3.3: <http://3v4l.org/7iHni>
------------------------------------------------------------------------
[2015-05-06 06:04:20] sebastian at dmwd dot de
Description:
------------
Validation of long e-mail addresses with filter_var and FILTER_VALIDATE_EMAIL fails.
Test script:
---------------
var_dump(filter_var('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@foo.com',
FILTER_VALIDATE_EMAIL));
Expected result:
----------------
string(78)
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@foo.com"
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69581&edit=1