procmail
[Top] [All Lists]

Re: Get domain and tld ?

2009-01-26 08:26:12
On Mon, Jan 26, 2009 at 09:27:23AM +0000, Xavier Maillard wrote:

Dallman Ross <dman <at> nomotek.com> writes:

Now it works as advertised even under the previous bug-inducing 
condition:

It won't work for FQDN like lolica.lolica.org though. 
Any way to workaround this ?

Your modified code will return lolica.org for the TLD.

Well, you gave me a scare, but this seems not to be true.
In other words, my last published code works for me on your
suggested domain.  See the final example below.

   1:18pm [~] 525[0]> procmail -m rc vsnag.spamless.us vsnag.xx.us foo.$HOST 
mars.example.co.uk lolica.lolica.org < /dev/null
  FQDN is >vsnag.spamless.us<
  DOMPART is >spamless<
  TLD is >us<
  ---
  FQDN is >vsnag.xx.us<
  DOMPART is >xx<
  TLD is >us<
  ---
  FQDN is >foo.panix5.panix.com<
  DOMPART is >panix<
  TLD is >com<
  ---
  FQDN is >mars.example.co.uk<
  DOMPART is >example<
  TLD is >co.uk<
  ---
  FQDN is >lolica.lolica.org<
  DOMPART is >lolica<
  TLD is >org<
  ---


Perhaps you did not fully copy and paste the relevant parts of
the file I showed?

I have put the core part of the file here for now:
http://spamless.us/procmail/rcfiles/domainparse.rc

You can download it.  It also works as an INCLUDERC.
I removed the test-harness recursion.  But you can still
test it on the command line as follows:

 $ procmail -m FQDN=lolica.lolica.org DEFAULT=/dev/null domainparse.rc < 
/dev/null
 FQDN is >lolica.lolica.org<
 DOMPART is >lolica<
 TLD is >org<

That was just done directly from where the file sits on my web server,
which also is a UNIX server.

Dallman
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>