Comment 4 for bug 1165531

Hi Etienne,

Even though the bug could initially not be reproduced on OpenERP 7.0, we have reproduced similar cases where the current parsing fails to extract emails. Using the standard email.utils.getaddresses is indeed a better way to implement the parsing, but it does require extra precautions. `getaddresses()` will insert empty strings in the results when parsing fails, even partially, and it will also return invalid addresses if nothing better can be extracted (e.g. ones without even the '@' character that is strictly required by RFC2822). This is presumably a safer default for the stdlib but we need somewhat stricter parsing in OpenERP.

As a result we have adapted the patch of your merge proposal for OpenERP 7.0, with extra checks on the results, and added corresponding unit tests. This has been merged in server 7.0 at revision 5198 revid <email address hidden>

Thanks for reporting the bug and submitting a patch!