bgarrels / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

@localhost and @127.0.0.1 email addresses not permitted on setup #418

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start setup from /textpattern/setup
2. Enter a @localhost or @127.0.0.1 email address, such as foo@localhost

What is the expected output? What do you see instead?
I expected to see foo@localhost accepted, since it's a valid email address 
according to my understanding of RFC5322. It throws the 'invalid email' error 
message.

What version of the product are you using? On what operating system?
4.5.5, Ubuntu 14.04.

Please provide any additional information below.

Original issue reported on code.google.com by p...@pragmatika.net on 11 Jul 2014 at 4:23

GoogleCodeExporter commented 9 years ago
You're right that our current regex doesn't support these cases. In 4.6+ we've 
moved to using PHP's built-in filter_var() function to validate email 
addresses. While I could bring that forward to 4.5, it won't help much because 
the PHP team have labelled it a Won't-Fix issue: 
https://bugs.php.net/bug.php?id=49576.

Their argument about 127.0.0.1 having to be in square brackets to meet the spec 
is true. And, in fact if we switch to using filter_var(), that one will be 
permitted. However, @localhost and other non-tld-style email addresses will all 
fail. The suggestion on the PHP bug thread is to test separately for such 
special cases and allow them through, but that's pretty difficult given that 
you could use @localhost, @box, @server, @squid, ... as server aliases.

Bottom line is that aliases such as localhost will probably not be supported. 
But I can permit @[127.0.0.1] by employing PHP's filter instead of our own, 
which is at least a compromise.

Original comment by stefdawson on 11 Sep 2014 at 11:12

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r5892.

Original comment by stefdawson on 11 Sep 2014 at 11:14