It runs a minimal SMTP server, accepts one email, saves it as received/*.eml, prints the envelope/ header summary, then exits.
Run it directly on SMTP port 25:
sudo ./mx.py --port 25 --name mx.yourdomain.com
Or run on a high local port if your tunnel maps public TCP/25 to it:
./mx.py --port 2525 --name mx.yourdomain.com
Important MX/ngrok detail: an MX record cannot include a port. Remote mail servers will connect to port 25 on the MX hostname. So an ngrok address like something.tcp.ngrok.io:12345 will not work for normal MX delivery unless the public side actually accepts TCP port 25.