transport : pcre wildcard in TLD ?

2012-06-14 Thread Frank Bonnet

Hello

I would like to reroute all yahoo domains to another SMTP
server of mine but the pcre wildcard in TLD filed I tried to
use does not work ... any pointer to PCRE examples welcome !

the rule in the transport map is the following

This does not work --  /\@yahoo\.*$/smtp:[another.smtp.server]

This works  fine --   yahoo.comsmtp:[another.smtp.server]

thank you


Re: transport : pcre wildcard in TLD ?

2012-06-14 Thread Viktor Dukhovni
On Thu, Jun 14, 2012 at 04:06:28PM +0200, Frank Bonnet wrote:

 This does not work --  /\@yahoo\.*$/smtp:[another.smtp.server]

It works, but it is not what you want. :-)

  $ echo lu...@yahoo.com | pcregrep -q '@yahoo\.*$'  echo yes || echo no
  no

On the other hand:

  $ echo lu...@yahoo.com | pcregrep -q '@yahoo\.'  echo yes || echo no
  yes

Always take a moment to read and understand your regular expressions.

-- 
Viktor.


Re: transport : pcre wildcard in TLD ?

2012-06-14 Thread James B. Byrne

On Thu, Jun 14, 2012 at 04:06:28PM +0200, Frank Bonnet wrote:

 This does not work --  /\@yahoo\.*$/smtp:[another.smtp.server]


Try /\@yahoo\..*$/

You are escaping the '.' and then matching zero or more periods.


-- 
***  E-Mail is NOT a SECURE channel  ***
James B. Byrnemailto:byrn...@harte-lyne.ca
Harte  Lyne Limited  http://www.harte-lyne.ca
9 Brockley Drive  vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada  L8E 3C3



Re: transport : pcre wildcard in TLD ?

2012-06-14 Thread Frank Bonnet

On 06/14/2012 04:42 PM, Viktor Dukhovni wrote:

On Thu, Jun 14, 2012 at 04:06:28PM +0200, Frank Bonnet wrote:


This does not work --   /\@yahoo\.*$/smtp:[another.smtp.server]

It works, but it is not what you want. :-)

   $ echo lu...@yahoo.com | pcregrep -q '@yahoo\.*$'  echo yes || echo no
   no

On the other hand:

   $ echo lu...@yahoo.com | pcregrep -q '@yahoo\.'  echo yes || echo no
   yes

Always take a moment to read and understand your regular expressions.


Yes ... thanks a lot.