ProtonMail Setup
Configure Mailpilot to work with ProtonMail accounts using ProtonMail Bridge.
ProtonMail Bridge Required: ProtonMail uses end-to-end encryption, so direct IMAP access is not possible. You must install and run ProtonMail Bridge to use Mailpilot with ProtonMail.
Prerequisites
- ProtonMail account (Paid plan required - Bridge is not available for free accounts)
- ProtonMail Bridge installed and running
- Linux, macOS, or Windows computer to run Bridge
What is ProtonMail Bridge?
ProtonMail Bridge is a desktop application that:
- Runs locally on your computer
- Decrypts ProtonMail emails on your device
- Provides a local IMAP/SMTP server
- Maintains ProtonMail's end-to-end encryption
Privacy Note: Your emails are only decrypted locally. ProtonMail Bridge never sends unencrypted data over the network.
Step 1: Install ProtonMail Bridge
Download Bridge
- Go to ProtonMail Bridge Downloads
- Download the version for your operating system:
- Linux:
.deb(Debian/Ubuntu) or.rpm(Fedora/RHEL) - macOS:
.dmginstaller - Windows:
.exeinstaller
- Linux:
Install Bridge
Linux (Debian/Ubuntu):
sudo dpkg -i protonmail-bridge_*.deb
sudo apt-get install -f # Fix dependencies if neededLinux (Fedora/RHEL):
sudo rpm -i protonmail-bridge-*.rpmmacOS:
- Open the
.dmgfile - Drag ProtonMail Bridge to Applications folder
- Open from Applications
Windows:
- Run the
.exeinstaller - Follow installation wizard
- Launch from Start Menu
Step 2: Configure ProtonMail Bridge
Add Your ProtonMail Account
- Launch ProtonMail Bridge
- Click Add Account
- Enter your ProtonMail credentials
- Complete 2FA if enabled
- Wait for Bridge to sync your mailbox
Get IMAP Credentials
- In ProtonMail Bridge, click on your account
- Click Mailbox Configuration or IMAP/SMTP Settings
- Note the following information:
- IMAP Server:
127.0.0.1(localhost) - IMAP Port: Typically
1143(Bridge uses non-standard port) - Username: Your ProtonMail email address
- Password: Bridge-generated password (NOT your ProtonMail password)
- IMAP Server:
Important: The password shown in Bridge is different from your ProtonMail login password. Use the Bridge password for IMAP configuration.
Copy Bridge Password
- In Bridge settings, find the IMAP password
- Click Copy Password or manually copy it
- Save this password - you'll need it for Mailpilot configuration
Step 3: Configure Mailpilot
Add ProtonMail to your config.yaml:
accounts:
- name: protonmail
imap:
host: 127.0.0.1 # ProtonMail Bridge runs locally
port: 1143 # Bridge IMAP port (check Bridge settings)
username: ${PROTON_USER} # your.email@proton.me
password: ${PROTON_BRIDGE_PASSWORD} # Bridge password, NOT ProtonMail password
tls: true # Bridge uses TLS on localhost
tls_options:
rejectUnauthorized: false # Required for Bridge's self-signed cert
folders:
- name: INBOX
llm_provider: openai
prompt: |
Classify this email...TLS Configuration: ProtonMail Bridge uses a self-signed certificate on localhost. You must set rejectUnauthorized: false to accept this certificate.
Step 4: Set Environment Variables
Set your ProtonMail credentials:
export PROTON_USER="your.email@proton.me"
export PROTON_BRIDGE_PASSWORD="bridge-generated-password"Or use a .env file:
PROTON_USER=your.email@proton.me
PROTON_BRIDGE_PASSWORD=bridge-generated-passwordStep 5: Ensure Bridge is Running
Before starting Mailpilot:
- Launch ProtonMail Bridge if not already running
- Verify your account is connected (green checkmark)
- Check Bridge logs for any connection issues
Critical: ProtonMail Bridge must be running for Mailpilot to access your emails. If Bridge stops, IMAP connections will fail.
Step 6: Test Connection
pnpm startCheck the dashboard at http://localhost:8080 for connection status.
IMAP Server Settings
| Setting | Value |
|---|---|
| IMAP Server | 127.0.0.1 (localhost) |
| Port | 1143 (default, check Bridge settings) |
| Encryption | STARTTLS |
| Username | Your ProtonMail email address |
| Password | Bridge-generated password |
| Certificate | Self-signed (requires rejectUnauthorized: false) |
ProtonMail Folder Names
ProtonMail uses standard IMAP folder names:
| IMAP Folder Name | ProtonMail Folder |
|---|---|
INBOX | Inbox |
Sent | Sent |
Drafts | Drafts |
Trash | Trash |
Spam | Spam |
Archive | Archive |
All Mail | All Mail |
Multiple ProtonMail Accounts
ProtonMail Bridge supports multiple accounts:
- Add accounts in Bridge: Click Add Account for each
- Each account gets a unique port: Check Bridge settings for port numbers
- Configure in Mailpilot:
accounts:
- name: proton-personal
imap:
host: 127.0.0.1
port: 1143 # Port for first account
username: ${PROTON_PERSONAL_USER}
password: ${PROTON_PERSONAL_BRIDGE_PASSWORD}
tls: true
tls_options:
rejectUnauthorized: false
- name: proton-work
imap:
host: 127.0.0.1
port: 1144 # Different port for second account
username: ${PROTON_WORK_USER}
password: ${PROTON_WORK_BRIDGE_PASSWORD}
tls: true
tls_options:
rejectUnauthorized: falseTroubleshooting
"Connection refused" or "Connection timeout"
Cause: ProtonMail Bridge is not running or not fully started.
Solutions:
- Launch ProtonMail Bridge application
- Verify account shows green checkmark in Bridge
- Wait 30 seconds for Bridge to fully initialize
- Check Bridge logs for startup errors
"Username and password not accepted"
Causes:
- Using ProtonMail password instead of Bridge password
- Bridge password changed/regenerated
- Account not added to Bridge
Solutions:
- Open Bridge and copy the correct IMAP password
- Use Bridge password, NOT your ProtonMail login password
- Ensure account is added and connected in Bridge
- Regenerate Bridge password if needed (Bridge settings)
"Certificate verify failed" or SSL errors
Cause: ProtonMail Bridge uses a self-signed certificate on localhost.
Solution:
imap:
host: 127.0.0.1
port: 1143
tls: true
tls_options:
rejectUnauthorized: false # Required for Bridge"Wrong port" or "Connection works but can't login"
Cause: Using the wrong port for your account.
Solution:
- Open ProtonMail Bridge
- Click on your account
- Check Mailbox Configuration for the correct IMAP port
- Update
portin config.yaml - Port may change after Bridge updates
Bridge crashes or won't start
Solutions:
- Update Bridge: Download latest version from proton.me
- Check logs:
- Linux:
~/.cache/protonmail/bridge/logs/ - macOS:
~/Library/Logs/ProtonMail/Bridge/ - Windows:
%APPDATA%\ProtonMail\Bridge\logs\
- Linux:
- Restart Bridge: Quit completely and relaunch
- Reinstall Bridge if persistent issues
"Sync failed" or incomplete mailbox
Cause: Bridge is still syncing your mailbox.
Solution:
- Open Bridge and check sync status
- Wait for initial sync to complete (may take minutes to hours for large mailboxes)
- Don't start Mailpilot until sync is complete
- Check Bridge logs for sync errors
ProtonMail-Specific Considerations
ProtonMail Plans
ProtonMail Bridge is only available for paid plans:
- ✅ Mail Plus: Bridge included
- ✅ Proton Unlimited: Bridge included
- ✅ Business plans: Bridge included
- ❌ Free plan: Bridge NOT available
If you have a free ProtonMail account, you must upgrade to use Mailpilot.
Bridge System Requirements
ProtonMail Bridge requires:
- RAM: 200-500 MB
- Disk: ~100 MB for application + cache space for emails
- CPU: Minimal (background process)
- OS: Linux, macOS 10.12+, Windows 10+
Bridge Must Always Run
- Desktop requirement: Bridge runs on your computer, not a server
- Always running: Bridge must be running when Mailpilot processes emails
- Startup: Configure Bridge to start automatically with your system
- Server deployment: If running Mailpilot on a server, Bridge must run on that server
Running Bridge Headless (Server Mode)
For server deployments, run Bridge in CLI mode:
Linux:
protonmail-bridge --cli
# Then configure accounts via CLI interfaceSystemd Service (Linux):
sudo systemctl enable protonmail-bridge
sudo systemctl start protonmail-bridgeBridge and Firewall
Bridge runs on localhost (127.0.0.1):
- No external firewall rules needed
- No public internet exposure - Bridge only accepts local connections
- Safe to run on servers with strict firewall rules
Security Best Practices
- Keep Bridge updated - Check for updates regularly
- Use strong ProtonMail password with 2FA enabled
- Protect Bridge password - Store in environment variables only
- Never expose Bridge port to the internet (always use 127.0.0.1)
- Run Bridge on trusted computers only
- Monitor Bridge logs for unusual activity
- Rotate Bridge password periodically (regenerate in Bridge settings)
Advanced Configuration
Custom Bridge Port
If you need to change Bridge's IMAP port:
- Open Bridge settings
- Change IMAP port (e.g., to
1200) - Update Mailpilot config:
imap:
host: 127.0.0.1
port: 1200 # Match Bridge configurationConnection Pooling
imap:
host: 127.0.0.1
port: 1143
maxConnections: 3 # Bridge handles fewer connections well
keepalive: true
timeout: 30000Debugging Bridge Connection
Enable verbose logging to troubleshoot:
imap:
host: 127.0.0.1
port: 1143
debug: true # Enable IMAP debug logsCheck Mailpilot logs for detailed IMAP communication.
Testing Bridge Connection Manually
Verify Bridge is accessible:
telnet 127.0.0.1 1143You should see:
* OK ProtonMail Bridge IMAP4rev1 server readyTest TLS connection:
openssl s_client -connect 127.0.0.1:1143 -starttls imapAlternative: ProtonMail API (Future)
ProtonMail offers an API, but Mailpilot currently only supports IMAP via Bridge. Direct API support may be added in future releases.
Migrating to ProtonMail
If you're migrating from another provider:
- Set up Bridge first and ensure it works
- Import existing emails to ProtonMail (via web interface)
- Wait for Bridge sync to complete
- Configure Mailpilot with Bridge settings
- Test thoroughly before removing old provider
- Update classification rules if folder names differ