Hi Mime-4J Dev,

I'm using the AddressBuilder class in Mime-4J (v0.7.2) to parse email addresses from MIME headers and it appears to deal oddly with quoted email addresses. Right now this is mostly a theoretical concern as nobody seems to deploy them:

If you call:
AddressBuilder.DEFAULT.parseAddressList("Anonymous <[email protected]>").get(0).getString()
you get back:
[email protected]

But if you call:
AddressBuilder.DEFAULT.parseAddressList("Anonymous <"very.common"@example.com>").get(0).getString()
you also get back:
[email protected]

But I was expecting:
"very.common"@example.com

For this example it might well be the same user but:
Anonymous <"[email protected]"@example.com>
will be returned as:
[email protected]@example.com
which is then invalid.

It only appears to remove one level of escaping & quoting, so instead of:
"very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com

you get:
very.(),:;<>[]".VERY."very@\ "very"[email protected]

Am I using the API wrong for this sort of parsing of MIME headers?

Reply via email to