diff options
-rw-r--r-- | mail/rblcheck/Makefile | 27 | ||||
-rw-r--r-- | mail/rblcheck/files/md5 | 1 | ||||
-rw-r--r-- | mail/rblcheck/patches/patch-aa | 140 | ||||
-rw-r--r-- | mail/rblcheck/patches/patch-ab | 8 | ||||
-rw-r--r-- | mail/rblcheck/pkg/COMMENT | 1 | ||||
-rw-r--r-- | mail/rblcheck/pkg/DESCR | 19 | ||||
-rw-r--r-- | mail/rblcheck/pkg/PLIST | 8 |
7 files changed, 204 insertions, 0 deletions
diff --git a/mail/rblcheck/Makefile b/mail/rblcheck/Makefile new file mode 100644 index 00000000000..f34e3fac941 --- /dev/null +++ b/mail/rblcheck/Makefile @@ -0,0 +1,27 @@ +# New ports collection makefile for: rblcheck +# Version required: 1.4 +# Date created: 28 January 1998 +# Whom: itojun@itojun.org +# +# $FreeBSD: ports/mail/rblcheck/Makefile,v 1.6 1999/08/25 06:50:47 obrien Exp $ +# + +DISTNAME= rblcheck-1.4 +CATEGORIES= mail +MASTER_SITES= http://www.xnet.com/%7Eemarshal/rblcheck/ + +MAINTAINER= itojun@itojun.org + +DOCS= BUGS CHANGES CREDITS INSTALL PLATFORMS TODO + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/rblcheck ${PREFIX}/bin +.if !defined(NOPORTDOCS) + dst=${PREFIX}/share/doc/rblcheck; \ + ${MKDIR} $$dst; \ + for i in ${DOCS}; do \ + ${INSTALL_DATA} ${WRKSRC}/docs/$$i $$dst; \ + done +.endif + +.include <bsd.port.mk> diff --git a/mail/rblcheck/files/md5 b/mail/rblcheck/files/md5 new file mode 100644 index 00000000000..8c992b299d3 --- /dev/null +++ b/mail/rblcheck/files/md5 @@ -0,0 +1 @@ +MD5 (rblcheck-1.4.tar.gz) = 6e415c34fd249333c057a4aedecd8877 diff --git a/mail/rblcheck/patches/patch-aa b/mail/rblcheck/patches/patch-aa new file mode 100644 index 00000000000..3cd6da820da --- /dev/null +++ b/mail/rblcheck/patches/patch-aa @@ -0,0 +1,140 @@ +--- rblcheck.c.orig Thu Aug 20 00:47:03 1998 ++++ rblcheck.c Sun May 2 12:39:29 1999 +@@ -79,6 +79,7 @@ + #include <sys/types.h> + #include <netinet/in.h> + #include <arpa/nameser.h> ++#include <arpa/inet.h> + #include <resolv.h> + #include <netdb.h> + +@@ -203,7 +204,7 @@ + * domain. If "txt" is non-zero, we perform a TXT record lookup. We + * return the text returned from a TXT match, or an empty string, on + * a successful match, or NULL on an unsuccessful match. */ +-char * rblcheck( int a, int b, int c, int d, char * rbldomain, int txt ) ++char * rblcheck( struct in_addr a, char * rbldomain, int txt ) + { + char * domain; + char * result = NULL; +@@ -214,12 +215,15 @@ + const u_char * cend; + const u_char * rend; + int len; ++ u_char *p; ++ int i, j; + + /* 16 characters max in a dotted-quad address, plus 1 for null */ + domain = ( char * )malloc( 17 + strlen( rbldomain ) ); + ++ p = (u_char *)&a; + /* Create a domain name, in reverse. */ +- sprintf( domain, "%d.%d.%d.%d.%s", d, c, b, a, rbldomain ); ++ sprintf( domain, "%d.%d.%d.%d.%s", p[3], p[2], p[1], p[0], rbldomain ); + + /* Make our DNS query. */ + res_init(); +@@ -261,8 +265,8 @@ + cp = answer + sizeof( HEADER ); + while( *cp != '\0' ) + { +- a = *cp++; +- while( a-- ) ++ i = *cp++; ++ while( i-- ) + cp++; + } + +@@ -277,8 +281,8 @@ + cp += ( NS_INT16SZ * 2 ) + NS_INT32SZ; + + /* Get the length and end of the buffer. */ +- NS_GET16( c, cp ); +- cend = cp + c; ++ NS_GET16( i, cp ); ++ cend = cp + i; + + /* Iterate over any multiple answers we might have. In + this context, it's unlikely, but anyway. */ +@@ -286,10 +290,10 @@ + rend = result + RESULT_SIZE - 1; + while( cp < cend && rp < rend ) + { +- a = *cp++; +- if( a != 0 ) +- for( b = a; b > 0 && cp < cend && rp < rend; +- b-- ) ++ i = *cp++; ++ if( i != 0 ) ++ for( j = i; j > 0 && cp < cend && rp < rend; ++ j-- ) + { + if( *cp == '\n' || *cp == '"' || + *cp == '\\' ) +@@ -308,23 +312,28 @@ + char **argv; + { + extern int optind; +- int a, b, c, d; ++ extern char *optarg; ++ struct hostent *ent; ++ struct in_addr a; + int quiet = 0; + int txt = 0; + int rblfiltered = 0; + char * response; + struct rbl * rblsites = NULL; + struct rbl * ptr; ++ int fail; ++ int c; + + /* Add more sites you want in the default list of RBL-alike + systems here. ### An easier way to change this is needed. ### */ + rblsites = togglesite( "rbl.maps.vix.com", rblsites ); +- rblsites = togglesite( "rbl.dorkslayers.com", rblsites ); ++ rblsites = togglesite( "relays.orbs.org", rblsites ); ++ rblsites = togglesite( "dul.maps.vix.com", rblsites ); + + progname = argv[ 0 ]; + +- while( ( a = getopt( argc, argv, "qtls:c?hv" ) ) != EOF ) +- switch( a ) ++ while( ( c = getopt( argc, argv, "qtls:c?hv" ) ) != EOF ) ++ switch( c ) + { + case 'q': + /* Quiet */ +@@ -372,10 +381,20 @@ + return -1; + } + +- if( sscanf( argv[ optind ], "%d.%d.%d.%d", &a, &b, &c, &d ) != 4 || +- a < 0 || a > 255 || b < 0 || b > 255 || c < 0 || c > 255 || +- d < 0 || d > 255 ) +- { ++ fail = 0; ++ if (ent = gethostbyname(argv[optind])) { ++ memcpy(&a, ent->h_addr_list[0], sizeof(a)); ++ if (ent->h_addr_list[1]) { ++ fprintf(stderr, "%s resolved to mutiple addresses: ", ++ argv[optind]); ++ } ++ fprintf(stderr, "checking %s\n", inet_ntoa(a)); ++ } else { ++ if (!inet_aton(argv[optind], &a)) ++ fail++; ++ } ++ ++ if (fail) { + fprintf( stderr, "%s: invalid IP address\n", progname ); + usage(); + return -1; +@@ -383,7 +402,7 @@ + + for( ptr = rblsites; ptr != NULL; ptr = ptr->next ) + { +- response = rblcheck( a, b, c, d, ptr->site, txt ); ++ response = rblcheck( a, ptr->site, txt ); + printf( "%s%s%s%s%s%s", !quiet && !response ? "not " : "", + !quiet ? "RBL filtered by " : "", !quiet ? ptr->site : "", + txt && response && strlen( response ) && !quiet ? ": " : "", diff --git a/mail/rblcheck/patches/patch-ab b/mail/rblcheck/patches/patch-ab new file mode 100644 index 00000000000..2d225953fbb --- /dev/null +++ b/mail/rblcheck/patches/patch-ab @@ -0,0 +1,8 @@ +--- Makefile.orig Thu Aug 20 01:47:03 1998 ++++ Makefile Wed Nov 4 15:56:48 1998 +@@ -41,4 +41,3 @@ + # below for an entry for your system. +-CC=gcc +-CFLAGS=-O -Wall ++CFLAGS+=-Wall + LDFLAGS=-s diff --git a/mail/rblcheck/pkg/COMMENT b/mail/rblcheck/pkg/COMMENT new file mode 100644 index 00000000000..3b868720c23 --- /dev/null +++ b/mail/rblcheck/pkg/COMMENT @@ -0,0 +1 @@ +Command-line interface to Paul Vixie's RBL filter diff --git a/mail/rblcheck/pkg/DESCR b/mail/rblcheck/pkg/DESCR new file mode 100644 index 00000000000..1572328a783 --- /dev/null +++ b/mail/rblcheck/pkg/DESCR @@ -0,0 +1,19 @@ +This program is a very basic interface to Paul Vixie's RBL filter. The +basic idea of the filter is that when someone is blacklisted for an email +abuse, a new domain name is resolved in the form of +"a.b.c.d.rbl.maps.vix.com", where "a.b.c.d" is actually the IP address +"d.c.b.a". For example, if the IP address 127.0.0.2 were listed as a +blacklisted address, "2.0.0.127.rbl.maps.vix.com" would have a DNS entry +(this is a real example; that address is in place as a verification +mechanism). + +For more information about the RBL blacklist, please take a look at +http://maps.vix.com/rbl/ . For more information about BIND, drop by +http://www.isc.org/bind.html . The official home page for rblcheck is at +http://www.xnet.com/~emarshal/rblcheck/ . + +Any ideas, bugfixes, or porting notes should be sent to me at +"emarshal@logic.net". Don't bug the MAPS people about this; they didn't +write it, and probably woudn't like getting a bunch of mail about it. + +WWW: http://www.xnet.com/~emarshal/rblcheck/ diff --git a/mail/rblcheck/pkg/PLIST b/mail/rblcheck/pkg/PLIST new file mode 100644 index 00000000000..f903fe992c2 --- /dev/null +++ b/mail/rblcheck/pkg/PLIST @@ -0,0 +1,8 @@ +bin/rblcheck +share/doc/rblcheck/BUGS +share/doc/rblcheck/CHANGES +share/doc/rblcheck/CREDITS +share/doc/rblcheck/INSTALL +share/doc/rblcheck/PLATFORMS +share/doc/rblcheck/TODO +@dirrm share/doc/rblcheck |