pax_global_header00006660000000000000000000000064113027370670014520gustar00rootroot0000000000000052 comment=66593fba3158bbc78c5f21c8abd68c6c47cad0d2 dnswl-sync-0.1/000075500000000000000000000000001130273706700134575ustar00rootroot00000000000000dnswl-sync-0.1/.gear/000075500000000000000000000000001130273706700144535ustar00rootroot00000000000000dnswl-sync-0.1/.gear/rules000064400000000000000000000000071130273706700155250ustar00rootroot00000000000000tar: . dnswl-sync-0.1/README.ALT000064400000000000000000000006401130273706700147560ustar00rootroot000000000000001. Configure postfix: main.cf: smtpd_recipient_restrictions = ... reject_unauth_destination ... check_client_access cidr:/var/lib/dnswl-sync/postfix-dnswl-header check_client_access cidr:/var/lib/dnswl-sync/postfix-dnswl-permit ... 2. Edit config file /etc/dnswl/dnswl-postfix.conf. Don't touch header_orig, change only header_new. 3. Run `dnswl-sync-postfix' for test. 4. Adjust /etc/cron.d/dnswl-postfix. dnswl-sync-0.1/dnswl-postfix.conf000064400000000000000000000005161130273706700171510ustar00rootroot00000000000000server=rsync1.dnswl.org # how we must change header in downloaded files header_orig=X-REPLACEME header_new=X-my-whitelisted # what we must do with whitelisted hosts # keep orig/new same if you do not want to change ACTION permit_orig=permit_auth_destination permit_new=permit_auth_destination #permit_new="FILTER local:$myhostname" dnswl-sync-0.1/dnswl-postfix.cron000064400000000000000000000001771130273706700171700ustar00rootroot00000000000000PATH=/root/bin:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin 00 5 * * * root dnswl-sync-postfix >/dev/null 2>&1 dnswl-sync-0.1/dnswl-sync-postfix000075500000000000000000000044031130273706700172010ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2008 Vladimir V. Kamarzin # # synchronize dnswl.org lists for postfix # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # we need libshell functions . shell-error . shell-quote # work variables, may be overwritten in config datadir=/var/lib/dnswl-sync tmpdir=$datadir/tmp # check that we have config [ -r /etc/dnswl/dnswl-postfix.conf ] && . /etc/dnswl/dnswl-postfix.conf \ || fatal "cannot source config file /etc/dnswl/dnswl-postfix.conf" # copy existent files to temp dir cp $datadir/postfix-* $tmpdir/ && have_old=1 || message "failed to copy dnswl-files to temp dir, first run?" [ x"$have_old" != x1 ] || { # restore original header name for traffic economy [ "$header_orig" = "$header_new" ] || \ sed -i -e "s/$(quote_sed_regexp "$header_new")/$(quote_sed_regexp "$header_orig")/" \ $tmpdir/postfix-dnswl-header # restore original action for traffic economy [ "$permit_orig" = "$permit_new" ] || \ sed -i -e "s/$(quote_sed_regexp "$permit_new")/$(quote_sed_regexp "$permit_orig")/" \ $tmpdir/postfix-dnswl-permit } # do sync rsync -vaP $server::dnswl/postfix-* $tmpdir/ \ || fatal "failed to complete synchronization, aborting" # change header name [ "$header_orig" = "$header_new" ] || \ sed -i -e "s/$(quote_sed_regexp "$header_orig")/$(quote_sed_regexp "$header_new")/" \ $tmpdir/postfix-dnswl-header # change action name [ "$permit_orig" = "$permit_new" ] || \ sed -i -e "s/$(quote_sed_regexp "$permit_orig")/$(quote_sed_regexp "$permit_new")/" \ $tmpdir/postfix-dnswl-permit # move new lists to work location mv -f $tmpdir/postfix-* $datadir/ chown root:root $datadir/* dnswl-sync-0.1/dnswl-sync.spec000064400000000000000000000025071130273706700164400ustar00rootroot00000000000000Name: dnswl-sync Version: 0.1 Release: alt2 Summary: dnswl.org synchronization utilities License: GPL Group: System/Configuration/Networking BuildArch: noarch Source: %name-%version.tar Requires: libshell %description %summary %package common Summary: dnswl.org synchronization utilities - common files Group: System/Configuration/Networking %description common %summary %package postfix Summary: dnswl.org synchronization utilities - postfix version Group: System/Configuration/Networking Requires: %name-common = %version-%release %description postfix %summary %prep %setup %install install -d %buildroot%_bindir install -d %buildroot%_sysconfdir/{cron.d,dnswl} install -d %buildroot%_localstatedir/%name/tmp install -pm755 dnswl-sync-postfix %buildroot%_bindir/ install -pm644 dnswl-postfix.conf %buildroot%_sysconfdir/dnswl/ install -pDm644 dnswl-postfix.cron %buildroot%_sysconfdir/cron.d/dnswl-postfix %files common %_localstatedir/%name %dir %_sysconfdir/dnswl %files postfix %_bindir/dnswl-sync-postfix %config(noreplace) %_sysconfdir/cron.d/dnswl-postfix %config(noreplace) %_sysconfdir/dnswl/dnswl-postfix.conf %doc README.ALT %changelog * Tue Nov 24 2009 Vladimir V. Kamarzin 0.1-alt2 - Update README.ALT. * Wed Nov 12 2008 Vladimir V. Kamarzin 0.1-alt1 - Initial build for ALT Linux.