On 2011-03-30 Corey Quinn wrote:
> On Mar 30, 2011, at 12:46 PM, Noel Jones wrote:
>> # main.cf
>> smtp_generic_maps =
>>  regexp:/etc/postfix/generic.regexp
>> 
>> # generic.regexp
>> IF /+.*@example\.com$/
>> /^(.*)+/  $1...@example.com
>> ENDIF
> 
> Threw this verbatim into my generic.regexp:
> 
> [root@mx1 postfix]# postmap -q "user+t...@example.com" regexp:generic.regexp 
> postmap: warning: regexp map generic.regexp, line 1: Invalid preceding 
> regular expression
> postmap: warning: regexp map generic.regexp, line 4: ignoring ENDIF without 
> matching IF
> user+t...@example.com@example.com
> 
> On the plus side, I figured out how to do something interesting by
> reading through the regexp documentation-- this solved another
> challenge I'd been facing.

'+' has a special meaning in regular expressions (one or more times the
preceding term), so you need to escape it to match a literal '+':

if /\+.*@example\.com$/
/^(.*)\+/ $1...@example.com
endif

Regards
Ansgar Wiechers
-- 
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

Reply via email to