I'm trying to set up a Postfix server on Google Cloud, which blocks outgoing SMTP ports. My problem is that one email address (say [email protected]) needs to be an alias for an external email address ([email protected]); all emails sent to [email protected] need to be forwarded to [email protected]. I also have other email addresses that simply need to be delivered locally.

I am able to get Postfix to attempt to send all emails to [email protected] to [email protected] using virtual alias mappings, but because SMTP ports are blocked, the connection doesn't go through to example2.com's SMTP server. I want to get Postfix to send these emails through Mailjet on port 2525 so that the connection isn't blocked. Unfortunately, even when relayhost is set to in-v3.mailjet.com:2525, Postfix doesn't attempt to relay the emails and instead tries to send them directly.

I'm on Ubuntu 16.04.

  • It's relayhost, not relay_host. Commented Mar 11, 2018 at 22:35

1 Answer 1


When you do any relay directive, postfix by default will try to lookup the mx for that domain, so you have to tell postfix to use the a-record provided using brackets, see my relayhost directive below.

relayhost = [vps1.domain.com]:26

I'm using an off port to get around my ISP blocking smtp, so this forces postfix to go straight to that a-record and connect to send email.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .