Skip to content

Commit

Permalink
fix(pop3): if connection is closed during authentication, then do not…
Browse files Browse the repository at this point in the history
… process the response. Fixes #596
  • Loading branch information
andris9 committed Jan 4, 2024
1 parent a4ae3d7 commit eecb31a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pop3/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ class POP3Connection extends EventEmitter {
},
this.session,
(err, response) => {
if (!this.session) {
// already closed, do nothing
return;
}

if (err) {
this.logger.info(
{
Expand Down Expand Up @@ -438,6 +443,7 @@ class POP3Connection extends EventEmitter {
username,
'USER'
);

this.session.user = response.user;

this.openMailbox(err => {
Expand Down

0 comments on commit eecb31a

Please sign in to comment.