This chunk of code seems to work for SpamCop and DSBL, but it dies on the
other ones I've tested (ORDB, NJABL, RelayWatcher). It might be due to the
request being made on port 80. However, just getting the SpamCop and DSBL
responses is good enough for me right now.
--
Michael Wolfe
[EMAIL PROTECTED]
_____
From: Josh [mailto:[EMAIL PROTECTED]
Sent: Monday, January 26, 2004 6:01 PM
To: CF-Talk
Subject: Re: Java for ColdFusion Developers
Thanks for the snippet! This'll come in handy.
--Josh
---
Exciteworks -- expert hosting for less!
http://exciteworks.com
specializing in reseller accounts
Michael Wolfe wrote:
> Hi All,
>
>
> If anyone is interested, here's how I finally did the RBL check:
>
> <cfset is_rbl = false>
> <cfset RBL = "bl.spamcop.net">
> <cfset original_ip = "66.131.40.12"><!--- known spammer --->
> <cfset new_ip = "">
>
>
> <!--- Reverse the IP Address to follow DNS spec --->
> <cfloop index="i" from="#ListLen(original_ip, ".")#" to="1" step="-1">
> <cfset new_ip = ListAppend(new_ip, ListGetAt(original_ip, i, "."), ".")>
> </cfloop>
>
>
> <cftry>
> <cfset ia = createobject("java", "java.net.InetAddress")>
> <cfset ia_response = ia.getByName(new_ip & "." & RBL)>
>
> <!--- 127.0.0.2 = Open Relay or Spammer --->
> <cfif ListLast(ia_response, "/") is "127.0.0.2">
> <cfset is_rbl = true>
> </cfif>
>
> <cfcatch>
> <!--- No response or bad response. --->
> </cfcatch>
> </cftry>
>
>
> <cfoutput>#is_rbl#</cfoutput>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

