changeset 148:9330b8d6a56b

add documentation fixes, allow env_from target of inherit
author carl
date Tue, 30 Jan 2007 16:27:49 -0800
parents 812c80305f26
children 9581f6e62574
files AUTHORS ChangeLog NEWS configure.in package src/Makefile.am src/context.cpp src/dnsbl.cpp tld.conf xml/dnsbl.in
diffstat 10 files changed, 76 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Mon Dec 04 21:49:09 2006 -0800
+++ b/AUTHORS	Tue Jan 30 16:27:49 2007 -0800
@@ -6,3 +6,4 @@
     Nigel Horne <njh@bandsman.co.uk>
     Stephen Johnson <stephen.johnson@arkansas.gov>
     Jeff Evans <jeffe@tricab.com>
+    G.W. Haywood <ged@jubileegroup.co.uk>
--- a/ChangeLog	Mon Dec 04 21:49:09 2006 -0800
+++ b/ChangeLog	Tue Jan 30 16:27:49 2007 -0800
@@ -1,5 +1,9 @@
     $Id$
 
+5.27 2007-01-30
+    Allow 'inherit' as an env_from target. Documentation cleanup
+    from G.W. Haywood.
+
 5.26 2006-12-04
     Fix bug in content filtering introduced in 5.23 that prevented
     seeing any host names in the body.
--- a/NEWS	Mon Dec 04 21:49:09 2006 -0800
+++ b/NEWS	Tue Jan 30 16:27:49 2007 -0800
@@ -1,5 +1,6 @@
     $Id$
 
+5.27 2007-01-30 Allow 'inherit' as an env_from target
 5.26 2006-12-04 Fix bug at 5.23 that prevented seeing host names in the mail bodies
 5.25 2006-10-15 Dump the effective dnsbl list with the -c switch
 5.24 2006-10-15 Allow child and parent context to specify the same fully qualified env_to address
--- a/configure.in	Mon Dec 04 21:49:09 2006 -0800
+++ b/configure.in	Tue Jan 30 16:27:49 2007 -0800
@@ -1,20 +1,45 @@
-AC_INIT(configure.in)
 
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(dnsbl,5.26)
+AC_PREREQ(2.59)
+AC_INIT(dnsbl,5.27,carl@five-ten-sg.com)
+AC_CONFIG_SRCDIR([config.h.in])
+AC_CONFIG_HEADER([config.h])
+
+AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
+
+# Checks for programs.
 AC_PATH_PROGS(BASH, bash)
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
 
-AC_LANG_CPLUSPLUS
-AC_PROG_CXX
-AC_PROG_LIBTOOL
+# Checks for header files.
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h unistd.h])
 
-AC_OUTPUT(                  \
-    Makefile                \
-    dnsbl.spec              \
-    html/Makefile           \
-    info/Makefile           \
-    man/Makefile            \
-    src/Makefile            \
-    xml/Makefile            \
-    xml/dnsbl               \
-    )
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_GETPGRP
+AC_HEADER_STDC
+AC_FUNC_STAT
+AC_CHECK_FUNCS([gethostbyname gethostname memmove memset socket strchr strdup strncasecmp strrchr strstr strtol])
+
+AC_CONFIG_FILES([Makefile
+                 dnsbl.spec
+                 html/Makefile
+                 info/Makefile
+                 man/Makefile
+                 src/Makefile
+                 xml/Makefile
+                 xml/dnsbl])
+AC_OUTPUT
--- a/package	Mon Dec 04 21:49:09 2006 -0800
+++ b/package	Tue Jan 30 16:27:49 2007 -0800
@@ -1,8 +1,8 @@
 #!/bin/bash
 
-T=`grep AM_INIT_AUTOMAKE configure.in | cut -d'(' -f2`
+T=`grep AC_INIT configure.in | cut -d'(' -f2`
 NAME=`echo $T | cut -d, -f1`
-VER=`echo $T | cut -d, -f2 | cut -d')' -f1`
+VER=`echo $T | cut -d, -f2`
 BALL=$NAME-$VER.tar.gz
 web=/home/httpd/html/510sg/$NAME
 distlog=/tmp/distcheck
--- a/src/Makefile.am	Mon Dec 04 21:49:09 2006 -0800
+++ b/src/Makefile.am	Tue Jan 30 16:27:49 2007 -0800
@@ -6,7 +6,8 @@
 INCLUDES= $(all_includes)
 
 # the library search path.
-dnsbl_LDFLAGS = $(all_libraries) /usr/lib/libresolv.a -lmilter -pthread
+dnsbl_LDFLAGS = -pthread
+dnsbl_LDADD   = $(all_libraries) /usr/lib/libresolv.a -lmilter
 
 # default compile flags
 dnsbl_CXXFLAGS = -pthread
--- a/src/context.cpp	Mon Dec 04 21:49:09 2006 -0800
+++ b/src/context.cpp	Tue Jan 30 16:27:49 2007 -0800
@@ -572,7 +572,7 @@
 
 
 char *CONTEXT::find_from(char *from) {
-	char *rc = token_inherit;
+	char *rc = env_from_default;
 	string_map::iterator i = env_from.find(from);
 	if (i != env_from.end()) rc = (*i).second;	// found user@domain key
 	else {
@@ -590,7 +590,6 @@
 			}
 		}
 	}
-	if (rc == token_inherit) rc = env_from_default;
 	if ((rc == token_inherit) && parent) return parent->find_from(from);
 	return (rc == token_inherit) ? token_unknown : rc;
 }
@@ -1179,7 +1178,7 @@
 		else {
 			// may be a valid email address or domain name
 			char *st = tok.next();
-			if ((st == token_black) || (st == token_white) || (st == token_unknown)) {
+			if ((st == token_white) || (st == token_black) || (st == token_unknown) || (st == token_inherit)) {
 				me.add_from(have, st);
 			}
 			else {
@@ -1188,7 +1187,7 @@
 					me.add_from_context(have, con);
 				}
 				else {
-					tok.token_error("white/black/unknown or child context name", st);
+					tok.token_error("white/black/unknown/inherit or child context name", st);
 					return false;
 				}
 			}
--- a/src/dnsbl.cpp	Mon Dec 04 21:49:09 2006 -0800
+++ b/src/dnsbl.cpp	Tue Jan 30 16:27:49 2007 -0800
@@ -63,7 +63,7 @@
 
 
 extern "C" {
-	#include "libmilter/mfapi.h"
+	#include <libmilter/mfapi.h>
 	sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr);
 	sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv);
 	sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv);
--- a/tld.conf	Mon Dec 04 21:49:09 2006 -0800
+++ b/tld.conf	Tue Jan 30 16:27:49 2007 -0800
@@ -1,8 +1,9 @@
 #
-# icann tlds from http://www.icann.org/registries/listing.html as of 2005-12-24
+# icann tlds from http://www.icann.org/registries/listing.html as of 2006-12-12
 #
 aero
 biz
+cat
 com
 coop
 edu
@@ -11,26 +12,22 @@
 int
 jobs
 mil
+mobi
 museum
 name
 net
 org
 pro
+tel
 travel
 
 #
-# more icann tlds from http://www.icann.org/registrars/accredited-list.html as of 2005-12-24
+# extra country codes that are in the root as of 2006-12-12
 #
-cat
-mobi
+tp  # East Timor, obsolete
 
 #
-# not yet listed by icann or iana, but exist anyway as of 2005-12-24
-#
-su
-
-#
-# iana root tlds from http://www.iana.org/cctld/cctld-whois.htm as of 2005-12-24
+# iana root tlds from http://www.iana.org/cctld/cctld-whois.htm as of 2006-12-12
 #
 ac  # Ascension Island
 ad  # Andorra
@@ -82,7 +79,6 @@
 cn  # China
 co  # Colombia
 cr  # Costa Rica
-cs  # Serbia and Montenegro
 cu  # Cuba
 cv  # Cape Verde
 cx  # Christmas Island
@@ -105,7 +101,7 @@
 fi  # Finland
 fj  # Fiji
 fk  # Falkland Islands (Malvinas)
-fm  # Micronesia, Federal State of
+fm  # Micronesia, Federated States of
 fo  # Faroe Islands
 fr  # France
 ga  # Gabon
@@ -172,13 +168,14 @@
 ma  # Morocco
 mc  # Monaco
 md  # Moldova, Republic of
+me  # Montenegro
 mg  # Madagascar
 mh  # Marshall Islands
 mk  # Macedonia, The Former Yugoslav Republic of
 ml  # Mali
 mm  # Myanmar
 mn  # Mongolia
-mo  # Macau
+mo  # Macao
 mp  # Northern Mariana Islands
 mq  # Martinique
 mr  # Mauritania
@@ -213,13 +210,14 @@
 pm  # Saint Pierre and Miquelon
 pn  # Pitcairn Island
 pr  # Puerto Rico
-ps  # Palestinian Territories
+ps  # Palestinian Territory, Occupied
 pt  # Portugal
 pw  # Palau
 py  # Paraguay
 qa  # Qatar
 re  # Reunion Island
 ro  # Romania
+rs  # Serbia
 ru  # Russian Federation
 rw  # Rwanda
 sa  # Saudi Arabia
@@ -238,6 +236,7 @@
 so  # Somalia
 sr  # Suriname
 st  # Sao Tome and Principe
+su  # Soviet Union (being phased out)
 sv  # El Salvador
 sy  # Syrian Arab Republic
 sz  # Swaziland
@@ -273,7 +272,7 @@
 vn  # Vietnam
 vu  # Vanuatu
 wf  # Wallis and Futuna Islands
-ws  # Western Samoa
+ws  # Samoa
 ye  # Yemen
 yt  # Mayotte
 yu  # Yugoslavia
--- a/xml/dnsbl.in	Mon Dec 04 21:49:09 2006 -0800
+++ b/xml/dnsbl.in	Tue Jan 30 16:27:49 2007 -0800
@@ -519,7 +519,11 @@
         <refsect1 id='description.5'>
             <title>Description</title>
             <para>The <command>@PACKAGE@.conf</command> configuration file is
-            specified by this partial bnf description.</para>
+            specified by this partial bnf description. Comments start with //
+            or # and extend to the end of the line. To include the contents
+            of some file verbatim in the dnsbl.conf file, use
+            <literallayout class="monospaced"><![CDATA[include "<file>";]]></literallayout>
+            </para>
 
             <literallayout class="monospaced"><![CDATA[
 CONFIG     = {CONTEXT ";"}+
@@ -568,7 +572,7 @@
 
 DEFAULT    = ("white" | "black" | "unknown" | "inherit" | "")
 ADDRESS    = (USER@ | DOMAIN | USER@DOMAIN)
-VALUE      = ("white" | "black" | "unknown" | CHILD-CONTEXT-NAME)]]></literallayout>
+VALUE      = ("white" | "black" | "unknown" | "inherit" | CHILD-CONTEXT-NAME)]]></literallayout>
         </refsect1>
 
         <refsect1 id='sample.5'>
@@ -703,7 +707,7 @@
         context customer1a {
             env_to {
                 customer1a.com;
-            }
+            };
             env_from black {                        # blacklist everything
                 first@acceptable.com    unknown;    # except these specific envelope senders
                 second@another.com      unknown;