💾 Archived View for oh.mg › ~kevin › en › projects › delta-chat-proton-mail captured on 2024-05-12 at 15:12:42. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-14)

-=-=-=-=-=-=-

Delta Chat 💔 Proton Mail

Posted on 2023-11-03

Delta Chat's provider page makes it very clear that Proton Mail isn't exactly built to work very well.

One of the things it doesn't mention is that even if you have Proton Mail Bridge you still can't get it to work. The simple reason for this is that Proton Bridge does something stupid, much like Gmail in the respect it will be a bit weird with any folders you create on Proton. Namely that they go in to a subfolder called Folders, which DeltaChat isn't really looking for.

However, because I clearly hate myself, I decided to throw this all to the wind and embark on the journey I'd soon regret.

The Trials and Tribulations

I once tried to use Delta Chat locally with Proton Bridge which is how I discovered two major problems - 1) The whole folders thing and B) Using Bridge to send email strips headers, including the very important Chat-Version: 1.0 one that Delta Chat uses to identify chats.

It was at that point a year or so I did the right thing and gave up.

Recently though I got an email, as you see being a Visionary account holder has its perks, one of them being SMTP Submission. Having used that for a few other little things, I noticed during my mail delivery tests that Proton will pass email headers using this method.

This point is quite critical for this set up, so if you don't have access to it then I recommend either abandoning hope or getting used to Postfix's sender_dependent_relayhost_maps and Duocircle, assuming you're using your own domain here. Otherwise maybe a shonky Amazon SES setup might do the trick but fuck that and fuck Bezos.

Proton Bridge Does Not Like External Callers

With the SMTP issues basically figured out, we have a second issue. Running Bridge to basically create a security hole that Proton very much tell you is the reason why they don't offer IMAP access, is not a great idea. Quite rightfully the Bridge application will only listen on localhost and any kind of weird fuckery to get around that it'll have none of.

Another quirk of Proton Bridge is that it will synchronise every email to the local machine whether or not you're wanting to do that. Because of security risks and this disk swallowing slow-ass synchronisation, I recommend that you use a naked Proton Account created specifically for this that you wouldn't mind being hacked or the NSA sifting through because you decided to do this on Oracle's Free Tier infrastructure and / or did the thing that Proton warned you not to do.

The anticipated response from Proton Support if this setup is compromised.

Let me make this super clear, I'm telling you this is an awful idea, Proton tells you it is an awful idea, but you live your own life and you do what you want to do boo.

That said, it is a fun idea and if you want to learn how not to do a thing or at least give it a shot, you could do a better job at it than I did.

Making Proton My Bitch 😈

We now have the brief history, the risk assessment, and the blockers defined above. Because we be 1337 h4x0r5 we're going to find away around this. These are the tools you'll need :

Proton Bridge for Linux

Dovecot IMAP server

mbsync to bridge between the two

A machine to run this shit on

screen to run this shit in the background

Some basic knowledge of crontab to run this shit regularly

What we're doing is this 👉 Proton will do all the receiving email part in cyberspace, we will use Proton Bridge to connect to Proton, and mbsync will pull all that sweet email down locally for Dovecot to serve to our client, in this case Delta Chat (or another email client for other reasons).

At the point we get mbsync to pull a copy from Proton and save it to disk, we have effectively broken their mailbox encryption. This is a vital point to remember, especially if you've got a real world reason to be using Proton in the first place.

How do 🤔

Well that is a very good question, there are a lot of quirks here that I had to deal with the absolutely hardest way possible. Setting up mbsync is annoying and poorly documented, best guessing the folder layout of Proton isn't ideal either.

I'm going to write up the documentation, which will take a lot more time than this page as I'm still making changes as I go. I'll publish my notes in this folder : https://notes.oh.mg/share/8970180/31btmd2qs55ryb95rc9c/l7HulVKJgt3GkRbH

Made with disdain à Paris • Barcelona • Oslo 💔

Mentions Légales