OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: address rewriting with regexp

From: Noel Jones (njonesmegan.vbhcs.org)
Date: Wed Feb 10 2010 - 11:08:55 CST


Please don't top-post.

On 2/10/2010 11:01 AM, Andy Smith wrote:
> ok i have put that in canonical and when the rewrite occurs i get a
> log that looks like this
>
> Feb 10 16:52:45 dal1-svc-12 postfix/smtp[13697]: 9E4FA26FB8:
> to=<1234567.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1.prodea_uae1smscountry.net>,
> orig_to=<1234567smscountry.net>,
> relay=roslife.net.outbound15.mxlogic.net[208.65.144.92]:25, delay=2.2,
> delays=0.56/0.01/0.09/1.5, dsn=2.0.0, status=sent (250 [OUTBOUND]
> b54e27b4.0.89022.00-001.196464.p02c11o141.mxlogic.net QueueSafe)
>
>
> my rewrite looks like
>
> /^(.*)smscountry\.net$/ $1.prodea_uae1smscountry.net

Looks as if you decided to use .* in place of the suggested [0-9]+

>
> am i missing something as prodea_uae1 is being added multiple times.

Yes, address rewrites are recursive. Maybe you should use my
version.

   -- Noel Jones

>
>
>
> On Wed, Feb 10, 2010 at 10:43 AM, Noel Jones<njonesmegan.vbhcs.org> wrote:
>>
>> On 2/10/2010 1:38 AM, Andy Smith wrote:
>>>
>>> hello,
>>>
>>> maybe someone here can help. I am trying to rewrite a certain set of To
>>> address with regex when they are sent outbound from my mail server.
>>>
>>> I am trying to do the following:
>>>
>>> Can you rewrite this to 123456789 smscountry.net
>>> <http://smscountry.net> to 123456789.mydomainsmscountry.net
>>> <mailto:12145524065.prodea_uae1smscountry.net>.
>>>
>>> The number string is very dynamic and will be many different combinations.
>>>
>>>
>>> is there a way to do this with regex. I have tried /smscountry\.net/
>>> .mydomainsmscountry.net<mailto:mydomainsmscountry.net> but this drops
>>> the number sequence.
>>>
>>> Any help would be appreciated.
>>>
>>> Andy
>>
>> When posting from gmail, please click the [Plain Text] button.
>>
>> To add the ".mydomain" tag to any number:
>> /^([0-9]+)smscountry\.net$/ $1.mydomainsmscountry.net
>>
>> If you need to limit the rewriting to a specific set of numbers, probably best to list each number individually.
>>
>> -- Noel Jones