-
We need to create a self-signed certificate for connecting to Apple Mail:
1.1 Create a self-signed certificate with SAN
san.cnfby running:openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes -config san.cnf1.2 Mark it as trusted by the system:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain cert.pem -
Run
npm installto install the dependencies ofcrypto-bridge.mjs -
Install all required modules for Python. Better in a separate environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install cryptography requests
- Run as administrator (because we need system ports)
sudo python3 mail_bridge.py - Add a new account to Apple Mail: Mail -> Add account -> Add Other Account... -> sign in -> Fails with unable to verify account name or password & shows more config fields -> Set Incoming Mail Server and Outgoing Mail Server to
localhostSign in -> should login in sucessfully