proton-bridge

module
v1.8.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2021 License: GPL-3.0

README

ProtonMail Bridge and Import Export app

Copyright (c) 2020 Proton Technologies AG

This repository holds the ProtonMail Bridge and the ProtonMail Import-Export applications. For a detailed build information see BUILDS. The license can be found in LICENSE file, for more licensing information see COPYING_NOTES. For contribution policy see CONTRIBUTING.

Description Bridge

ProtonMail Bridge for e-mail clients.

When launched, Bridge will initialize local IMAP/SMTP servers and render its GUI.

To configure an e-mail client, firstly log in using your ProtonMail credentials. Open your e-mail client and add a new account using the settings which are located in the Bridge GUI. The client will only be able to sync with your ProtonMail account when the Bridge is running, thus the option to start Bridge on startup is enabled by default.

When the main window is closed, Bridge will continue to run in the background.

More details on the public website.

Description Import-Export app

ProtonMail Import-Export app for importing and exporting messages.

To transfer messages, firstly log in using your ProtonMail credentials. For import, expand your account, and pick the address to which to import messages from IMAP server or local EML or MBOX files. For export, pick the whole account or only a specific address. Then, in both cases, configure transfer rules (match source and target mailboxes, set time range limits and so on) and hit start. Once the transfer is complete, check the results.

More details on the public website.

Launchers

Launchers are binaries used to run the ProtonMail Bridge or Import-Export apps.

Official distributions of the ProtonMail Bridge and Import-Export apps contain both a launcher and the app itself. The launcher is installed in a protected area of the system (i.e. an area accessible only with admin privileges) and is used to run the app. The launcher ensures that nobody tampered with the app's files by verifying their signature using a hardcoded public key. App files are placed in regular userspace and are signed by Proton's private key. This feature enables the app to securely update itself automatically without asking the user for a password.

Keychain

You need to have a keychain in order to run the ProtonMail Bridge. On Mac or Windows, Bridge uses native credential managers. On Linux, use Gnome keyring or pass.

Environment Variables

Bridge application
  • BRIDGESTRICTMODE: tells bridge to turn on bbolt's "strict mode" which checks the database after every Commit. Set to 1 to enable.
Dev build or run
  • APP_VERSION: set the bridge app version used during testing or building
  • PROTONMAIL_ENV: when set to dev it is not using Sentry to report crashes
  • VERBOSITY: set log level used during test time and by the makefile
Integration testing
  • TEST_ENV: set which env to use (fake or live)
  • TEST_APP: set which app to test (bridge or ie)
  • TEST_ACCOUNTS: set JSON file with configured accounts
  • TAGS: set build tags for tests
  • FEATURES: set feature dir, file or scenario to test

Files

Database

The database stores metadata necessary for presenting messages and mailboxes to an email client:

  • Linux: ~/.cache/protonmail/bridge/<cacheVersion>/mailbox-<userID>.db (unless XDG_CACHE_HOME is set, in which case that is used as your ~)
  • macOS: ~/Library/Caches/protonmail/bridge/<cacheVersion>/mailbox-<userID>.db
  • Windows: %LOCALAPPDATA%\protonmail\bridge\<cacheVersion>\mailbox-<userID>.db
Preferences

User preferences are stored in json at the following location:

  • Linux: ~/.config/protonmail/bridge/prefs.json
  • macOS: ~/Library/ApplicationSupport/protonmail/bridge/prefs.json
  • Windows: %APPDATA%\protonmail\bridge\prefs.json
IMAP Cache

The currently subscribed mailboxes are held in a json file:

  • Linux: ~/.cache/protonmail/bridge/<cacheVersion>/user_info.json (unless XDG_CACHE_HOME is set, in which case that is used as your ~)
  • macOS: ~/Library/Caches/protonmail/bridge/<cacheVersion>/user_info.json
  • Windows: %LOCALAPPDATA%\protonmail\bridge\<cacheVersion>\user_info.json
Lock file

Bridge utilises an on-disk lock to ensure only one instance is run at once. The lock file is here:

  • Linux: ~/.cache/protonmail/bridge/<cacheVersion>/bridge.lock (unless XDG_CACHE_HOME is set, in which case that is used as your ~)
  • macOS: ~/Library/Caches/protonmail/bridge/<cacheVersion>/bridge.lock
  • Windows: %LOCALAPPDATA%\protonmail\bridge\<cacheVersion>\bridge.lock
TLS Certificate and Key

When bridge first starts, it generates a unique TLS certificate and key file at the following locations:

  • Linux: ~/.config/protonmail/bridge/{cert,key}.pem (unless XDG_CONFIG_HOME is set, in which case that is used as your ~/.config)
  • macOS: ~/Library/ApplicationSupport/protonmail/bridge/{cert,key}.pem
  • Windows: %APPDATA%\protonmail\bridge\{cert,key}.pem

Directories

Path Synopsis
cmd
internal
api
Package api provides HTTP API of the Bridge.
Package api provides HTTP API of the Bridge.
app/base
Package base implements a common application base currently shared by bridge and IE.
Package base implements a common application base currently shared by bridge and IE.
app/bridge
Package bridge implements the bridge CLI application.
Package bridge implements the bridge CLI application.
app/ie
Package ie implements the ie CLI application.
Package ie implements the ie CLI application.
bridge
Package bridge provides core functionality of Bridge app.
Package bridge provides core functionality of Bridge app.
config/cache
Package cache provides access to contents inside a cache directory.
Package cache provides access to contents inside a cache directory.
config/settings
Package settings provides access to persistent user settings.
Package settings provides access to persistent user settings.
constants
Package constants contains variables that are set via ldflags during build.
Package constants contains variables that are set via ldflags during build.
cookies
Package cookies implements a persistent cookie jar which satisfies the http.CookieJar interface.
Package cookies implements a persistent cookie jar which satisfies the http.CookieJar interface.
crash
Package crash implements a crash handler with configurable recovery actions.
Package crash implements a crash handler with configurable recovery actions.
events
Package events provides names of events used by the event listener in bridge.
Package events provides names of events used by the event listener in bridge.
frontend
Package frontend provides all interfaces of the Bridge.
Package frontend provides all interfaces of the Bridge.
frontend/autoconfig
Package autoconfig provides automatic config of IMAP and SMTP.
Package autoconfig provides automatic config of IMAP and SMTP.
frontend/cli
Package cli provides CLI interface of the Bridge.
Package cli provides CLI interface of the Bridge.
frontend/cli-ie
Package cliie provides CLI interface of the Import-Export app.
Package cliie provides CLI interface of the Import-Export app.
frontend/types
Package types provides interfaces used in frontend packages.
Package types provides interfaces used in frontend packages.
imap
Package imap provides IMAP server of the Bridge.
Package imap provides IMAP server of the Bridge.
imap/uidplus
Package uidplus DOES NOT implement full RFC4315! Excluded parts are: * Response `UIDNOTSTICKY`: All mailboxes of Bridge support stable UIDVALIDITY so it would never return this response Otherwise the standard RFC4315 is followed.
Package uidplus DOES NOT implement full RFC4315! Excluded parts are: * Response `UIDNOTSTICKY`: All mailboxes of Bridge support stable UIDVALIDITY so it would never return this response Otherwise the standard RFC4315 is followed.
importexport
Package importexport provides core functionality of Import-Export app.
Package importexport provides core functionality of Import-Export app.
locations
Package locations implements a type that provides cross-platform access to standard filesystem locations, including config, cache and log directories.
Package locations implements a type that provides cross-platform access to standard filesystem locations, including config, cache and log directories.
metrics
Package metrics collects string constants used to report anonymous usage metrics.
Package metrics collects string constants used to report anonymous usage metrics.
smtp
Package smtp provides SMTP server of the Bridge.
Package smtp provides SMTP server of the Bridge.
store
Package store communicates with API and caches metadata in a local database.
Package store communicates with API and caches metadata in a local database.
store/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
transfer
Package transfer provides tools to export messages from one provider and import them to another provider.
Package transfer provides tools to export messages from one provider and import them to another provider.
transfer/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
users
Package users provides core business logic providing API over credentials store and PM API.
Package users provides core business logic providing API over credentials store and PM API.
users/credentials
Package credentials implements our struct stored in keychain.
Package credentials implements our struct stored in keychain.
users/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pkg
algo
Package algo provides some algorithm utils.
Package algo provides some algorithm utils.
files
Package files provides standard filesystem operations.
Package files provides standard filesystem operations.
keychain
Package keychain implements a native secure password store for each platform.
Package keychain implements a native secure password store for each platform.
message
Package message contains set of tools to convert message between Proton API and IMAP format.
Package message contains set of tools to convert message between Proton API and IMAP format.
message/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pmapi/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
signature
Package signature implements functions to verify files by their detached signatures.
Package signature implements functions to verify files by their detached signatures.
sum
tar
context
Package context allows integration tests to be written in a fluent, english-like way.
Package context allows integration tests to be written in a fluent, english-like way.
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL