From abdc5e2bbe24366c451b5f1bb888ec1d3670d6be Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 5 Oct 2017 15:48:10 +0300 Subject: [PATCH] Added missing method --- imap-core/lib/imap-server.js | 5 +++++ lib/pop3/server.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/imap-core/lib/imap-server.js b/imap-core/lib/imap-server.js index 57260f1a..aa3a58a3 100644 --- a/imap-core/lib/imap-server.js +++ b/imap-core/lib/imap-server.js @@ -6,6 +6,7 @@ const IMAPConnection = require('./imap-connection').IMAPConnection; const tlsOptions = require('./tls-options'); const EventEmitter = require('events').EventEmitter; const shared = require('nodemailer/lib/shared'); +const punycode = require('punycode'); const CLOSE_TIMEOUT = 1 * 1000; // how much to wait until pending connections are terminated @@ -266,6 +267,10 @@ class IMAPServer extends EventEmitter { } } } + + _normalizeHostname(hostname) { + return punycode.toUnicode((hostname || '').toString().trim()).toLowerCase(); + } } // Expose to the world diff --git a/lib/pop3/server.js b/lib/pop3/server.js index e50493ea..f2f149c0 100644 --- a/lib/pop3/server.js +++ b/lib/pop3/server.js @@ -6,6 +6,7 @@ const tls = require('tls'); const tlsOptions = require('../../imap-core/lib/tls-options'); const shared = require('nodemailer/lib/shared'); const POP3Connection = require('./connection'); +const punycode = require('punycode'); const CLOSE_TIMEOUT = 1 * 1000; // how much to wait until pending connections are terminated @@ -144,6 +145,10 @@ class POP3Server extends EventEmitter { } } + _normalizeHostname(hostname) { + return punycode.toUnicode((hostname || '').toString().trim()).toLowerCase(); + } + _setListeners() { this.server.on('listening', () => this._onListening()); this.server.on('close', () => this._onClose());