haraka / node-address-rfc2822

Parser for RFC2822 (Header) format email addresses
https://www.npmjs.com/package/address-rfc2822
53 stars 16 forks source link

Can not parse address like "test@example.com <test@example.com>" #36

Closed wanglian closed 5 years ago

wanglian commented 5 years ago

This module works great. But recently I got some emails including addresses like "test@example.com \test@example.com\", and can not be parsed.

> const emailParser = require('address-rfc2822');
> emailParser.parse("test@example.com <test@example.com>")
Error: No results
    at evalCommandPromise.then (packages/shell-server/shell-server.js:249:21)
    at runBound (domain.js:314:12)
    at bound (domain.js:301:14)
    at defaultEval (repl.js:240:29)
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at repl:1:-49
    at Object.parse (/xxxx/node_modules/address-rfc2822/index.js:20:22)
msimerson commented 5 years ago

That address format isn't correct. Unless you can point me to an RFC showing that as valid syntax, it's my opinion that this module has done the right thing.

wanglian commented 5 years ago

Agree totally. I looked into the RFC, @ is not a valid character for atoms. It's not correct, but it exits. I have to find another way. Thanks!