Bug #69581 [Com]: filter_var() FILTER_VALIDATE_EMAIL, E-Mail length
| From: | ogilishop at gmail dot com | Date: | Mon, 30 Mar 2020 09:07:57 +0000 |
| Subject: | Bug #69581 [Com]: filter_var() FILTER_VALIDATE_EMAIL, E-Mail length | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226337@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
Comment by: ogilishop at gmail dot com
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:
The maximum total length of a user name or other local-part is 64 octets.
https://foro.ogili.com/
Previous Comments:
------------------------------------------------------------------------
[2019-10-11 06:18:39] ated2019 at gmail dot com
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
https://sushkom.com/antivirus-software/windows
------------------------------------------------------------------------
[2015-05-14 09:50:22] a at b dot c dot de
The "maximum" values given in RFC5321 are the _smallest_ maxima that a server can support
and still claim compliance. It says that a server that rejects a local-part of
sixty-four-octet-local-partdefg4abcdefg5abcdefg6abcdefg7abcdefg8 on the grounds that it's
"too long" is noncompliant. The logical converse is *not* that
sixty-five-octet-local-partdefg4abcdefg5abcdefg6abcdefg7abcdefg8X is too long, but only that a
compliant server will not reject sixty-four-octet-local-partdefg4abcdefg5abcdefg6abcdefg7abcdefg8 on
the grounds of length.
§4.5.3.1 notes that longer address components SHOULD be avoided, but may sometimes be necessary,
and concludes "To the maximum extent possible, implementation techniques that impose no limits
on the length of these objects should be used."
------------------------------------------------------------------------
[2015-05-08 07:23:02] rasmus@php.net
The 64 octets limit for the local part is pretty well-known and it is implemented in many smtp
servers. I think it would be a really bad idea for us to state that an address with a local part
larger than 64 is perfectly valid and then have it not actually work when people try to send mail
with it.
A quick web search reveals:
https://kc.mcafee.com/corporate/index?page=content&id=KB56459
That is some random McAfee email server appliance which clearly has a default limit of 64 for the
local part. You have to manually go in and override it to make it accept longer addresses.
And another one:
http://esupport.trendmicro.com/Pages/Syntax-error-SMTP-Error-Code-501-occurs-when-receiving-mails-with-very.aspx
And another:
http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.halu001/smtpcommands.htm
------------------------------------------------------------------------
[2015-05-08 06:30:50] yohgaki@php.net
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.
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=69581
--
Edit this bug report at https://bugs.php.net/bug.php?id=69581&edit=1