node-poplib
node-poplib copied to clipboard
Login command returns a false positive if IMAP host is used
Summary:
If I mistakenly connect to an IMAP server instead of a POP3 one, the client connects me successfully and the login status returns true even if my credentials are incorrect.
Code:
var transport = new POP3Client(993, 'imap.google.com', { enabletls: true });
transport.on('connect', () => {
console.log('Connection established!');
transport.login('[email protected]', 'invalidpassword')
});
transport.on('login', (status, response) => {
console.log('Status:', status);
console.log('Response:', response);
});
Output:
Connection established!
Status: true
Response: 'PASS BAD Unknown command g67mb393707070wme\r\n'
Expectation: Status needs to be false since my email address / password is incorrect, or I shouldn't be able to connect successfully at all since I'm connecting to an imap server.