2009/5/22 Ken <kbing...@booksurge.com>: > 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@/ b...@somewhere-else.tld > /^([...@]+)@/ $...@myotherdomain.com > 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: /^...@somewhere-else.tld$/ b...@somewhere-else.tld `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 f...@mydomain.com regexp:/etc/postfix/virtual b...@somewhere-else.tld $ postmap -q b...@somewhere-else.tld regexp:/etc/postfix/virtual b...@myotherdomain.com