OTRS/otrs — pull request #20 by reneeb (2013-03-21 22:10:07+00:00)
Title: Use Email::Valid to validate email addresses

Hi Martin,

a second attempt...

You said on the last pull request

"It is very welcome, we need a fix for http://bugs.otrs.org/show_bug.cgi?id=9200 which would probably work with this module." and
"Some of the tests in CheckItem.t fail, including 'ä@somehost.com' which validated correctly before (with the proprietary regex implementation). Items which clearly violate the spec do not have to be supported, but using unicode in the email address seems ok to me - is it forbidden in the spec?"

This should fix 9200:
perl -MEmail::Valid -E 'say "valid" if Email::Valid->address( q~mail@xn--f1aefnbl.xn--p1ai~ )'
valid

Unicode in email addresses are allowed when rfc6531 is supported. But neither the original regex nor Mail::RFC822::Address nor Email::Valid implements that rfc. Both CPAN modules implement rfc822, the OTRS regex doesn't implement any rfc completely.