ProtonMail Bridge on Sailfish

I’m currently running protonmail-bridge on my SFOS device and it is working with the SFOS email client for both sending and receiving mail. The approach I took to get it working is somewhat convoluted. Running natively should be possible with more effort on packaging the dependencies.

Approach:

  • Install Harbour Containers and dependencies (n.b. aarch64 packages available from @Levone1 in this thread)
  • Create an Arch linux container
  • Attach a terminal session and install the protonmail-bridge build dependencies
  • Build protonmail-bridge from source with the make build-nogui
  • Run protonmail-bridge --nogui, login then use the output of info to configure SFOS email account settings

I’ve yet to bother tidying it up by automatically starting the container/application on reboot but it is great using the native email client with a server that is PGP signing my mails. And while obviously a hacky fudge it is wonderful to be able to do this at all on a mobile device! :slight_smile:

5 Likes

Hi, I have a question: if you are running ProtonMail Bridge in a Container constantly, doesn’t his produce high battery drainage? How is battery life with this approach? Because I’m also looking into using this approach daily

Is there instructions for beginners to get this working in Sfos mail app?Or just use android app

For everyone interested in running ProtonMail Bridge on their Sailfish-smartphone, I’ve created this Wiki:

7 Likes

Dovecot and Postfix forever!

3 Likes

And don’t forget rspamd! And managesieve. Errr, and mysql. Ok, ok. I do use postfix admin, too. sigh.

1 Like

@NIS Did you install some additional packages not specified in the wiki? I tried to follow the steps, but I am getting an error when I try to run proton-bridge --cli. I used Arch (on Debian it seems there is no network) with arm64 architecture and after installing everything, I get
runtime error: slice bounds out of range, which leads to a bug reported here (Arm64 Build · Issue #323 · ProtonMail/proton-bridge · GitHub) possibly by you :slight_smile:

I don’t really remember what packages I installed, unfortunetely. I personally use RockyLinux aarch64 (I also had the network issue on Debian). Which branch of proton-bridge did you use?
I don’t remember why I switched from Arch to RockyLinux, maybe I also didn’t get it working there.
There also exist instructions for a NixOS container if remember correctly

1 Like

I used your guide for the Nix package manager so I guess that it is using the main branch by default and that’s when I got the above error message. I tried also to cross-compile proton-bridge using either the main or v3 branches but that failed with errors mentioned in the original bug report that I posted in the previous message.
I tried now RockyLinux, but the container does not start using Harbour.

That’s really strange. I might need to try to rebuild it myself (haven’t touched it since I got it working, “never change a running system” :wink: ).

I will try it myself when I find the time (it’s currently a bit stressful for me, so it will take some time until I can report back what I got)

I managed to compile proton-bridge (nogui) 3.11 on device if someone wants to give it a try:
https://files.catbox.moe/thbwhl.gz
No idea how to use it and it’s a bit scary build with python 3.11, meson, vapigen, mix of newer python3 packages from pkgx and some system ones, had to use a little bit older libsecret as latest one requires too new glib2-0, so yeah, no idea if it’ll work (or if it needs any extra libs, let me know), seems to run at least but requires some config options I’ve no clue about


Edit: latest one also builds fine (3.11.1) https://files.catbox.moe/l8pswk.gz
Edit: yeah, works with our old gpg and pass (download tar.gz from https://www.passwordstore.org/ and just make install, it’s just a bunch of shell scripts so no compilation needed, might need unix-tree to actually use)

1 Like

Late to this party but also a Proton* fan. Are we just running bridge to integrate with SFOS accounts/mail? or does Protonmail work as an APK app without bridge access?

Proton-bridge should allow you to use native jolla email client with proton, but it needs a paid account, so can’t really test (it should get your email like imap and pass it to the email client)

The Android-Version of ProtonMail works (except for notifications). We are using proton-bridge on Sailfish to use the native Jolla e-mail app, because (in my opinion) it looks and works better than the ProtonMail Android app and also (this is a big reason for me) because with the native Jolla e-mail app, you can get notifications which you can’t with the Android app

I tried it today on a new ArchLinux container, I got the same error. I will investigate this further

Wait, you managed to compile it directly on Sailfish (no container)?. How did you do that? Normally this doesn’t work due to missing libraries in SailfishOS

Cliff notes: install pkgx (Pkgx seems to work fine), this will allow you to install go, (integrate seems a bit borked on 4.6, was working much better at 4.5), touch .bashrc and integrate so go can be run from make (env +go), install make, cmake, autotools and few others and start making in the proton-bridge directory, use pkcon for what’s available, pkgx for rest (like vapigen), it is downloading packages in ~/.pkgx, at some point pkg-config it downloads will complain about glib2 (even after you get its -devel version with pkcon), replace the pkg-config binary with the one from /usr/bin and it will go through, it will download python 3.11(or .10?) use its pip (env +pip) to download the modules it needs, at this point libsecret-1 is a problem and you need to build it as well, the 20.5 version should be buildable from source, env +meson and you can ‘meson setup -C _build’, you’ll need xsltproc from pkgx and for me it wouldn’t work over http during the build, so when you reach the xsltproc issue download the xsl package from sourceforge and extract somewhere locally, in ./doc subfolder change in one of the files ‘http://sourceforge…’ to ‘file:///whereyouextractedthexslthingie’, eventually you’ll get the setup, then build, install requires root, so symlink /home/defaultuser/.pkgx to /root/.pkgx and run meson install as root (this will prevent pkgx redownloading everything), installed libsecret files end up in /usr/local… Move them to /usr/… (or add the …/local/ to PATH I guess?), this should allow you to finish building proton-bridge
Edit: I think from libs only libsecret-1 was missing and building that with meson is a bit of a pain, but doable

1 Like

Wow, thanks for this explanation! I will have to try that!

I would love to see Proton Mail Bridge published on Chum. :slightly_smiling_face:

4 Likes

Unfortunately, I think this is (currently) not possible