Virtual SMTP servers with a Postfix Relay

Did you try:

relay_domains =,

and also something you need to know.
you dont need to set the mx record as in the same domain your want it to work for.
let say you need and to be relayed using
you are making an A record in the name let say
and in the mx records of the other domains you set the
as your mx record.

and second thing you must do is to permit relaying using in the

relay_domains =,

transport_maps = hash:/etc/postfix/transport

in this file add the records for each domain smtp server
/etc/postfix/transport smtp:[] smtp:[]

and run the command
postmap hash:/etc/postfix/transport

this way the server is bound to do a dns lookup only for the and not to the mx record of the domain.

[ubuntu] Virtual SMTP servers with a Postfix Relay – Ubuntu Forums.