I have my website and email hosted with a shared host. Unfortunately their servers are using CPanel, so they are limited in their spam protection options.
I also have a VPS that I use for testing and hosting several other bits and pieces (Why don't I use the VPS for websites? I don't want to have to worry about backups!) – I can potentially use this as my MX for my domains, with the shared host as transport maps – I used to run my own dedi and so have Puppet modules ready to go for a mailserver.
The VPS host requires me to use a Postfix mail relay to make sure I'm not spamming from their IP ranges.
Can I use Postfix's transport_maps
and relay_host
directives together to make my MX forward all mail for my domains to the shared host, but via the VPS host's relay?
A further example of my desired outcome:
example.com
has an single MX record (for sanity) ofvps.example.com
vps.example.com
receives incoming mail, then consultstransport_maps
and forwards it to the eventual destinationsharedhost.example.com
, using the the relayrelayvps.example.net
as the "next hop"
Best Answer
Personally I wouldn't want to do this. But you could use forwarding addresses on your VPS like this:
Then configure your shared host as MX for subdomain.example.org. Then use
transport_maps
in
/etc/postfix/transport
putuse
postmap
to update the lookup-table in transport.db withpostmap /etc/postfix/transport
.If you need credentials for the relay you can configure them in
/etc/postfix/saslpass
and use
postmap /etc/postfix/saslpass
to create/update the lookup-table.On the shared host add the subdomains and forward the mail back to the original addresses. I'm not sure though if the forwarding wouldn't break spam-protection on the VPS.