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/> [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]
All hail JWZ! [1] I'd anchor this expression on the beginning, and escape the "+": /^somename\+.*@example\.com$/ [email protected] > /^some...@gmail\.com$/ [email protected] > > IF /@example\.com$/ > /./ [email protected] > 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:[email protected] /path/to/virtual_alias_maps : [email protected] [email protected] [email protected] [email protected] [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:
