I just wrote up my own small guide on how to od this, having come from a total postfix newbie hopefully this helps someone in my position who is faced with this rather long winded task.
Before I actually put the code in, is this sometrhing that is planned for IspCP? I've used cpanel and exim to do this before and it is SO much easier...you just remove a domain from local_domains and put it in remote_domains, this took me so long to do
Also, every time I want an e-mail forwarded I'm going to have to add it to /etc/postfix/relay_recipient_maps.hash which is a huge pain!
Quote:Set the domain to have external mx by changing /var/cache/bind/domain.name.db and duplicating changes to /etc/ispcpbind/working/domain.name.db
reload bind (/etc/init.d/bind9 reload)
You need to remove the domain and any aliases first, I'd remove any mailboxes and aliases in ispcp itself, then remove the entries from the domains file manually, but you can do ti either way, here are the files to change:
/etc/postfix/ispcp/alaises (duplicate changes to /etc/ispcp/postfix/working/aliases)
/etc/postfix/ispcp/domains (duplicate changes to /etc/ispcp/postfix/working/domains)
/etc/postfix/ispcp/mailboxes (duplicate changes to /etc/ispcp/postfix/working/mailboxes)
Now to need to recreate the postfix db's we changed, using these commands:
postmap /etc/postfix/ispcp/alaises
postmap /etc/postfix/ispcp/domains
postmap /etc/postfix/ispcp/mailboxes
needed to add this to main.cf, only once:
relay_domains = hash:/etc/postfix/relay_domains.hash
relay_recipient_maps = hash:/etc/postfix/relay_recipient_maps.hash
I had to create /etc/postfix/transport_map.hash and add this content:
domain.tld relay:[othermailserver.com]
I had to create /etc/postfix/relay_domains.hash and add this content:
domain.tld OK
I had to create /etc/postfix/relay_recipient_maps.hash and add this content:
mailbox@domain.tld OK
Then run:
postmap /etc/postfix/transport_map.hash
postmap /etc/postfix/relay_domains.hash
postmap /etc/postfix/relay_recipient_maps.hash
postfix reload
check your email: mail -s "Test Email" source@domain.tld
Check your config now: less /var/log/mail.log
Well, damn! I didnt have to go thruogh all this after all, I saw
http://www.isp-control.net/forum/thread-4961.html which seemed much shorter, and that is all thats needed.
I removed all my changes and put -1 on the domain to not handle email and removed the domain from /etc/postfix/domains and did postmap /etc/postfix/domains and postfix reload and all worked fine.
Still though, disabling mail should remove the line from domains