question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[GMail with Thunderbird] After authorization, Thunderbird is still unable to access account

See original GitHub issue

Thanks for creating this project. OAuth on Gmail will soon be mandatory, so this tool seems to be the only way now to use non-oauth clients.

Now I managed to get the OAuth part working (I think), but I am using Thunderbird and it still fails to log into the account even after I provided the token to the proxy.

This is the debug output I get:

2022-04-29 15:17:18: Accepting new connection to IMAP server at localhost:1993 (unsecured)
 proxying imap.gmail.com:993 (SSL/TLS) via ('127.0.0.1', 20836)
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) --> [ Client connected ]
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     <-- b'* OK Gimap ready for requests from xx k5mb14775076ljm\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) <-- b'* OK Gimap ready for requests from xx k5mb14775076ljm\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) --> b'1 capability\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     --> b'1 capability\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     <-- b'* 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 AUTH=XOAUTH\r\n1 OK Thats all she wrote! k5mb14775076ljm\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) <-- b'* CAPABILITY IMAP4rev1 UNSELECT IDLE
NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=PLAIN AUTH=PLAIN-CLIENTTOK
EN AUTH=PLAIN AUTH=XOAUTH\r\n1 OK Thats all she wrote! k5mb14775076ljm\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) --> b'2 authenticate plain\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) <-- b'+ \r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) --> b'[[ Credentials removed from proxy log ]]'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     --> b'2 AUTHENTICATE XOAUTH2 '
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     --> b'[[ Credentials removed from proxy log ]]'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     --> b'\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     <-- b'* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651
584\r\n2 OK xxxx@gmail.com authenticated (Success)\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) <-- b'* CAPABILITY IMAP4rev1 UNSELECT IDLENAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584\r\n2 OK xxxx@gmail.com authenticated (Success)\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) --> b'3 COMPRESS DEFLATE\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     --> b'3 COMPRESS DEFLATE\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836)     <-- b'3 OK Success\r\n'
2022-04-29 15:17:19: IMAP ('127.0.0.1', 20836) <-- b'3 OK Success\r\n'
2022-04-29 15:18:59: IMAP ('127.0.0.1', 20836) --> [ Client disconnected ]

Thunderbird is stuck at this point with status bar message:

Sending login information...

So for some reason the proxy is not authenticating Thunderbird as a client?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
simonrobcommented, Apr 30, 2022

Thanks for persevering with this!

The key reason for this issue is, as you’ve identified, that the proxy doesn’t always enter pass-through mode correctly, both when multi line messages are received; and, when the confirmation message is in the same line as a CAPABILITY update.

Even with Thunderbird this isn’t the whole story, however, as that client does recognise a successful login (see my earlier message). The additional issue is that Thunderbird subsequently requests COMPRESS DEFLATE, which means the proxy can no longer parse any messages at all, and in non-pass-through mode this means that its line ending check always fails, causing it to stop relaying messages.

I’ll look at a fix later that resolves these interconnected issues. Thanks again for the help with this.

0reactions
caspercommented, Apr 30, 2022

Ok. Great. Good stuff. Thanks for your work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thunderbird suddenly can't access gmail account
Right click on pop gmail account in Folder Pane and select 'Settings'. · click on 'Edit SMTP server' · Edit the Authentication method:...
Read more >
Thunderbird Authentication Failure Gmail - Not Working Account
Thunderbird Authentication Failure Gmail - Not Working Account https://www.recoverytools.com/blog/google-less-secure-apps-end-of-life/You ...
Read more >
Mozilla Thunderbird Not Working with Gmail
Click on the Gmail account where the issue is occurring. From the top right corner, select 'Account settings.
Read more >
Can't Access GMAIL through Mozilla Thunderbird Email today ...
In Thunderbird, try going to Tools-Preferences, Privacy and Security; check the box for Accept cookies from sites. (I had same problem and this ......
Read more >
Trouble with Gmail Authentication? Try this : r/Thunderbird
Thunderbird SHOULD transition you automatically, but if you're not able to connect, try going into your Gmail Account's Server Settings and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found