-
Notifications
You must be signed in to change notification settings - Fork 63
Thunderbird Support for Browserpass #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Implement password storage and autofill for Mozilla Thunderbird: - IMAP/SMTP/POP3/NNTP password retrieval from pass - OAuth2 token storage for Gmail, Microsoft, Fastmail - CalDAV/CardDAV OAuth authentication - Automatic credential migration from Thunderbird's password manager - OAuth browser window autofill via clipboard Uses WebExtension Experiments API to hook into Thunderbird's auth system. Requires separate build (`make thunderbird`) due to experimental APIs.
to decrease the amount of decryption operations needed to find the matching token.
|
This is an impressive amount of work, thanks for sharing! It will take some time to go through, as it's quite a lot of code, but I'll try to not delay it much. @erayd do you have time to review this as well? A few initial questions & remarks, mostly based on PR description:
|
|
Many thanks for your quick response.
|
|
I am using the extension now for over two weeks and did not run into any issues so far.
Let me know if anything else should be changed. |
|
I looked into this over the holidays and it is possible to consolidate the OAuth token to one entry. While my initial implementation takes care of the issue, it is still not as nice as having a consolidated token, especially when a Yubikey with manual interaction for each encryption is used. So I think the issue needs to be fixed in Thunderbird first. I will create an issue and maybe try to fix the issue myself when I have some spare time. I will keep this thread updated. |
Summary
This PR adds Thunderbird email client support to the Browserpass extension. It allows users to store and retrieve email credentials (IMAP, SMTP, POP3) and OAuth tokens (Gmail, Microsoft, Fastmail) from their
passpassword store instead of Thunderbird's built-in password manager.I am already running the implementation locally since a few days. I have tried different setups, fixed several issues on the way and also ran into Thunderbird issues.
For debugging purposes I have added quite some logging, which should not hurt and probably at least be kept until more users tried the extension.
I am interested in this feature myself and got some time to work on this.
It turned out to be much more code then originally anticipated but there were a lot of edge cases to cover and will probably be some more.
Any feedback is appreciated.
Features
passpassTechnical Implementation
Why Separate Builds?
Thunderbird requires WebExtension Experiments to hook into its authentication system, which Firefox doesn't allow for non-privileged add-ons. The experiment API provides access to:
MsgAuthPrompt- Intercepts IMAP/SMTP/POP3 password promptsOAuth2Module- Intercepts OAuth token requests for CalDAV/CardDAVbrowserRequest- Monitors OAuth browser windows for autofillTherefore, the extension is built separately:
make firefox- Standard browser extensionmake thunderbird- Includes experimental credentials APIThe core extension code remains shared; only the manifest and experiment files differ.
Architecture
Requirements
make hosts-thunderbird-userto registerTesting
make thunderbirdcd thunderbird && zip -r browserpass-thunderbird.xpi *Password Store Organization
The
https/directory is for OAuth identity provider login pages (e.g., Google, Okta) that appear in the OAuth browser window during account setup.Design Decisions
1. Offline Startup Control
Thunderbird is forced to start offline to prevent auth requests before the extension is ready (This seems to be a Thunderbird issue). Once hooks are registered, Thunderbird goes online automatically. User's "Always offline" preference is respected.
2. OAuth Token Caching
Tokens retrieved from
passare cached for 8 hours to reduce GPG decryption overhead. Cache is cleared on token update or after the timeout expires.3. Credential Migration
Credentials are migrated from Thunderbird's password manager to
pass. Existingpassentries are not overwritten.4. Service-Specific OAuth Storage
OAuth tokens are stored in service-specific directories (
oauth/mail/,oauth/caldav/,oauth/carddav/) because different services may request tokens with different scopes. A calendar app might request a token with calendar-only permissions, while mail needs separate permissions. Sharing a single token would break services that require permissions the new token doesn't have.Known Limitations
Breaking Changes
None - this is additive functionality that is mainly added to the Thunderbird extension.
Related PRs
A companion PR to browserpass-native is required to register the native host for Thunderbird:
hosts-thunderbird-userandhosts-thunderbirdMakefile targetsfirefox-host.jsonnative messaging manifestReferences