Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forward mail for certain user(s) to another SMTP server

14 views
Skip to first unread message

Radu Popa

unread,
Aug 22, 2007, 9:10:48 AM8/22/07
to
Hello,

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!

mouss

unread,
Aug 22, 2007, 9:29:50 AM8/22/07
to


== 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.

Radu Popa

unread,
Aug 22, 2007, 9:45:16 AM8/22/07
to
Thanks,

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

Jan P. Kessler

unread,
Aug 22, 2007, 10:04:43 AM8/22/07
to
Radu Popa schrieb:

> Thanks,
>
> 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?

Simply follow mouss' advice:

main.cf:
---------
transport_maps = /etc/postfix/transport


/etc/postfix/transport:
-----------------------
f...@test.org smtp:[1.2.3.4]

Radu Popa

unread,
Aug 22, 2007, 10:39:58 AM8/22/07
to
Hi,

it works OK, but the messages pushed the TO filed states:
undisclosed-recipients:;

Do I have to set anything within the configuration files?

mouss

unread,
Aug 22, 2007, 11:11:44 AM8/22/07
to
Radu Popa wrote:
> Hi,
>
> it works OK, but the messages pushed the TO filed states:
> undisclosed-recipients:;

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


Radu Popa

unread,
Aug 22, 2007, 12:48:15 PM8/22/07
to

The other server is a Domino 7.

mouss

unread,
Aug 22, 2007, 4:58:25 PM8/22/07
to
Radu Popa wrote:
>
> The other server is a Domino 7.


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.

0 new messages