Everything goes fine… if I don’t then I get an:
Unrecognised line: Jesse Vincent email@example.com at /usr/lib/rt/RT/EmailParser.pm line 406
I’ve gone deep until Mail::Address code itself and the parameter value
seems to be correct all the way. I test the perl code inside a script and
it runs ok.
I found the same problem with an entire different setup at:
I tested it with Mail::Address 1.58 and 1.62 same behavior. The most
weired thing it that it works running a script from command-line calling
directly and indirectly (through RT::EmailParser::ParseAddressFromHeader),
hardcoding the $email variable…
It does not work even reimplementing the ParseAddressFromHeader locally at
Any hints? I’m getting mad with this one…
Just for the record, the cause and solution:
Mail::Address->parse($email) caused an the error (croaks):
Unrecognised line: ‘firstname.lastname@example.org’
Well it seems that perl 5.8.0-5.8.X has a problem with utf8/regexps.
The internal representation of perl strings has an UTF-8 flag associated
that can be turned off via Encode::_utf8_off($string), so a way to solve
some issues like this are to use this workaround. (see Encode
documentation for more details).
I saw postings refering that the problem may be cause by using perl with
thread support, which is not the case I tested it under perl with and
without thread support with the same results. (The stock perl shipped with
some distros are threaded enabled: e.g. RedHat 9, RHEL, WBEL…)
A generic workaround to cases like this would be to use:
before calling the problematic function, which in this case is
This has to be used with caution since it messes with perl internals, so
sometimes you’ll have to switch the flag on after calling the function.
If there’s something incorrect above please let me know!!!
|Sys & Net Admin | Serviï¿½o de Informï¿½tica |
|Faculdade de Ciï¿½ncias e Tecnologia | Tel: +351-21-2948596 |
|Universidade Nova de Lisboa | Fax: +351-21-2948548 |
|P-2829-516 Caparica | e-Mail: email@example.com |