Describe the bug
I created an app password for Gmail (I know this is not secure), but when I tried to use this password to connect to the IMAP server, an error occurred.
At first, I thought it was Gmail no longer supporting app password login. However, I wrote a test code using the imaplib library in Python and found that I could successfully log in and read emails using an app password. But I don't want to continue my work with Python.
{"level":30,"time":1721223817642,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"connection","msg":"Established secure TCP connection","cid":"toof9rx21qvodaswjwqt","secure":true,"host":"imap.gmail.com","servername":"imap.gmail.com","port":993,"address":"74.125.204.109","localAddress":"192.168.66.13","localPort":39202,"authorized":true,"algo":"TLS_AES_256_GCM_SHA384","version":"TLSv1.3"}
{"level":20,"time":1721223817910,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"* OK Gimap ready for requests from 5.11.111.xx e16mb181215774oiw","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223817911,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"1 CAPABILITY","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818163,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818164,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"1 OK Thats all she wrote! e16mb181215774oiw","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818164,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"2 ID (\"name\" \"imapflow\" \"version\" \"1.0.162\" \"vendor\" \"Postal Systems\" \"support-url\" \"https://github.com/postalsys/imapflow/issues\")","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818413,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"* ID (\"name\" \"GImap\" \"vendor\" \"Google, Inc.\" \"support-url\" \"http://support.google.com/mail\" \"remote-host\" \"5.34.2xxx.xx\" \"connection-token\" \"e16mb181215774oiw\")","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818413,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"2 OK Success e16mb181215774oiw","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818413,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"3 LOGIN xxxxxxxx@gmail.com \"(* value hidden *)\"","cid":"toof9rx21qvodaswjwqt"}
{"level":20,"time":1721223818678,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","src":"s","msg":"3 BAD Failed to parse your command e16mb181215774oiw","cid":"toof9rx21qvodaswjwqt"}
{"level":50,"time":1721223818679,"pid":1513389,"hostname":"wang-nix","component":"imap-connection","cid":"toof9rx21qvodaswjwqt","err":{"type":"Error","message":"Command failed","stack":"Error: Command failed\n
at ImapFlow.reader (/home/physails/workspaces/nodejs/tg-bot/node_modules/imapflow/lib/imap-flow.js:571:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","response":"3 BAD
Failed to parse your command e16mb181215774oiw","responseStatus":"BAD","responseText":"Failed to parse your command e16mb181215774oiw","authenticationFailed":true},"cid":"toof9rx21qvodaswjwqt","msg":"Command failed"}
node:internal/process/esm_loader:34
internalBinding('errors').triggerUncaughtException(
^
Error: Command failed
at ImapFlow.reader (/home/physails/workspaces/nodejs/tg-bot/node_modules/imapflow/lib/imap-flow.js:571:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
response: '3 BAD Failed to parse your command e16mb181215774oiw',
responseStatus: 'BAD',
responseText: 'Failed to parse your command e16mb181215774oiw',
authenticationFailed: true
}
Node.js v20.12.2
Expected behaviorconnect() method should be success.
I looked througth all closed issues, Must I use accessToken? oauth is so complex.
Describe the bug I created an app password for Gmail (I know this is not secure), but when I tried to use this password to connect to the IMAP server, an error occurred. At first, I thought it was Gmail no longer supporting app password login. However, I wrote a test code using the imaplib library in Python and found that I could successfully log in and read emails using an app password. But I don't want to continue my work with Python.
To Reproduce
See error
Expected behavior
connect()
method should be success.I looked througth all closed issues, Must I use accessToken? oauth is so complex.