Skip to content

Commit

Permalink
monkey patch unicode username support
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Sep 13, 2016
1 parent f4ee662 commit bb6557f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/feeder-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ class FeederServer {
}
if (
isemail.validate(
address.address, {
// monkey patch unicode character support by replacing non ascii chars with 'x'
// we do not use the built in DNS resolving by isemail, so it should
// not break anything but it allows us to use unicode usernames
(address.address || '').replace(/[\u0080-\uFFFF]/g, 'x'), {
// method returns 0 if the error level is lower than 17
// below 17: address is valid for SMTP but has unusual elements
errorLevel: 17
Expand Down

0 comments on commit bb6557f

Please sign in to comment.