mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-09-20 15:26:03 +08:00
updated normalize method
This commit is contained in:
parent
0d3ed29ebf
commit
d12c453937
|
@ -65,7 +65,13 @@ function normalizeAddress(address, withNames) {
|
||||||
.trim();
|
.trim();
|
||||||
let encodedDomain = domain;
|
let encodedDomain = domain;
|
||||||
try {
|
try {
|
||||||
encodedDomain = punycode.toUnicode(domain);
|
if (/^xn--/.test(domain)) {
|
||||||
|
encodedDomain = punycode
|
||||||
|
.toUnicode(domain)
|
||||||
|
.normalize('NFC')
|
||||||
|
.toLowerCase()
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
} catch (E) {
|
} catch (E) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue