Edit report at https://bugs.php.net/bug.php?id=64981&edit=1

 ID:                 64981
 Comment by:         mail+php at requinix dot net
 Reported by:        fillmorejd at gmail dot com
 Summary:            Email with multiple period in a row fail
 Status:             Open
 Type:               Bug
 Package:            Filter related
 Operating System:   Mac Mountain Lion
 PHP Version:        5.4.15
 Block user comment: N
 Private report:     N

 New Comment:

Multiple consecutive periods in normal email addresses really is invalid. The 
fact 
that Gmail supports it does not make it valid.

Both RFC 5321 (SMTP) and 5322 (Internet Message Format) paraphrased say:
  addr-spec = dot-atom "@" domain
  dot-atom = atext+ ("." atext+)*
  atext = letters | digits | some symbols not including "."


Previous Comments:
------------------------------------------------------------------------
[2013-06-06 20:33:36] fillmorejd at gmail dot com

Description:
------------
Email with multiple period in a row fail validation when they are working 
email.  
With gmail you can add periods into any email address and it will still 
deliver.  
I use this to filter out messages.  [email protected] is the same as 
[email protected]  or [email protected] or [email protected].

With one period or if there is a letter or number between period the 
FILTER_VALIDATE_EMAIL works just fine but if more than one period it fails. 

Test script:
---------------
<?php
$email_a = '[email protected]';
$email_b = '[email protected]';
$email_c = '[email protected]';

if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_a) email address is considered valid.\n";
} else {
    echo "$email_a failed\n";
}

if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_b) email address is considered valid.\n";
} else {
    echo "$email_b failed\n";
}

if (filter_var($email_c, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_c) email address is considered valid.\n";
} else {
    echo "$email_c failed\n";
}

Expected result:
----------------
This ([email protected]) email address is considered valid.
This ([email protected]) email address is considered valid.
This ([email protected]) email address is considered valid.

Actual result:
--------------
This ([email protected]) email address is considered valid.
This ([email protected]) email address is considered valid.
[email protected] failed


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64981&edit=1

Reply via email to