SmtpClient.jsm: can't send due checking for base64 encoded "Username:" - should check commonly used "username:" as well
Categories
(MailNews Core :: Networking: SMTP, defect)
Tracking
(thunderbird_esr102 wontfix)
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:
Assignee | ||
Comment 1•2 years ago
|
||
Maybe you want to submit a patch? It would also be useful to add a comment that the data is BASE64 encoded username:
https://searchfox.org/comm-central/rev/fa4b40901905f5bc25d0eebb42037fb8a5da03cc/mailnews/compose/src/SmtpClient.jsm#977
See https://developer.thunderbird.net/thunderbird-development/getting-started
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
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
Assignee | ||
Updated•2 years ago
|
Description
•