On Thu, Feb 14, 2013 at 12:26:34PM -0600, Noel Jones wrote:
> On 2/14/2013 11:16 AM, Alex wrote:
> > 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

All hail JWZ! [1] I'd anchor this expression on the beginning, and 
escape the "+":

/^somename\+.*@example\.com$/ some...@gmail.com

> /^some...@gmail\.com$/  some...@gmail.com
> 
> IF /@example\.com$/
> /./ somelocaluser@localhost.localdomain
> ENDIF

I'll toss out another idea, of which JWZ would approve: a hash: map 
followed by a static: map:

main.cf :

mydestination = localhost.localdomain[, ...]
# unset virtual_alias_domains to avoid all domains being included
# therein by the default setting $virtual_alias_maps
virtual_alias_domains =
virtual_alias_maps = 
    hash:/path/to/virtual_alias_maps,
    static:somelocaluser@localhost.localdomain

/path/to/virtual_alias_maps :

somelocaluser@localhost.localdomain somelocaluser@localhost.localdomain
some...@gmail.com               some...@gmail.com


[1] http://en.wikiquote.org/wiki/Jamie_Zawinski#Attributed
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Reply via email to