imapflow 1.0.173 → 1.0.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.174](https://github.com/postalsys/imapflow/compare/v1.0.173...v1.0.174) (2025-01-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **auth:** Fixed AUTHENTICATE LOGIN if server uses 'VXNlciBOYW1lAA==' for username ([86c08a7](https://github.com/postalsys/imapflow/commit/86c08a769e2a98fe59375857cd16661e804f79a7))
9
+
3
10
  ## [1.0.173](https://github.com/postalsys/imapflow/compare/v1.0.172...v1.0.173) (2025-01-08)
4
11
 
5
12
 
@@ -66,17 +66,22 @@ async function authLogin(connection, username, password) {
66
66
  onPlusTag: async resp => {
67
67
  if (resp.attributes && resp.attributes[0] && resp.attributes[0].type === 'TEXT') {
68
68
  let question = Buffer.from(resp.attributes[0].value, 'base64').toString();
69
- switch (question.toLowerCase().replace(/:$/, '')) {
70
- case 'username': {
69
+ switch (
70
+ question.toLowerCase().replace(/[:\x00]*$/, '') // eslint-disable-line no-control-regex
71
+ ) {
72
+ case 'username':
73
+ case 'user name': {
71
74
  let encodedUsername = Buffer.from(username).toString('base64');
72
75
  connection.log.debug({ src: 'c', msg: encodedUsername, comment: `Encoded username for AUTH=LOGIN` });
73
76
  connection.write(encodedUsername);
74
77
  break;
75
78
  }
79
+
76
80
  case 'password':
77
81
  connection.log.debug({ src: 'c', msg: '(* value hidden *)', comment: `Encoded password for AUTH=LOGIN` });
78
82
  connection.write(Buffer.from(password).toString('base64'));
79
83
  break;
84
+
80
85
  default: {
81
86
  let error = new Error(`Unknown LOGIN question "${question}"`);
82
87
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.173",
3
+ "version": "1.0.174",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {