Question : Postfix virtual alias table incorrectly matching regexp rules

Hi,
I'm setting up a postfix server with virtual alias table to redirect my emails based on regexp rules.

I set this line in /etc/postfix/main.cf :
virtual_alias_maps = regexp:/etc/postfix/virtual

My /etc/postfix/virtual is in the code snippet below.

My goal is to have a list of domains, where :
- all emails sent to tech@thesedomains are forwarded to [email protected]
- all emails sent to anythingelse@thesedomains (catch-all) are forwarded to [email protected].

When I test this file with postmap, everything is ok :
# postmap -q [email protected] regexp:/etc/postfix/virtual
[email protected]
# postmap -q [email protected] regexp:/etc/postfix/virtual
[email protected]

However, when I apply the config, and send a test email to [email protected], the mail is sent to [email protected] instead.
The log file /var/log/maillog show this :
 XXXXXXXXXXXX: to=>, orig_to=, relay=...

If I remove the last line of the /etc/postfix/virtual, the mails to tech@domains are sent to their correct destination.

According to the manual :
"Patterns are applied in the order as specified in the table,  until  a  pattern  is  found that matches the search string".
So the first matching pattern, and not the second one, should be used (as postmap correctly does).

Any idea why ?

Thanks.
Ben
Code Snippet:
1:
2:
3:
4:
5:
/^domain1\.com$/ DOMAIN
/^domain2\.com$/ DOMAIN
 
/^tech@/      [email protected]
/@/           [email protected]

Answer : Postfix virtual alias table incorrectly matching regexp rules

Ok fixed it, needed a 1-1 mapping to stop the recursion :
1:
2:
3:
4:
5:
6:
7:
/^domain1\.com$/ DOMAIN
/^domain2\.com$/ DOMAIN
 
/^tech@/                    [email protected]
/^email1@otherdomain\.com$/ [email protected]
/@/                         [email protected]
/^email2@otherdomain\.com$/ [email protected]
Random Solutions  
 
programming4us programming4us