VM Config
VM Specifications:
- CPU: 1vCPU (2 cores)
- RAM: 2 GB
- HD: 100 GB
Change the hostname:
Update the IP:
Protonmail User Setup
Create the user "protonmail"
Change the user password
Add the user to the wheel group for sudo rights.
Install
Login as the newly created protonmail user.
Install Pre-Req
Postfix should also be set to start on boot:
Postfix will need to be restarted before the SASL framework will be detected
Setup the firewall
There are some websites that referance "Desktop-Bridge." That is an older version. The new version is called "protonmail-bridge."
Download the bits from: https://proton.me/mail/download
Download the pubkey from: https://protonmail.com/download/bridge_pubkey.gpg
Import the ring
Run the following command to validate the install
Expected output from the above command
Install the bloody thing already
Key Setup
Do not use sudo for any of the commands having to do with generateing a key OR running/configuring protonmail. These commands must be used under the account that Protonmail was installed under.
Use the following command to create a key in a single line with all of the appropriate switches. ProtonMail Bridge will not work without a password protected GPG key. This is by design as it is a serious securityrisk, so come to your own opinion on this. Research the implications. Some documenation stated that generateing a key would take a long time. It did not.
While still logged in as the protonmail user, use the following command to show a list of all previously generated keys that have been created on the system.
Use the key name (in quotes) from the quick-gen-key command to add it to the systems key chain (pass).
Add Protonmail Bridge Login
Use the following command to start the bridge client.
The application will load and show a cute text image. Type the following command to be prompted for your ProtonMail username and password.
Login to protonmail
To get the login info that postfix will use to log into bridge, type the following command. Take note of the SMTP password. The postfix config will require this later.
Do NOT log out. That would clear the login information for bridge and it would not run in the background. Instead, use the following command.
Postfix Config - main.cf
Backup default config
Edit the config
Verify the changes
Append the following to the Postfix main config.
Postfix Config - force from/reply address
ProtonMail expects the From address to match that of the email account. It will not accept mail otherwise.
Commands to secure
Add Protonmail Bridge Login
Create the login file
Append the following line to the login file Do not use the email account password. To find the password, start the protonmail-bridge --cli app and type: info. Use the SMTP user/pass.
Commands to secure
Since postfix will be connecting to the bridge with STARTSSL, it will need to validate the bridge certificate. Symlinking the self-signed certificate will be necessary.
Create protonmail-bridge as a service
multi-user.target normally defines a system state where all network services are started up and the system will accept logins, but a local GUI is not started. This is the typical default system state for server systems, which might be rack-mounted headless systems in a remote server room.
This file does not need to be executable.
Create the following file and insert the contents below.
Enable the service
Testing
Send a test message
View Message Queue
To test from another device over telnet
Client Setup
Configure SMTP email clients to send mail to:
References
Offical Proton docs
- https://protonmail.com/support/knowledge-base/bridge-cli-guide/
- https://protonmail.com/support/knowledge-base/install-bridge-linux-rpm-file/
Various sources
- https://gist.github.com/ibaiul/60d603845df931483a05d96c5b433981
- https://pychao.com/2020/06/10/update-on-using-protonmail-bridge-on-headless-wordpress-linux-servers/
- https://theselfhostingblog.com/posts/archiving-protonmail-emails-on-a-headless-ubuntu-instance/
- https://www.angelospanag.me/2021/3/1/integrating-protonmail-my-personal-site-made-django/
- https://www.romanbezlepkin.com/articles/protonmail-bridge-smtp-relay
Info on nohup and disown
Info on creating a serivce
- https://www.redhat.com/sysadmin/replacing-rclocal-systemd
- https://developer.toradex.com/knowledge-base/how-to-autorun-application-at-the-start-up-in-linux
- https://blog.knoldus.com/creating-custom-daemons-in-linux/
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-managing_services_with_systemd
- https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6