New revised code at bottom.

Marc Perkel wrote:



On 17/09/05, Marc Perkel <[EMAIL PROTECTED]> 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 - [EMAIL PROTECTED]

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


--
## List details at http://www.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to