Skip to content

Commit

Permalink
Merge branch 'integration' into mergetrunk
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
  • Loading branch information
Rafiot committed Feb 27, 2015
2 parents ceb2d31 + 8088782 commit 473c1b7
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# python
.idea
*.pyc
# distutils
dist/
MANIFEST
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
v0.2.2, 2015-02-09 -- Extend hostname with suffix dot for valid host checking
v0.2.1, 2015-01-06 -- Remove additional ahbl lists that are no longer in service
v0.2.0, 2014-12-27 -- Remove tor.ahbl.org because no longer in service
v0.1.0, 2014-08-28 -- Initial release with pip package
23 changes: 23 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2014, James Polera
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include *.txt
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Python3

Author
==
James Polera <[email protected]>
- James Polera <[email protected]>
- Thomas Merkel <[email protected]>

Usage
==
Expand Down
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

29 changes: 29 additions & 0 deletions bin/rblcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python
# vim:expandtab shiftwidth=4 softtabstop=4 tabstop=8

from rblwatch.rblwatch import RBLSearch
import socket

try:
hostname = socket.gethostname() + '.'
for response in socket.getaddrinfo(hostname, None, 0, 1):
ip = response[4][0]
searcher = RBLSearch(ip)
listed = searcher.listed
for key in listed:
if key == 'SEARCH_HOST':
continue
if not listed[key].get('ERROR'):
if listed[key]['LISTED']:
print("Results for %s: %s" % (key, listed[key]['LISTED']))
print(" + Host information: %s" % \
(listed[key]['HOST']))
if 'TEXT' in listed[key].keys():
print(" + Additional information: %s" % \
(listed[key]['TEXT']))
else:
pass
except:
print("Hostname %s can't be resolved" % hostname)
ip = ""

36 changes: 36 additions & 0 deletions bin/rblwatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python
# vim:expandtab shiftwidth=4 softtabstop=4 tabstop=8

from rblwatch.rblwatch import RBLSearch
from IPy import IP
import socket
import sys

try:
if len(sys.argv) > 1:
print("Looking up: %s (please wait)" % sys.argv[1])
param = sys.argv[1]
ips = set()

try:
# Is IP
ips.add(IP(param))
except ValueError:
# Is maybe an hostname
try:
for response in socket.getaddrinfo(param, None, 0, 1):
ips.add(response[4][0])
except socket.error:
print("IP %s can't be resolved" % param)

# Output all information to stdout
for ip in ips:
searcher = RBLSearch(ip)
searcher.print_results()
else:
print("""Usage summary:
rblwatch <ip address to lookup> """)
except KeyboardInterrupt:
pass

Empty file added rblwatch/__init__.py
Empty file.
File renamed without changes.
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
18 changes: 18 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from distutils.core import setup
setup(
name = 'rblwatch',
packages = ['rblwatch'],
scripts = ['bin/rblcheck', 'bin/rblwatch'],
version = '0.2.2',
description = 'RBL lookups with Python',
author = 'James Polera',
author_email = '[email protected]',
maintainer = 'Thomas Merkel',
maintainer_email = '[email protected]',
url = 'https://github.com/drscream/rblwatch',
keywords = ['rbl', 'blacklist', 'mail'],
install_requires = [
'IPy == 0.81',
'dnspython == 1.11.1',
],
)

0 comments on commit 473c1b7

Please sign in to comment.