changeset 4:15a7e942adec

updates to use dcc conf files
author carl
date Wed, 21 Apr 2004 12:52:29 -0700
parents 7e1eb343a825
children 793ac9cc114d
files src/dnsbl src/dnsbl.cpp test.bash test.cf xml/dnsbl.in xml/sample.conf
diffstat 6 files changed, 42 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
Binary file src/dnsbl has changed
--- a/src/dnsbl.cpp	Wed Apr 21 12:52:29 2004 -0700
+++ b/src/dnsbl.cpp	Wed Apr 21 12:52:29 2004 -0700
@@ -9,14 +9,8 @@
 
 -p port  The port through which the MTA will connect to this milter.
 -t sec   The timeout value.
-
-TODO:
-
-1) Add "include-dcc NAME fn" to read a dcc whiteclnt file looking
-for many substitute mail-host domain, and add the equivalent "env_from
-domain black" into the NAME mapping. That allows clients to use just the
-DCC for white/blacklisting, but the backup mx machines can use dnsbl
-and get the same effect.
+-c       Check the config, and print a copy to stderr. Don't start the
+         milter or do anything with the socket.
 
 */
 
--- a/test.bash	Wed Apr 21 12:52:29 2004 -0700
+++ b/test.bash	Wed Apr 21 12:52:29 2004 -0700
@@ -16,16 +16,16 @@
 chmod 700 /var/run/dnsbl
 mv -f $pid $pid.save
 rm -f /var/run/dnsbl/dnsbl.sock
-./dnsbl -p local:/var/run/dnsbl/dnsbl.sock &
-sleep 5
-P2=`cat $pid`
-mv -f $pid.save $pid
-echo started dnsbl milter as process $P2
+./dnsbl -c -p local:/var/run/dnsbl/dnsbl.sock >check.txt 2>&1
+#sleep 5
+#P2=`cat $pid`
+#mv -f $pid.save $pid
+#echo started dnsbl milter as process $P2
+#
+#/usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
+#sleep 5
+#P3=`head -1 /var/run/sm-test.pid`
+#echo started sendmail as process $P3
+#
+#echo eventually "'"kill -KILL $P2 $P3"'"
 
-/usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
-sleep 5
-P3=`head -1 /var/run/sm-test.pid`
-echo started sendmail as process $P3
-
-echo eventually "'"kill -KILL $P2 $P3"'"
-
--- a/test.cf	Wed Apr 21 12:52:29 2004 -0700
+++ b/test.cf	Wed Apr 21 12:52:29 2004 -0700
@@ -16,8 +16,8 @@
 #####
 #####		SENDMAIL CONFIGURATION FILE
 #####
-##### built by root@ns.five-ten-sg.com on Wed Apr 14 20:41:48 PDT 2004
-##### in /usr/src/rh8/dnsbl
+##### built by root@ns.five-ten-sg.com on Wed Apr 21 11:01:48 PDT 2004
+##### in /usr/src/rh8/gpl/dnsbl
 ##### using /usr/share/sendmail-cf/ as configuration include directory
 #####
 ######################################################################
@@ -410,7 +410,7 @@
 O SuperSafe=True
 
 # status file
-O StatusFile=/usr/src/rh8/dnsbl/sendmail.st
+O StatusFile=/usr/src/rh8/gpl/dnsbl/sendmail.st
 
 # time zone handling:
 #  if undefined, use system default
--- a/xml/dnsbl.in	Wed Apr 21 12:52:29 2004 -0700
+++ b/xml/dnsbl.in	Wed Apr 21 12:52:29 2004 -0700
@@ -28,7 +28,11 @@
 bulk detector, or from the DNS based lists.  Those are two very
 different reasons for whitelisting.  The former is done thru the DCC
 whiteclnt config file, the later is done thru the DNSBL milter config
-file.
+file.  There is an option to reference the DCC whiteclnt file (via an
+include_dcc line) in the DNSBL milter config.  This will import the
+(env_to, env_from, and substitute mail_host) entries from the DCC config
+into the DNSBL config.  This allows using the DCC config as the single
+point for white/blacklisting.
 
 <p>You may want to blacklist some specific senders or sending domains.
 This could be done thru either the DCC (on a global basis, or for a
@@ -110,6 +114,8 @@
 file and modify it to fit your configuration.
 
 
+<pre>
 $Id$
+</pre>
 </body>
 </html>
--- a/xml/sample.conf	Wed Apr 21 12:52:29 2004 -0700
+++ b/xml/sample.conf	Wed Apr 21 12:52:29 2004 -0700
@@ -1,3 +1,4 @@
+# $Id$
 #
 # lines start with a command token, following by argument tokens
 # tokens are separated by spaces or tabs
@@ -49,6 +50,22 @@
 #   lookup scheme (reversed octets of the client followed by the dns suffix).
 #
 #
+# include:
+#   second token is the path name of the dnsbl milter config file to be
+#   included.
+#
+#
+# include_dcc:
+#   second token is the name of an envelope-from-map (EMAP below).
+#   third token is the path name of the dcc whiteclnt config file to be
+#   included.
+#       entries from the dcc config are mapped as:
+#           ok -> WHITE
+#           many -> BLACK
+#           env_from -> env_from EMAP xxx
+#           env_to   -> env_to
+#           substitute mail_host -> env_from EMAP xxx
+#
 #
 #
 ##############################################
@@ -106,3 +123,4 @@
 # file names are single tokens, no embedded blanks
 #
 include dnsbl.conf      # this will generate a recursive include file syslog error message
+include_dcc  DEFAULT /var/dcc/whitecommon   # this includes the default dcc whitelist file