On Wed, Aug 10, 2011 at 10:11:49AM +0200, Ansgar Wiechers wrote:
> On 2011-08-10 Jeroen Geilman wrote:
> > On 2011-08-10 09:20, Troy Piggins wrote:
<snip />
> > It is not a variable expansion. Use this instead:
> > 
> >     /(user1)@mydomain.com/  $1_s...@mydomain.com
> > 
> > Read http://www.postfix.org/pcre_table.5.html, section Text
> > Substitution for details.
> > 
> > Note that this offers zero advantage over an exact match.
> 
> Unless you're using wildcards/alternatives in the group, that is.
> 
>   /(user1|user2|user3)@mydomain.com/ $1_s...@mydomain.com
>   /(foobar-.+)@mydomain.com/ $1_s...@mydomain.com
> 
> I'd also suggest anchoring the expression on both sides, and escaping
> the dot in the domain name:
> 
>   /^(.+)@mydomain\.com$/ $1_s...@mydomain.com
> 
> Otherwise the expression might inadvertently match other addresses as
> well (like f...@mydomain1com.net). Yes, not very likely in this context,
> I know, but I prefer to keep regular expressions as exact as possible.
> It helps avoiding problems where you least expect them.

Thanks mate.  That helped a lot.  See my response to Jeroen's message where
I've implemented something that incorporates your great suggestion here too.
Thanks again.

Reply via email to