diff --git a/lib/pop3/connection.js b/lib/pop3/connection.js index 95fc4681..a05f3b8d 100644 --- a/lib/pop3/connection.js +++ b/lib/pop3/connection.js @@ -855,7 +855,7 @@ class POP3Connection extends EventEmitter { return next(err); } - if (!response.user) { + if (!response || !response.user) { this.logger.info( { tnx: 'authfail', @@ -867,7 +867,7 @@ class POP3Connection extends EventEmitter { username, 'PLAIN' ); - this.send('-ERR [AUTH] ' + (response.message || 'Username and password not accepted')); + this.send('-ERR [AUTH] ' + ((response && response.message) || 'Username and password not accepted')); return next(); }