OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: aliasing all (everyone account)

From: Victor Duchovni (Victor.DuchovniMorganStanley.com)
Date: Sat Nov 04 2006 - 09:39:49 CST


On Sat, Nov 04, 2006 at 03:04:19PM +0100, Magnus B?ck wrote:

> > How do I set up a "To All Users" alias in postfix?
>
> There is no general solution. Postfix can only look up an address and
> determine whether it's okay or not, but it cannot enumerate all
> available addresses.
>
> That said, in some special cases you can solve the problem anyway.
> Postfix' lookup tables work like mathematical functions; given a
> particular lookup key they return a particular result. The nice thing
> about SQL-type lookup tables is that you can alter the function used to
> determine the result. So what you want is a function that returns all
> addresses if and only if the input address is everyoneexample.com .
> That's easy:
>
> SELECT address FROM aliases WHERE 'everyoneexample.com' = '%s'
>
> To suppress unnecessary queries for example.com etc the following can
> be used intead:
>
> SELECT address FROM aliases WHERE 'everyoneexample.com' = '%u%d'
>
> Use the `domain' parameter to further restrict what domains(s) are even
> subject to this lookup. This results in the following final setup
> (assuming Postfix 2.2 or later):
>
> hosts = ...
> dbname = ...
> user = ...
> password = ...
> query = SELECT address FROM aliases WHERE 'everyoneexample.com' = '%u%d'
> domain = example.com
>

Note: the above is for virtual(5) lookups with aliases(5) lookups the lookup
key is just the localpart of the address.

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majordomopostfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.