On 10/21/2011 11:56 AM, R - elists wrote:
> as you know, some emailing companies have multiple domains for mail serving
>
> mailengine1.com
> mailengine2.com
> mailengine3.com
> .
> .
> .
> mailengineN.com
>
> among other domains...
>
> what is the proper way to write a single rule to deal with N series
> combinations?
>
> header __LOCAL_MAILENGINE1  ALL =~ /mailengine1\.com/i
> header __LOCAL_MAILENGINE2  ALL =~ /mailengine2\.com/i
>
> .
> .
> .
>
> header __LOCAL_MAILENGINE1  ALL =~ /mailengineN\.com/i
>
> to handle all cases in one?

There are a couple of ways to do it.

If you know that the numbers are 1-9, you could do this:

header  __LOCAL_MAILENGINE ALL =~ /mailengine[1-9]\.com/i

(this is matching a single character.  You could NOT do [1-12])

If you just want to allow for a number, you could do this:

header  __LOCAL_MAILENGINE ALL =~ /mailengine\d+\.com/i

This one matches a number of any length.

For more information, do a search for Perl regular expressions.

-- 
Bowie

Reply via email to