Closed Bug 1824060 Opened 2 years ago Closed 2 years ago

SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well

Categories

(MailNews Core :: Networking: SMTP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102 wontfix)

RESOLVED FIXED
114 Branch
Tracking Status
thunderbird_esr102 --- wontfix

People

(Reporter: xf0rk, Assigned: mkmelin)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Steps to reproduce:

The thunderbird client can not send the new email, then I found a bug after reviewing the SmtpClient.jsm file.

Here is the part code of the SmtpClient.jsm file. The client will continue to send the username when the command data is "VXNlcm5hbWU6", but there are so many smtp servers asking the username with the challenge field "dXNlcm5hbWU6". So the normal smtp authentication is aborted, finally we can not send the new email.


_actionAUTH_LOGIN_USER(command) {
if (command.statusCode !== 334 || command.data !== "VXNlcm5hbWU6") {
this._onNsError(MsgUtils.NS_ERROR_SMTP_AUTH_FAILURE, command.data);
return;
}
this.logger.debug("AUTH LOGIN USER");
this._currentAction = this._actionAUTH_LOGIN_PASS;
this._sendCommand(btoa(this._authenticator.username), true);
}


"VXNlcm5hbWU6", "Username:" encoded with BASE64 encoding. "dXNlcm5hbWU6", "username:" encoded with BASE64 encoding. So it should not be case sensitive ?

I fixed the bug like this,and rebuilded the thunderbird. Then it works for me.


_actionAUTH_LOGIN_USER(command) {
if (command.statusCode !== 334 || (command.data !== "VXNlcm5hbWU6" && command.data !== "dXNlcm5hbWU6")) {
this._onNsError(MsgUtils.NS_ERROR_SMTP_AUTH_FAILURE, command.data);
return;
}
this.logger.debug("AUTH LOGIN USER");
this._currentAction = this._actionAUTH_LOGIN_PASS;
this._sendCommand(btoa(this._authenticator.username), true);
}

Actual results:

Some users can not send the new email with some smtp servers (eg smtp.163.com, smtp.alibaba.com ...)

Expected results:

Status: UNCONFIRMED → NEW
Component: Message Compose Window → Networking: SMTP
Ever confirmed: true
Product: Thunderbird → MailNews Core
Summary: can not send email, validation error in SmtpClient.jsm source file → SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Target Milestone: --- → 114 Branch
Attachment #9330527 - Attachment description: Bug 1824060 - SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well. r=#thunderbird-reviewers → Bug 1824060 - SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well. r=leftmostcat

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ab2206e58eda
SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well. r=leftmostcat

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: