I apologize, as I am being confused. Contents of my virtual-regex now are: /somename+.*@mydomain\.com$/ somen...@yahoo.com /^somename...@mydomain\.com$/ somen...@yahoo.com
/@mydomain\.com$/ somen...@gmail.com /./ localuser When I ran postmap -q somen...@somedomain.com regexp:virtual.regex. I actually get correct results. When I ran mailx somen...@somedoman.com and vary name and domain all mails goes to localuser. Nothing is being forwarded out to somename@yahoo.comeven though regex patter should match. What do I need to change? Thank you for your help. On Thu, Feb 14, 2013 at 10:26 AM, Noel Jones <njo...@megan.vbhcs.org> wrote: > On 2/14/2013 11:16 AM, Alex wrote: > > Hello, > > > > I am having an issue with setting up virtual-regex email > > redirection. It appears that my wild card redirection is overriding > > an entry with less specific criteria. > > > > Here is what I have in my /etc/postfix/virtual-regex > > > > /somename+.*@somedomain.com/ <http://somedomain.com/> some...@gmail.com > > /.*@.*/ somelocaluser > > > > > > Line one is being ignored > > Line 1 is not ignored, the problem is that wildcards are evil and > should be avoided. > > Virtual alias lookups are recursive, so you'll need a 1-1 mapping to > stop the recursion. Also be careful with your expressions so you > don't get unintended matches. Something like: > > > /somename+.*@example\.com$/ some...@gmail.com > /^some...@gmail\.com$/ some...@gmail.com > > IF /@example\.com$/ > /./ somelocaluser@localhost.localdomain > ENDIF > > > If you really intend your wildcard to capture the whole internet > address space and redirect it to somelocaluser, you can remove the > IF and ENDIF statements. Such a setup is common in a testing lab, > but never in the real world. > > > -- Noel Jones >