Alun wrote:

Marc Perkel <[EMAIL PROTECTED]> said, in message
[EMAIL PROTECTED]:

New revised code at bottom.

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

Where should news.com.com be split up?
com.com

What would you want for www.aber.ac.uk?
aber.ac.uk

How about www.alumni.aber.ac.uk?
aber.ac.uk

Or something.demon.co.uk?
demon.co.uk

How many can there be? It may take a table ot DB file to pull it off but I don't think that it would be much more than 100 entries.

Determining a suitable subdomain is a black art. I tried it a few
years ago for spam reporting (back when it was actually useful to
do such). Best I could do was something like (feel free to criticise!):

function maildomain(name)
{
        domain = ""
        mx = ""

        # Find longest "domain" part which has an MX lookup.
        while (name <> "")
        {
                mx = mx lookup for name
                if (mx <> "")
                {
                        domain = name
                        break;
                }
                strip first component from name
        }

        # Find shortest "domain" part which has the same MX lookup.
        while (name <> "")
        {
                mx2 = mx lookup for name
                if (mx2 == mx)
                {
                        domain = name
                }
                else
                {
                        break;
                }
                strip first component from name
        }
        return domain
}

Cheers,
Alun.



--
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