Postfix not working as expected in Google Cloud Official VM image

Postfix in google cloud is badly configured. It uses outgoing port 25 but google blocks this port for outgoing connections. A ideally configuration (not just for Google Cloud but for any server) in my opinion would be listening: 25, 465, 587, send: 465 or 587 instead of 25 not just in Google Cloud but everywhere because from what I’ve read port 25 is often taken in account as a factor to flag mails as spam.
I tried a lot of settings but nothing seems to work until this point, probably because of specific configuration cyberpanel adds to default ones in postfix and my lack of expertise. I don’t want to use a separate service to send emails.
It would be awesome to have this configuration out of the box or at least a proper documentation because I seen this is a common problem.

Welcome @ijf Happy you are here

Due to the risk of abuse, connections to destination TCP Port 25 are blocked when the destination is external to your VPC network. This includes using SMTP relay with Google Workspace. However, some projects do not have this restriction and do allow external SMTP egress on port 25.

For GCP you need to send an email to Google cloud support and specify the reasons why you need them to release port 25 on your vm. You can claim that you need it for sending transactional emails. They will ask for some proof.

Also one needs to set up a verified payment account, paid that they have more trust. But the release really depends on your reasons for using it and how you explain it to support.

Thanks to @pryce for this good information

1 Like