OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: alias overriding transport?
From: Wietse Venema (wietseporcupine.org)
Date: Wed Feb 23 2000 - 06:34:39 CST


Rasmus Sten:
> Hi,
>
> I have a Postfix server acting relay (both inbound and outbout) for an
> Exchange system. As of now, I only have a transport entry defined for the
> domain saying that it should be transported to the Exchange server.
>
> The problem is, that now we would like to have an overriding alias
> (executing a program) for the same domain that is being relayed to
> Exchange. That is:
>
> if recipient is "foobar.se", forward to "|/a/b/c", else
> if recipient domain is "bar.se", relay to exchange.internalnetwork.
>
> At the moment, I don't have a lab system to make a test configuration on,
> and consequently can't afford making a configuration change I'm not really
> certain would work.
>
> Anyone has any suggestions for this setup?

There is no elegant solution for this, because command execution
is a privileged operation, and most of Postfix does not have the
the appropriate privileges to execute external commands.

Use a virtual map entry to redirect the address to a local alias.

    /etc/postfix/virtual:
        foobar.se foo-bar.selocalhost

    /etc/aliases:
        foo-bar.se: "|/a/b/c"

Aliases keys end in ":", virtual keys don't

        Wietse