[exim] Feature Needed - Main_domain

Top Page
Delete this message
Reply to this message
Author: Marc Perkel
Date:  
To: exim-users
Old-Topics: Re: [exim] Feature Needed
Subject: [exim] Feature Needed - Main_domain
New revised code at bottom.

Marc Perkel wrote:

>
>
>> On 17/09/05, Marc Perkel <marc@???> wrote:
>>
>>> Like to have a string function that extraced the main domain part out of
>>> an email address that removes subdomains. And it would be smart enought
>>> to deal with 3 part main domains such as:
>>>
>>
> OK - here's some more details about the "Main Domain" concept.
>
> Some domains are 2 part like:
>
> yahoo.com
> exim.org
>
> some are 3 part:
>
> yahoo.co.uk
> yahoo.com.au
>
> The idea is to figure out what the rules are to see if you need to
> grab 2 or three parts. The following code is a crude attempt to
> demonstrate this concept but if it's doable it would be better if it
> were hard coded in Exim.
>


If the part second to the end is co com net org then it's 3 part.

warn    message = X-Maindomain: \
${if match{XX${extract{-2}{.}{${domain:$h_From:}}}XX}{XX(co|com|net|org)XX}\
{${extract{-3}{.}{${domain:$h_From:}}}.${extract{-2}{.}{${domain:$h_From:}}}.${extract{-1}{.}{${domain:$h_From:}}}}\
{${extract{-2}{.}{${domain:$h_From:}}}.${extract{-1}{.}{${domain:$h_From:}}}}\
}



--
Marc Perkel - marc@???

Spam Filter: http://www.junkemailfilter.com
    My Blog: http://marc.perkel.com