[exim] Feature Needed - Main_domain

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Marc Perkel
日付:  
To: exim-users
古いトピック: Re: [exim] Feature Needed
題目: [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