Set custom outbound smtp port

I am running on a google compute vm with outbound connections blocked on ports 25, 465, and 587. I cannot whitelist these ports as google says “these outbound SMTP ports are blocked because of the large amount of abuse these ports are susceptible to.”

Because of this, setting up my outbound email accounts in erpnext results in a hang on save. I can whitelist other custom ports on the vm, so how can I tell frappe/erpnext to use my custom port for outbound smtp instead of the default? Thanks.

You can set custom ports in your “Email Account”

Check “Enable Outgoing” and you can add your settings.