update
This commit is contained in:
@@ -829,7 +829,16 @@ export class CommandHandler implements ICommandHandler {
|
||||
this.sendResponse(socket, '334');
|
||||
|
||||
// Wait for credentials
|
||||
credentials = await this.waitForAuthResponse(socket);
|
||||
credentials = await new Promise<string>((resolve, reject) => {
|
||||
const timeout = setTimeout(() => {
|
||||
reject(new Error('Auth response timeout'));
|
||||
}, 30000);
|
||||
|
||||
socket.once('data', (data: Buffer) => {
|
||||
clearTimeout(timeout);
|
||||
resolve(data.toString().trim());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Decode PLAIN credentials (base64 encoded: authzid\0authcid\0password)
|
||||
@@ -847,8 +856,7 @@ export class CommandHandler implements ICommandHandler {
|
||||
// Authenticate using security handler
|
||||
const authenticated = await this.smtpServer.getSecurityHandler().authenticate({
|
||||
username,
|
||||
password,
|
||||
mechanism: 'PLAIN'
|
||||
password
|
||||
});
|
||||
|
||||
if (authenticated) {
|
||||
@@ -929,8 +937,7 @@ export class CommandHandler implements ICommandHandler {
|
||||
// Authenticate using security handler
|
||||
const authenticated = await this.smtpServer.getSecurityHandler().authenticate({
|
||||
username,
|
||||
password,
|
||||
mechanism: 'LOGIN'
|
||||
password
|
||||
});
|
||||
|
||||
if (authenticated) {
|
||||
|
Reference in New Issue
Block a user