as the subject says I would like to forward the mails for certain users
to another host which has a SMTP server listening on port 25. I am using
postfix + amavis.
Thank you!
== virtual_alias_maps:
f...@example.com b...@example.org
== transport_maps:
example.org relay:[192.0.2.3]
the transport entry is not needed if example.org has an MX pointing to
the right host.
but the two servers are internal and have the same domain: test.org., so
I would need to forward the message from som...@test.org to
server2.test.org:25.
I could also do the following:
1. Setup the forwarding towards a sub-domain (f...@test.org
->b...@sub.test.org)
2. Define in the DNS the MX record for sub.test.org as server2.
But I was wondering if there is any other way?
Regards
Simply follow mouss' advice:
main.cf:
---------
transport_maps = /etc/postfix/transport
/etc/postfix/transport:
-----------------------
f...@test.org smtp:[1.2.3.4]
it works OK, but the messages pushed the TO filed states:
undisclosed-recipients:;
Do I have to set anything within the configuration files?
ahuh? virtual aliases do not change headers.
what server is running on the remote machine?
>
> Do I have to set anything within the configuration files?
>
use generic_maps to rewrite addresses back to their original form:
b...@example.org f...@example.com
Then use generic_maps as I said in my last post. this will rewrite back
the address so that your domino thing don't get mad.
in short, virtual_alias_maps will force the transport, and generic will
reset the address.
an alternative is to use transport_maps:
f...@example.com relay:[192.0.2.3]
this way, you don't need virtual aliases and generic. be warned that
transport_maps are "latency sensitive", so if you use *sql/ldap, you
must make sure the connection never fails.