Filter Ip Against Rbl/Rss/Dul And Orbs!

Spam Filter for Lotus Notes
Here is how to do a lookup against MAPS RBL (Realtime Blackhole List), RSS
(Relay Spam Stopper) and DUL (Dial-up List) from within Lotus Notes/Domino.
As a service to the rest of the spam-fighting community, I am making the code
available for everyone to use. Enjoy!

Here we go:
This code require you to run Windows NT (or Windows 95/98/2000) on the computer
where Notes/Domino is running.
First you need a DLL that is used to send ping. I found one called DSPing from
Donia Software (http://www.donia.com/). Just download and install this (free)
lightweight component onto the computer(s) the agent will run on. If you are
going to use a server-based spam-filter, you need to install it on the server.

Now for getting Notes to check if a certain IP is in any of the lists.
You simply do a DNS lookup, and if it returns 127.0.0.x (where x is different
depending on what list you are checking against), the IP is in the list. More
info can be found at http://www.mail-abuse.org/dul/usage.htm. So what you neet
to do is to ping the server and check if you get a response or not. If you do,
the server is listed, otherwise not.

You can download a small Notes database at
http://www.idgnews.net/spamfilter/rsstest.zip with a LotusScript agent that
check a user-supplied IP against the server. Run it and see what it does.
The code is very simple. In the (Declarations) section I have three constants,
the server names for the three lists, and a couple of variable declarations.

At the URL http://www.idgnews.net/spamfilter you can find more samples,
including a modified version of a personal blacklist I found at Notes.net. I
modified it to include lookups against several blacklists.
----(Declarations)----
Const DUL="dialups.mail-abuse.org"
Const RSS="relays.mail-abuse.org"
Const RBL="rbl.maps.vix.com"

Dim IP As String
Dim dot1 As Integer
Dim dot2 As Integer
Dim dot3 As Integer
Dim IP1 As String
Dim IP2 As String
Dim IP3 As String
Dim IP4 As String

----- Main Code -----

Sub Initialize
Set Ping = CreateObject( "DSPing.Ping" ) ' Create Object
IP=Inputbox("Test IP","Enter IP as dotted quad:")

' Read the four octets from the IP address
dot1=Instr(IP,".")
dot2=Instr(dot1+1,IP,".")
dot3=Instr(dot2+1,IP,".")

IP1=Left(IP,dot1-1)
IP2=Mid(IP,dot1+1,(dot2-dot1)-1)
IP3=Mid(IP,dot2+1,(dot3-dot2)-1)
IP4=Mid(IP,dot3+1,Len(IP)-dot3)

' Put them in reverse order and add e period inbetween and in the end
ReverseIP = IP4 & "." & IP3 & "." & IP2 & "." & IP1 & "."

' Check for RSS entry
Result = Ping.DoPing( ReverseIP & RSS ,1,250 )
If Result = 0 Then
Msgbox "Open Relay!"
Else
Msgbox "Not in RSS"
End If

' Check for RBL entry
Result = Ping.DoPing( ReverseIP & RBL ,1,250 )
If Result = 0 Then
Msgbox "Blacklisted in RBL!"
Else
Msgbox "Not in RBL"
End If

' Check for DUL entry
Result = Ping.DoPing( ReverseIP & DUL ,1,250 )
If Result = 0 Then
Msgbox "Dial-up in DUL!"
Else
Msgbox "Not in DUL"
End If
End Sub
This was first published in November 2000

Dig deeper on Domino Resources - Part 6

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close