#106 E-Mail validation according to RFC 2822

open
nobody
Core (30)
5
2014-08-16
2012-07-17
Seelenhirt
No

When trying to add a new mail box, Postfix Admin rejects some valid email addresses claiming they are invalid (you can find some examples in [1]). If I correctly understand the code the function in question is check_email in functions.inc.php. The regex checking for validity is too simple to encompass the complex universe of email addresses.
I suggest the adaption of said function so it conforms to RFC 2822. Some approaches for an implementation in PHP can be found in this article [2].

[1] https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses
[2] http://www.linuxjournal.com/article/9585?page=0,0

Discussion

  • Charles
    Charles
    2012-07-18

    Id disagree that all addresses that may be *technically* valid should be considered valid by postfixadmin. Most mail systems would not consider as valid email addresses with most of the special characters in them.

    Maybe have a 'fully compliant' option that is disabled by default, but I would never use it.