View | Details | Raw Unified | Return to bug 37575
Collapse All | Expand All

(-)rblcheck/Makefile (-19 / +15 lines)
Lines 6-40 Link Here
6
#
6
#
7
7
8
PORTNAME=	rblcheck
8
PORTNAME=	rblcheck
9
PORTVERSION=	1.4
9
PORTVERSION=	1.5
10
PORTREVISION=	2
11
CATEGORIES=	mail
10
CATEGORIES=	mail
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
12
MASTER_SITE_SUBDIR=	${PORTNAME}
14
13
15
MAINTAINER=	leeym@leeym.com
14
MAINTAINER=	leeym@leeym.com
16
15
17
post-configure:
16
USE_GMAKE=	yes
18
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.rbl
17
GNU_CONFIGURE=	yes
19
.if !defined(BATCH)
20
	@${ECHO} "NOTE: You can pre-compile your own sites into rblcheck by"
21
	@${ECHO} "      creating ${WRKDIRPREFIX}${.CURDIR}/local.sites.  The"
22
	@${ECHO} "      format of this file is:"
23
	@${ECHO}
24
	@${ECHO} "             SITE(\"my.rbl.site\")"
25
	@${ECHO} "             SITE(\"another.rbl.site\")"
26
.endif
27
18
28
pre-build:
19
post-build:
29
.if exists(${WRKDIRPREFIX}${.CURDIR}/local.sites)
20
	@${PERL} -pi -e 's,/usr/local,${PREFIX},g' ${WRKSRC}/rbl
30
	${CAT} ${WRKDIRPREFIX}${.CURDIR}/local.sites >> ${WRKSRC}/rblsites.h
31
.endif
32
21
33
do-install:
22
do-install:
34
	${INSTALL_PROGRAM} ${WRKSRC}/rblcheck ${PREFIX}/bin
23
	@${INSTALL_SCRIPT} ${WRKSRC}/rbl ${PREFIX}/bin
24
	@${INSTALL_PROGRAM} ${WRKSRC}/rblcheck ${PREFIX}/bin
25
	@${INSTALL_DATA} ${FILESDIR}/rblcheckrc.sample ${PREFIX}/etc
35
.if !defined(NOPORTDOCS)
26
.if !defined(NOPORTDOCS)
36
	@${MKDIR} ${PREFIX}/share/doc/rblcheck
27
	@${MKDIR} ${DOCSDIR}
37
	${INSTALL_DATA} ${WRKSRC}/docs/* ${PREFIX}/share/doc/rblcheck
28
.for file in AUTHORS COPYING ChangeLog INSTALL NEWS README
29
	@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
30
.endfor
38
.endif
31
.endif
32
33
post-install:
34
	@${CAT} ${PKGMESSAGE}
39
35
40
.include <bsd.port.mk>
36
.include <bsd.port.mk>
(-)rblcheck/distinfo (-1 / +1 lines)
Line 1 Link Here
1
MD5 (rblcheck-1.4.tar.gz) = 6e415c34fd249333c057a4aedecd8877
1
MD5 (rblcheck-1.5.tar.gz) = fb7ee9adc0e09eee9dda195f9b9e7ca4
(-)rblcheck/files/patch-aa (-148 lines)
Lines 1-148 Link Here
1
--- rblcheck.c.orig	Thu Aug 20 00:47:03 1998
2
+++ rblcheck.c	Mon Jul 16 16:40:55 2001
3
@@ -79,8 +79,10 @@
4
 #include <sys/types.h>
5
 #include <netinet/in.h>
6
 #include <arpa/nameser.h>
7
+#include <arpa/inet.h>
8
 #include <resolv.h>
9
 #include <netdb.h>
10
+#include <unistd.h>
11
 
12
 #define VERSION "1.4"
13
 
14
@@ -203,7 +205,7 @@
15
  * domain. If "txt" is non-zero, we perform a TXT record lookup. We
16
  * return the text returned from a TXT match, or an empty string, on
17
  * a successful match, or NULL on an unsuccessful match. */
18
-char * rblcheck( int a, int b, int c, int d, char * rbldomain, int txt )
19
+char * rblcheck( struct in_addr a, char * rbldomain, int txt )
20
 {
21
 	char * domain;
22
 	char * result = NULL;
23
@@ -214,12 +216,15 @@
24
 	const u_char * cend;
25
 	const u_char * rend;
26
 	int len;
27
+	u_char *p;
28
+	int i, j;
29
 
30
 	/* 16 characters max in a dotted-quad address, plus 1 for null */
31
 	domain = ( char * )malloc( 17 + strlen( rbldomain ) );
32
 
33
+	p = (u_char *)&a;
34
 	/* Create a domain name, in reverse. */
35
-	sprintf( domain, "%d.%d.%d.%d.%s", d, c, b, a, rbldomain );
36
+	sprintf( domain, "%d.%d.%d.%d.%s", p[3], p[2], p[1], p[0], rbldomain );
37
 
38
 	/* Make our DNS query. */
39
 	res_init();
40
@@ -261,8 +266,8 @@
41
 	cp = answer + sizeof( HEADER );
42
 	while( *cp != '\0' )
43
 	{
44
-		a = *cp++;
45
-		while( a-- )
46
+		i = *cp++;
47
+		while( i-- )
48
 			cp++;
49
 	}
50
 
51
@@ -277,8 +282,8 @@
52
 	cp += ( NS_INT16SZ * 2 ) + NS_INT32SZ;
53
 
54
 	/* Get the length and end of the buffer. */
55
-	NS_GET16( c, cp );
56
-	cend = cp + c;
57
+	NS_GET16( i, cp );
58
+	cend = cp + i;
59
 
60
 	/* Iterate over any multiple answers we might have. In
61
 	   this context, it's unlikely, but anyway. */
62
@@ -286,10 +291,10 @@
63
 	rend = result + RESULT_SIZE - 1;
64
 	while( cp < cend && rp < rend )
65
 	{
66
-		a = *cp++;
67
-		if( a != 0 )
68
-			for( b = a; b > 0 && cp < cend && rp < rend;
69
-			  b-- )
70
+		i = *cp++;
71
+		if( i != 0 )
72
+			for( j = i; j > 0 && cp < cend && rp < rend;
73
+			  j-- )
74
 			{
75
 				if( *cp == '\n' || *cp == '"' ||
76
 				  *cp == '\\' )
77
@@ -308,23 +313,27 @@
78
 	char **argv;
79
 {
80
 	extern int optind;
81
-	int a, b, c, d;
82
+	extern char *optarg;
83
+	struct hostent *ent;
84
+	struct in_addr a;
85
 	int quiet = 0;
86
 	int txt = 0;
87
 	int rblfiltered = 0;
88
 	char * response;
89
 	struct rbl * rblsites = NULL;
90
 	struct rbl * ptr;
91
+	int fail;
92
+	int c;
93
 
94
-	/* Add more sites you want in the default list of RBL-alike
95
-	   systems here. ### An easier way to change this is needed. ### */
96
-	rblsites = togglesite( "rbl.maps.vix.com", rblsites );
97
-	rblsites = togglesite( "rbl.dorkslayers.com", rblsites );
98
+/* Hack to handle the easy addition of sites at compile time */
99
+#define SITE(x) rblsites = togglesite( (x), rblsites);
100
+#include "rblsites.h"
101
+#undef SITE
102
 
103
 	progname = argv[ 0 ];
104
 
105
-	while( ( a = getopt( argc, argv, "qtls:c?hv" ) ) != EOF )
106
-		switch( a )
107
+	while( ( c = getopt( argc, argv, "qtls:c?hv" ) ) != EOF )
108
+		switch( c )
109
 		{
110
 			case 'q':
111
 				/* Quiet */
112
@@ -372,10 +381,23 @@
113
 		return -1;
114
 	}
115
 
116
-	if( sscanf( argv[ optind ], "%d.%d.%d.%d", &a, &b, &c, &d ) != 4 ||
117
-	  a < 0 || a > 255 || b < 0 || b > 255 || c < 0 || c > 255 ||
118
-	  d < 0 || d > 255 )
119
-	{
120
+	fail = 0;
121
+	if ((ent = gethostbyname(argv[optind])) != NULL) {
122
+		memcpy(&a, ent->h_addr_list[0], sizeof(a));
123
+		if (ent->h_addr_list[1]) {
124
+			if (!quiet)
125
+				fprintf(stderr,
126
+				    "%s resolved to mutiple addresses: ",
127
+				    argv[optind]);
128
+		}
129
+		if (!quiet)
130
+			fprintf(stderr, "checking %s\n", inet_ntoa(a));
131
+	} else {
132
+		if (!inet_aton(argv[optind], &a))
133
+			fail++;
134
+	}
135
+
136
+	if (fail) {
137
 		fprintf( stderr, "%s: invalid IP address\n", progname );
138
 		usage();	
139
 		return -1;
140
@@ -383,7 +405,7 @@
141
 
142
 	for( ptr = rblsites; ptr != NULL; ptr = ptr->next )
143
 	{
144
-		response = rblcheck( a, b, c, d, ptr->site, txt );
145
+		response = rblcheck( a, ptr->site, txt );
146
 		printf( "%s%s%s%s%s%s", !quiet && !response ? "not " : "",
147
 		  !quiet ? "RBL filtered by " : "", !quiet ? ptr->site : "",
148
 		  txt && response && strlen( response ) && !quiet ? ": " : "",
(-)rblcheck/files/patch-ab (-8 lines)
Lines 1-8 Link Here
1
--- Makefile.orig	Thu Aug 20 01:47:03 1998
2
+++ Makefile	Wed Nov  4 15:56:48 1998
3
@@ -41,4 +41,3 @@
4
 # below for an entry for your system.
5
-CC=gcc
6
-CFLAGS=-O -Wall
7
+CFLAGS+=-Wall
8
 LDFLAGS=-s
(-)rblcheck/files/rblcheckrc.sample (+9 lines)
Line 0 Link Here
1
-s dev.null.dk
2
-s blackholes.mail-abuse.org
3
-s relays.mail-abuse.org
4
-s dialups.mail-abuse.org
5
-s 3y.spam.mrs.kithrup.com
6
-s or.orbl.org
7
-s orbz.gst-group.co.uk
8
-s manual.orbz.gst-group.co.uk
9
-s relays.ordb.org
(-)rblcheck/pkg-message (+3 lines)
Line 0 Link Here
1
2
Please copy rblcheckrc.sample to rblcheckrc and modify it as you wish.
3
(-)rblcheck/pkg-plist (-5 / +7 lines)
Lines 1-8 Link Here
1
bin/rbl
1
bin/rblcheck
2
bin/rblcheck
2
%%PORTDOCS%%share/doc/rblcheck/BUGS
3
etc/rblcheckrc.sample
3
%%PORTDOCS%%share/doc/rblcheck/CHANGES
4
%%PORTDOCS%%share/doc/rblcheck/AUTHORS
4
%%PORTDOCS%%share/doc/rblcheck/CREDITS
5
%%PORTDOCS%%share/doc/rblcheck/COPYING
6
%%PORTDOCS%%share/doc/rblcheck/ChangeLog
5
%%PORTDOCS%%share/doc/rblcheck/INSTALL
7
%%PORTDOCS%%share/doc/rblcheck/INSTALL
6
%%PORTDOCS%%share/doc/rblcheck/PLATFORMS
8
%%PORTDOCS%%share/doc/rblcheck/NEWS
7
%%PORTDOCS%%share/doc/rblcheck/TODO
9
%%PORTDOCS%%share/doc/rblcheck/README
8
%%PORTDOCS%%@dirrm share/doc/rblcheck
10
%%PORTDOCS%%@dirrm share/doc/rblcheck
(-)rblcheck/scripts/configure.rbl (-102 lines)
Lines 1-102 Link Here
1
#!/bin/sh
2
# $FreeBSD: ports/mail/rblcheck/scripts/configure.rbl,v 1.4 2001/08/24 16:08:10 dwcjr Exp $
3
4
if [ -f ${WRKSRC}/rblsites.h ]; then
5
	exit
6
fi
7
8
tempfile=`mktemp -t checklist`
9
10
SET_MAPS_RBL="OFF"
11
SET_MAPS_DUL="OFF"
12
SET_MAPS_RSS="OFF"
13
SET_ORBL="OFF"
14
SET_ORBZ="OFF"
15
SET_ORBZ_MAN="OFF"
16
SET_ORDB="OFF"
17
18
TODAY=`date "+%Y%m%d"`
19
20
if [ "${BATCH}" ]; then
21
	# MAPS is changing to a subscription service on 20010731
22
	if [ ${TODAY} -lt 20010801 ]; then
23
		OPTIONS="\"MAPS_RBL\" \"MAPS_DUL\" \"MAPS_RSS\""
24
	else
25
		OPTIONS="\"ORBZ\""
26
	fi
27
	if [ "x${OPTIONS}" != "x" ]; then
28
		set ${OPTIONS}
29
	fi
30
else
31
	# MAPS is changing to a subscription service on 20010731
32
	if [ ${TODAY} -lt 20010801 ]; then
33
		SET_MAPS_RBL="ON"
34
		SET_MAPS_DUL="ON"
35
		SET_MAPS_RSS="ON"
36
	else
37
		SET_ORBZ="ON"
38
	fi
39
40
	/usr/bin/dialog --title "RBL Sites" --clear \
41
		--checklist "\n\
42
Please select desired options:" -1 -1 16 \
43
MAPS_RBL	"MAPS Blackhole list   www.mail-abuse.org" ${SET_MAPS_RBL} \
44
MAPS_DUL	"MAPS DialUp List      www.mail-abuse.org" ${SET_MAPS_DUL} \
45
MAPS_RSS	"MAPS Open Relay list  www.mail-abuse.org" ${SET_MAPS_RSS} \
46
ORBL		"ORBL Open Relay list  www.orbl.org" ${SET_ORBL} \
47
ORBZ		"ORBZ Open Relay list  orbz.gst-group.co.uk" ${SET_ORBZ} \
48
ORBZ_MAN	"ORBZ Manual list      orbz.gst-group.co.uk" ${SET_ORBZ_MAN} \
49
ORDB		"ORDB Open Relay list  www.ordb.org" ${SET_ORDB} \
50
2> $tempfile
51
52
	retval=$?
53
54
	if [ -s $tempfile ]; then
55
		set `cat $tempfile`
56
	fi
57
	rm -f $tempfile
58
59
	case $retval in
60
		0)	if [ -z "$*" ]; then
61
				echo "Nothing selected"
62
			fi
63
			;;
64
		1)	echo "Cancel pressed."
65
			exit 1
66
			;;
67
	esac
68
fi
69
70
exec > ${WRKSRC}/rblsites.h
71
72
while [ "$1" ]; do
73
	case $1 in
74
		\"MAPS_RBL\")
75
			echo "SITE(\"blackholes.mail-abuse.org\")"
76
			;;
77
		\"MAPS_DUL\")
78
			echo "SITE(\"dialups.mail-abuse.org\")"
79
			;;
80
		\"MAPS_RSS\")
81
			echo "SITE(\"relays.mail-abuse.org\")"
82
			;;
83
		\"ORBL\")
84
			echo "SITE(\"or.orbl.org\")"
85
			;;
86
		\"ORBZ\")
87
			echo "SITE(\"orbz.gst-group.co.uk\")"
88
			;;
89
		\"ORBZ_MAN\")
90
			echo "SITE(\"manual.orbz.gst-group.co.uk\")"
91
			;;
92
		\"ORDB\")
93
			echo "SITE(\"relays.ordb.org\")"
94
			;;
95
		*)
96
			echo "Invalid option(s): $*" > /dev/stderr
97
			rm -f ${WRKSRC}/rblsites.h
98
			exit 1
99
			;;
100
	esac
101
	shift
102
done

Return to bug 37575