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>
>
> --
>
> Michael Wolfe
>
> [EMAIL PROTECTED]
>
>
>   _____  
>
> From: Barney Boisvert [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 26, 2004 1:33 PM
> To: CF-Talk
> Subject: RE: Java for ColdFusion Developers
>
> If you know your way around Java, then using it within CF is a snap.
> Basically, it's all exactly the same, except for constructors:
>
> Java:
> -----
> Socket s = new Socket("10.10.1.1", 80);
> ....
> s.close();
>
> ColdFusion (CFSCRIPT):
> ----------------------
> s = createObject("java", "java.net.Socket");
> s.init("10.10.1.1", 80);
> ....
> s.close();
>
> You may need to use javaCast() for some parameters.  For example, CF
> doesn't
> know what an int is (it only uses double), so you sometimes have to
> explicitly use javaCast for int parameters.
>
> You can also use CF tags (CFOBJECT, CFINVOKE) to do all that stuff, but I
> don't know the syntax, because I always use CFSCRIPT or CFSET to do
> everything.
>
> Cheers,
> barneyb
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to