I apologize, as I am being confused. Contents of my virtual-regex now are: /somename+.*@mydomain\.com$/ [email protected] /^somename...@mydomain\.com$/ [email protected]
/@mydomain\.com$/ [email protected] /./ localuser When I ran postmap -q [email protected] regexp:virtual.regex. I actually get correct results. When I ran mailx [email protected] and vary name and domain all mails goes to localuser. Nothing is being forwarded out to [email protected] 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 <[email protected]> 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/> [email protected] > > /.*@.*/ 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$/ [email protected] > /^some...@gmail\.com$/ [email protected] > > IF /@example\.com$/ > /./ [email protected] > 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 >
