Forward all emails from one domain to the same external domain (dont try to delivery internally)

Im trying to send emails from from the MIAB server, to another email server with the domain. The MIAB server is setup with multiple domains (, When I add the it doesn’t allow me to send any mail to the other email server (non MIAB server).

What Im looking for is a way to have all mail trying to be send to to automatically be sent to the other email server, it should never try to delivery internally. Does anyone know where this would be set at?

why though? just setup the MX to the other server…?

I still want to ability to receive and send mail to the other domain

But should be forced to send to the other server.

It would be an unsupported modification within postfix. Is there some specific reason you need this specific setup for email routing? MiaB always sends via the Local Mail Exchanger by default rather than a Remote Mail Exchanger.

You can use the postfix transport_maps parameter.
I did something similar recently: some users from my domain are using GSuite and some are using MiaB.

@lucasxteixeira Do you have an example of the config on how you did this?

Add this to the file /etc/postfix/

transport_maps = hash:/etc/postfix/transport_maps

Then create the file /etc/postfix/transport_maps containing the specific address (you can try the wildcard) and the server to send the emails:

After, run postmap and restart postfix:

postmap /etc/postfix/transport_maps
service postfix restart

1 Like

Please keep in mind that once you have made this type of modification you will be in unsupported territory … that said, you should be fine to do this however please note that the changes you make will most likely be overwritten by MiaB when it is upgraded in the future. So be prepared to make these modifications whenever you upgrade.

Thanks for the input, I will try the modifications recommended. Ill keep you posted if that works

I guess I have a similar scenario. I’m using MIAB to relay email sent by the ERP of one of our customers. Their own mailserver wouldn’t suffice.
Now, however when I’m mailing my customer MIAB is obviously trying to route it internally. Would I have to create a transport map as:

* smtp:theirmailserver

Or am I interpretting this wrong?

According to the documentation that is the way to go.
I never tested it myself though.

Did it work, or no?? Are there any issues with being overwritten by MiaB updates? If so, how often - daily, or version upgrades?