2009/5/22 Ken <[email protected]>:
> Perhaps regexp continues processing
> postfix/virtual after the first match and also substitutes based on the
> final catch-all rule?

Correct, virtual_alias_maps are recursive (out to 1000 iterations by
default, I think).
http://www.postfix.org/postconf.5.html#virtual_alias_recursion_limit

> .:      postfix/virtual
> /^foo@/         [email protected]
> /^([...@]+)@/     [email protected]

> Well...I seem to have partially answered my own question. If I remove
> the catch-all regexp, the address is rewritten correctly. Still, why
> does postmap -q present a different result?

Yep. Because the regexp is very "loose", it'll get picked up by the
second line. I believe postfix stops processing an alias if it gets an
identity mapping, ie. the output is the same as the input. Not that it
matters for the catchall, as it wouldn't matter if you applied that
mapping 1000 times. So, you should be able to fix this with:

/^[email protected]$/   [email protected]

`postmap -q` gives you a different result because it answers your
question exactly. Postfix keeps asking the question until it decides
it should stop. If you want to demonstrate this I expect you'll see:

$ postmap -q [email protected] regexp:/etc/postfix/virtual
[email protected]

$ postmap -q [email protected] regexp:/etc/postfix/virtual
[email protected]

Reply via email to