Used to handle applications sending mail, because of enryption of Proton Mail.
Code: https://github.com/dancwilliams/protonmail-bridge-docker
We will configure this with only SMTP and no IMAP so we get more security. Only sending is allowed
Big picture
Application (Docker) → SMTP → Proton Bridge (Docker) → Proton Mail
# Clone project & copy config
cd /opt && sudo git clone https://github.com/dancwilliams/protonmail-bridge-docker.git
sudo mkdir prod-protonmail-bridge-docker && sudo cp protonmail-bridge-docker/docker-compose.yml prod-protonmail-bridge-docker/
vi prod-protonmail-bridge-docker/docker-compose.yml
Edit docker-compose.yml
services:
protonmail-bridge:
image: dancwilliams/protonmail-bridge:latest
# ports: # leave this of only docker container need to send mail
# - 1025:25/tcp # SMTP - Sending mails & expose to LAN
# - 127.0.0.1:1025:25/tcp # Same but only expose to localhost not entire LAN
# - 1143:143/tcp # IMAP - receiving and syncing mails / sending & syncing)
restart: unless-stopped
volumes:
- protonmail:/root
volumes:
protonmail:
name: protonmail
Initialization must be done once
cd /opt/prod-protonmail-bridge-docker/ && docker compose run protonmail-bridge init
Welcome to Proton Mail Bridge interactive shell
___....___
^^ __..-:'':__:..:__:'':-..__
_.-:__:.-:'': : : :'':-.:__:-._
.':.-: : : : : : : : : :._:'.
_ :.': : : : : : : : : : : :'.: _
[ ]: : : : : : : : : : : : : :[ ]
[ ]: : : : : : : : : : : : : :[ ]
:::::::::[ ]:__:__:__:__:__:__:__:__:__:__:__:__:__:[ ]:::::::::::
!!!!!!!!![ ]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![ ]!!!!!!!!!!!
^^^^^^^^^[ ]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[ ]^^^^^^^^^^^
[ ] [ ]
[ ] [ ]
jgs [ ] [ ]
~~^_~^~/ \~^-~^~ _~^-~_^~-^~_^~~-^~_~^~-~_~-^~_^/ \~^ ~~_ ^
>>> login
Username: <YOUR_USER>
Password: <YOUR_PW>
Authenticating ...
Two factor code: 123456
Account archham was added successfully.
>>> A sync has begun for <YOUR_USER>.
Sync (<YOUR_USER>): 1.8% (Elapsed: 0.5s, ETA: 26.3s)
...
A sync has finished for <YOUR_USER>.
Run ìnfo to get IMAP/SMTP credentials for your application.
Configuration for <YOUR_MAIL>
IMAP Settings
Address: 127.0.0.1
IMAP port: 1143
Username: <YOUR_MAIL>
Password: generated_pw
Security: STARTTLS
SMTP Settings
Address: 127.0.0.1
SMTP port: 1025
Username: <YOUR_MAIL>
Password: generated_pw
Security: STARTTLS
Start the bridge
docker compose up -d
echo "Test body" | mailx \
-s "Test subject" \
-S smtp=smtp://127.0.0.1:1025 \
-S smtp-auth=login \
-S smtp-auth-user="bridge-username" \
-S smtp-auth-password="bridge-password" \
-r sender@example.com \
# recipient@example.com