Source: https://ndo.dev/posts/headless_protonbridge All credits go to the author
Proton Mail is a great web email service, but if you've landed here, you've probably run into their lack of support for SMTP. They offer a local bridge application which is designed to run in a desktop environment and enable you to use your Outlook, Thunderbird, etc. email client on that same local computer with your Proton Mail account. However, if you'd like to access your Proton Mail email via another email client on your mobile device or another computer where you can't run their bridge application - that is not supported. This was incredibly frustrating so I figured out how to compile their bridge application without the GUI dependencies in order to run it on any Linux server and expose SMTP / IMAP ports for you to consume from your email client of choice.
There are a few challenges here that we've got to overcome to enable using the proton-bridge project in this way:
- Application by default requires
| import sys | |
| import time | |
| import socket | |
| import psutil | |
| import httplib | |
| import webbrowser | |
| from time import sleep | |
| from subprocess import Popen, PIPE | |
| from subprocess import check_output |
If we take a step back, a new thirdPartyReference is required anytime you attempt to submit a POST request from Online Orders endpoints. This thirdPartyReference can be any string, such as a random UUID.
Let's take my current payload:
As we can see, I'm using eb9b8ffd-3aa6-4b6d-a3cd-8886048ecd23 as my thirdPartyReference. From there, I have two options:
- Wait for the webhook notification; which is the recommended workflow since it contains the order status (fail, success) and the outstanding amount (
"currentAmount"minus"paidAmount") and the"ikentooAccountIdentifier"(to be used with the apply payment endpoint when applicable):
| { | |
| "iKaccountId": 0, | |
| "iKaccountIdentifier": "A111584.1", | |
| "thirdPartyPaymentReference": "2cb120b2-5ce2-4543-b4be-e6021628a906", | |
| "endpointId": "webOO", | |
| "businessLocationId": 881782555672578, | |
| "taskTtlInMs": 60000, | |
| "staffId": null, | |
| "deviceId": null, | |
| "paymentMethod": "APM", |
| { | |
| "iKaccountId": 0, | |
| "iKaccountIdentifier": "A111584.1", | |
| "thirdPartyPaymentReference": "{{$randomUUID}}", | |
| "endpointId": "webOO", | |
| "businessLocationId": "{{businessLocationId}}", | |
| "taskTtlInMs": 60000, | |
| "staffId": null, | |
| "deviceId": null, | |
| "paymentMethod": "APM", |
| { | |
| "thirdPartyReference": "eb9b8ffd-3aa6-4b6d-a3cd-8886048ecd23", | |
| "businessLocationId": 881782555672578, | |
| "type": "ORDER", | |
| "status": "SUCCESS", | |
| "account": { | |
| "clientCount": 0, | |
| "uuid": "1b157547-59ae-4900-803c-43c58cc5aa55", | |
| "openDate": "2025-04-09T17:20:48.204+0000", | |
| "paidAmount": "23.00", |
| { | |
| "businessLocationId": 881782555672578, | |
| "thirdPartyReference": "eb9b8ffd-3aa6-4b6d-a3cd-8886048ecd23", | |
| "endpointId": "webOO", | |
| "customerInfo":{ | |
| "firstName": "J", | |
| "lastName": "S", | |
| "email": "no-reply@norereply.com", | |
| "contactNumberAsE164": "+16145555555", | |
| "notes": "Frequent flyer", |