# HG changeset patch # User carl # Date 1082996910 25200 # Node ID 443aa0e8c6fa65bc46d042639bf2f18962bf5ca8 # Parent 2752e512fd32ffe5a3065549f4ee6a4f3eb53c51 changes suggested by Nigel Horne diff -r 2752e512fd32 -r 443aa0e8c6fa install.bash --- a/install.bash Sun Apr 25 11:36:08 2004 -0700 +++ b/install.bash Mon Apr 26 09:28:30 2004 -0700 @@ -10,7 +10,8 @@ ##################### # build the milter -g++ -c dnsbl.cpp +# add compiler flags - suggested by Nigel Horne +g++ -c $CXXFLAGS dnsbl.cpp if [ $? -ne 0 ]; then echo "compiler errors" exit @@ -26,7 +27,9 @@ # install the milter DST=/var/dnsbl mkdir -p $DST +if [ ! -f $DST/dnsbl.conf ]; then cp dnsbl.conf $DST +fi mv -f dnsbl $DST cp dnsbl.rc /etc/rc.d/init.d/dnsbl chmod 755 /etc/rc.d/init.d/dnsbl diff -r 2752e512fd32 -r 443aa0e8c6fa src/dnsbl.cpp --- a/src/dnsbl.cpp Sun Apr 25 11:36:08 2004 -0700 +++ b/src/dnsbl.cpp Mon Apr 26 09:28:30 2004 -0700 @@ -450,9 +450,9 @@ count++; if (count > 20) return oksofar; // silly to check too many hosts url = *i; - char buf[200]; - snprintf(buf, sizeof(buf), "looking for url %s", url); - my_syslog(buf); + // char buf[200]; + // snprintf(buf, sizeof(buf), "looking for url %s", url); + // my_syslog(buf); ip = protected_dns_interface(url); if (ip) { status st = check_single(ip, dc.content_suffix); diff -r 2752e512fd32 -r 443aa0e8c6fa src/package --- a/src/package Sun Apr 25 11:36:08 2004 -0700 +++ b/src/package Mon Apr 26 09:28:30 2004 -0700 @@ -1,14 +1,17 @@ #!/bin/bash +VER=dnsbl-2.1 +mkdir $VER target1=/home/httpd/html/510sg/util/dnsbl.tar.gz target2=/home/httpd/html/510sg/dnsbl.conf target3=/home/httpd/html/510sg/dnsbl.html -mv -f dnsbl.conf dnsbl.conf.save -mv sample.conf dnsbl.conf - tar cfvz $target1 dnsbl.cpp scanner.cpp test.cpp dnsbl.conf dnsbl.rc install.bash LICENSE -mv dnsbl.conf sample.conf -mv dnsbl.conf.save dnsbl.conf + cp sample.conf $VER/dnsbl.conf + cp *cpp $VER + cp *rc $VER + cp install.bash $VER + cp LICENSE $VER + tar cfvz $target1 $VER cp sample.conf $target2 cp dnsbl.html $target3 @@ -16,3 +19,4 @@ scp $target1 ns1:$target1 scp $target2 ns1:$target2 scp $target3 ns1:$target3 +rm -rf $VER diff -r 2752e512fd32 -r 443aa0e8c6fa test.bash --- a/test.bash Sun Apr 25 11:36:08 2004 -0700 +++ b/test.bash Mon Apr 26 09:28:30 2004 -0700 @@ -1,21 +1,19 @@ #!/bin/bash -########################### -# compile and run the test program -# -g++ -c test.cpp -if [ $? -ne 0 ]; then - echo "compiler errors" - exit -fi -g++ -o test test.o -pthread -if [ $? -ne 0 ]; then - echo "linker errors" - exit -fi +############################ +## compile and run the test program +## +#g++ -c test.cpp +#if [ $? -ne 0 ]; then +# echo "compiler errors" +# exit +#fi +#g++ -o test test.o -pthread +#if [ $? -ne 0 ]; then +# echo "linker errors" +# exit +#fi -./test -exit ########################### # compile the milter diff -r 2752e512fd32 -r 443aa0e8c6fa xml/dnsbl.in --- a/xml/dnsbl.in Sun Apr 25 11:36:08 2004 -0700 +++ b/xml/dnsbl.in Mon Apr 26 09:28:30 2004 -0700 @@ -159,7 +159,7 @@ line in your sendmail.mc and rebuild the .cf file
-INPUT_MAIL_FILTER(`dnsbl', `S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:2m;R:2m;E:5m')
+INPUT_MAIL_FILTER(`dnsbl', `S=local:/var/run/dnsbl.sock, F=T, T=C:30s;S:2m;R:2m;E:5m')
 
Read the sample WHITE (TAG below) -# many -> BLACK (TAG below) -# env_to -> env_to xxx TAG -# env_from -> env_from EMAP xxx TAG TAG -# substitute mail_host -> env_from EMAP xxx TAG TAG +# ok -> WHITE +# many -> BLACK +# env_from -> env_from EMAP xxx +# env_to -> env_to +# substitute mail_host -> env_from EMAP xxx # # # @@ -79,8 +72,6 @@ # define the dnsbls to use # # -content sbl-xbl.spamhaus.org 'Mail containing %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s' -# dnsbl LOCAL blackholes.five-ten-sg.com 'Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s' dnsbl SPEWS blackholes.spews.org 'Mail from %s rejected - spews; see http://www.spews.org/ask.cgi?x=%s' dnsbl SBL sbl-xbl.spamhaus.org 'Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s' @@ -104,7 +95,7 @@ # special list for the vp env_from TEST dummy-token DEFAULT # inherit the currently defined DEFAULT env_from mapping env_from TEST nai.com BLACK # the vp does not like nai -env_from TEST yahoo.com DEFAULT # override the blacklisting of yahoo +env_from TEST yahoo.com DEFAULT # env_from TEST mother@spammyisp.com WHITE # suppresses dnsbl checking @@ -121,11 +112,11 @@ # specify dnsbl_lists and env_from maps to use for clients domains # env_to mydomain.com DEFAULT DEFAULT -env_to customer1.com CUST1 CUST1 # all customer 1 domains use just sbl -env_to customer1a.com CUST1 CUST1 -env_to customer1b.com CUST1 CUST1 -env_to customer2.com CUST2 CUST2 # all customer 2 domains use spews and sbl -env_to customer2a.com CUST2 CUST2 +env_to customer1.com CUST1 DEFAULT # all customer 1 domains use just sbl +env_to customer1a.com CUST1 DEFAULT +env_to customer1b.com CUST1 DEFAULT +env_to customer2.com CUST2 DEFAULT # all customer 2 domains use spews and sbl +env_to customer2a.com CUST2 DEFAULT ############################################## @@ -133,20 +124,4 @@ # file names are single tokens, no embedded blanks # include dnsbl.conf # this will generate a recursive include file syslog error message - - -############################################## -# -# fetch the normal dcc whitelist file and put the entries into the DEFAULT -# envelope-from-map. The ok/many tags in the DCC file turn into -# WHITE/BLACK entries when imported. The env_to entries from the DCC -# config turn into env_to entries here, and are therefore global to all -# domains. The assumption is that a client will only have whitelist -# env_to entries for their own domains, in their own dcc config file. The -# env_from and substitute mail_host entries turn into env_from entries in -# the named (DEFAULT in this case) envelope-from-map. -# -# -include_dcc DEFAULT /var/dcc/whitecommon -include_dcc CUST1 /var/dcc/whitecommon.cust1 -include_dcc CUST2 /var/dcc/whitecommon.cust2 +include_dcc DEFAULT /var/dcc/whitecommon # this includes the default dcc whitelist file