- Shell 81.5%
- Dockerfile 18.5%
Add scripts/scan-image.sh to run Grype scans with JSON/SARIF output. Update Dockerfile: pin google.golang.org/grpc, run apt-get upgrade, and remove net-tools from runtime deps. Fix README example filename to docker-compose.yaml. |
||
|---|---|---|
| scripts | ||
| .gitignore | ||
| docker-build.sh | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| entrypoint.sh | ||
| GPGparams.txt | ||
| LICENSE.txt | ||
| logo.png | ||
| README.md | ||
| VERSION | ||
Proton Mail Bridge docker
A docker version of the Proton mail Bridge command line interface. It creates a local SMTP server, so other docker containers can send emails via your Proton email account.
!WARNING! As of the time of this writing, you need a paid plan (Mail Plus, Proton Unlimited or Proton for Business) to be able to log in. It won't work for free account.
(Merci Korben pour le logo)
Install
Download the latest docker image from:
docker pull code.paulg.it/paulgit/proton-mail-bridge:latest
Launch it with the following command to expose TCP ports 12025 for SMTP and 12143 for IMAP on your local network interface.
You MUST provide a path volume storage (mkdir /path/to/your/volume/storage).
docker run -d --name=protonmail_bridge -v /path/to/your/volume/storage:/root -p 127.0.0.1:12025:25/tcp -p 127.0.0.1:12143:143/tcp --network network20 --restart=unless-stopped paulgit/proton-mail-bridge:latest
OR (docker compose version):
wget https://code.paulg.it/paulgit/protonmail-bridge-docker/raw/branch/master/docker-compose.yaml
docker-compose up -d
Setup
Now, you need to open a bash terminal on the current running container and use the Proton Bridge interactive command line:
docker exec -it protonmail_bridge /bin/bash
# First we need to kill the default bridge startup instance (only one instance of bridge can run at the same time)
root@8972584f86d4:/app# pkill bridge
# Login to your Proton account:
root@8972584f86d4:/app# /usr/bin/bridge --cli
....
Welcome to Proton Mail Bridge interactive shell
....
>>> info
No active accounts. Please add account to continue.
# Type help for a list of all commands:
>>> help
# Login to a Proton account (!MUST! be a paid plan to use this client), follow the instructions on screen:
# Tip: Use Ctrl+Shift+V to paste on most Linux terminal.
>>> login
Username: test_account@proton.me
Password:
Authenticating ...
Two factor code: 123456
Account test_account was added successfully.
>>> A sync has begun for test_account.
Sync (test_account): 1.0% (Elapsed: 0.5s, ETA: 46.0s)
...
Sync (test_account): 99.9% (Elapsed: 50.4s, ETA: 0.4s)
A sync has finished for test_account.
>>>
# Success !
IF you are using multiple domain names or email addresses, you SHOULD switch to split address mode (it will set credentials for each address in the account).
It will sync the account again, time to grab a coffee.
>>> change mode 0
Are you sure you want to change the mode for account test_account to split? yes/no: yes
Address mode for account test_account changed to split
>>> A sync has begun for test_account.
Sync (test_account): 1.0% (Elapsed: 0.3s, ETA: 32.6s)
...
Sync (test_account): 99.9% (Elapsed: 50.4s, ETA: 0.4s)
A sync has finished for test_account.
>>>
Use the following information to connect via an SMTP client. The port numbers for the SMTP/IMAP connections are 12025 and 12143 (see command docker ps), NOT the one provided by the infocommand.
You MUST copy the username AND password from the info command (the password is random and different from your Proton account):
>>> info
Configuration for test_account@proton.me
IMAP Settings
Address: 127.0.0.1
IMAP port: 1143
Username: test_account@proton.me
Password: abcedfGHI12345
Security: STARTTLS
SMTP Settings
Address: 127.0.0.1
SMTP port: 1025
Username: test_account@proton.me
Password: abcedfGHI12345
Security: STARTTLS
Configuration for another_account@proton.me
....
# Exit
>>> exit
root@8972584f86d4:/app# exit
See a list of all Proton bridge commands available here or use the help command.
We have killed the default bridge instance by exiting it during the previous step, so we MUST restart the container:
docker container restart protonmail_bridge
OR (docker compose version):
docker-compose restart
(Optional) You can check the bridge command line output with:
docker container logs protonmail_bridge
It should end with A sync has finished for <name_of_your_account>
Notes
- Your email client might complain about the self-signed certificate used by Proton mail bridge server.
- If you want other docker containers to only be able to send emails, you should only expose SMTP port 25.
License
Copyright (c) 2026 David BASTIEN, Paul Rudkin
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Sources:
Made from Debian 12 (bookworm) Go image and latest Proton Mail Bridge sources