This was first reported on this issue:
http://drupal.org/node/209672
Quoting RFC2822 Internet message format:
Normally, a mailbox is comprised of two parts: (1) an optional display name that indicates the name of the recipient (which could be a person or a system) that could be displayed to the user of a mail application, and (2) an addr-spec address enclosed in angle brackets ("<" and ">"). There is also an alternate simple form of a mailbox where the addr-spec address appears alone, without the recipient's name or the angle brackets. The Internet addr-spec address is described in section 3.4.1.
Comment | File | Size | Author |
---|---|---|---|
#9 | valid-email-address-rfc2822-214114-9.patch | 624 bytes | valthebald |
#7 | valid-email-address-rfc2822-214114-7.patch | 613 bytes | valthebald |
#5 | valid-email-address-rfc2822-214114.patch | 759 bytes | valthebald |
#3 | valid-email-address-rfc2822-214114-d8.patch | 759 bytes | valthebald |
#3 | valid-email-address-rfc2822-214114-d7.patch | 739 bytes | valthebald |
Comments
Comment #1
lilou CreditAttribution: lilou commentedReroll.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #3
valthebaldIn 8.x-dev and 7.x-dev, valid_email_address() relies on filter_var() function with FILTER_VALIDATE_EMAIL parameter.
However, as of the latest stable PHP version, filter_var() does not conform to RFC 2822 (i.e. see PHP bugs (https://bugs.php.net/bug.php?id=43402, https://bugs.php.net/bug.php?id=54403)
I think that approach suggested by theborg is better than currently existing in core.
Comment #4
valthebaldRerolling the patch
Comment #5
valthebaldMy bad, I thought that -d8.patch will be submitted for testing, resubmitting with correct name
Comment #7
valthebaldCombining 2 approaches: split $mail to (optional) name and address parts, then validate address part with filter_var()
Comment #8
thedavidmeister CreditAttribution: thedavidmeister commentedminor coding standards issue, need a space after (bool)
https://drupal.org/coding-standards
Comment #9
valthebaldHere we go
Comment #10
alansaviolobo CreditAttribution: alansaviolobo commentedtested this in codepad http://codepad.org/EQlk2KA4
The following code should have returned all true. doesnt seem to be the case
Comment #17
andypostFor d7 #2343043: valid_email_address() should use egulias/EmailValidator and become deprecated