debian/0000755000000000000000000000000012120051460007155 5ustar debian/pydist-overrides0000644000000000000000000000006211555343460012431 0ustar pyspf python-spf Twisted-Core python-twisted-core debian/compat0000644000000000000000000000000211363267477010404 0ustar 7 debian/bley.postrm0000644000000000000000000000142511364312255011373 0ustar #!/bin/sh # postrm script for bley # # see: dh_installdeb(1) set -e if [ "$1" = "purge" ] ; then deluser --quiet --system bley > /dev/null || true rm -f /var/run/bley/bley.pid rmdir /var/run/bley || true rm -f /etc/bley/dbconfig-common.conf if which ucf >/dev/null 2>&1; then ucf --purge /etc/bley/dbconfig-common.conf ucfr --purge bley /etc/bley/dbconfig-common.conf fi fi if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then . /usr/share/dbconfig-common/dpkg/postrm dbc_go bley $@ fi # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# debian/control0000644000000000000000000000144711572426346010611 0ustar Source: bley Section: mail Priority: optional Maintainer: Evgeni Golov Build-Depends: debhelper (>= 7.0.50~), python-setuptools, python-all (>= 2.6.6-3~) Standards-Version: 3.9.2 X-Python-Version: >= 2.5 Homepage: http://bley.mx Package: bley Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-twisted-core (>= 8.1.0), python-twisted-names (>= 8.1.0), python-spf, python-psycopg2 | python-mysqldb, dbconfig-common, adduser Recommends: postgresql-client | mysql-client, postfix XB-Python-Version: ${python:Versions} Description: intelligent greylisting daemon for Postfix bley uses various test (incl. RBL and SPF) to decide whether a sender should be greylisted or not, thus mostly eliminating the usual greylisting delay while still filtering most of the spam. debian/docs0000644000000000000000000000000711363267501010042 0ustar README debian/bley.prerm0000644000000000000000000000017711364016421011173 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm dbc_go bley $@ #DEBHELPER# debian/bley.install0000644000000000000000000000005111364312117011504 0ustar debian/bley.conf.template usr/share/bley debian/manpages0000644000000000000000000000001611366247605010713 0ustar debian/bley.1 debian/changelog0000644000000000000000000000270712120051017011033 0ustar bley (0.1.5-2) unstable; urgency=low * cherry-pick patch from upstream to disable njabl.org -- Evgeni Golov Wed, 13 Mar 2013 11:15:58 +0100 bley (0.1.5-1) unstable; urgency=low * New upstream release + Includes fixes for MySQL problems. Closes: #618252 + Does not import psycopg2 when running with mysql anymore. Closes: #599729 * Switch to dh_python2. * Set X-Python-Version >= 2.5, not only "2.5, 2.6". Closes: #606363 * Standards-Version: 3.9.2 -- Evgeni Golov Sat, 04 Jun 2011 14:53:21 +0200 bley (0.1.4-1) unstable; urgency=low * New upstream release -- Evgeni Golov Sun, 15 Aug 2010 17:20:25 +0200 bley (0.1.3-1) unstable; urgency=low * New upstream release * debian/control: + Standards-Version: 3.9.1 + Fix typo in description (Closes: #591214) * debian/copyright: + Quote BSD license, thanks lintian. -- Evgeni Golov Sun, 15 Aug 2010 13:47:43 +0200 bley (0.1.2-1) unstable; urgency=low * New upstream release * debian/bley.{init,postinst}: + Create /var/run/bley in init, /var/run is cleaned on reboot on some systems. * debian/control: + Add depends on python-twisted-names. -- Evgeni Golov Thu, 27 May 2010 09:27:37 +0200 bley (0.1.1-1) unstable; urgency=low * Initial release (Closes: #578491) -- Evgeni Golov Tue, 27 Apr 2010 18:47:41 +0200 debian/bley.conf.template0000644000000000000000000000015511365540747012617 0ustar [bley] dbtype=_DBC_DBTYPE_ dbhost=_DBC_DBSERVER_ dbname=_DBC_DBNAME_ dbuser=_DBC_DBUSER_ dbpass=_DBC_DBPASS_ debian/copyright0000644000000000000000000000323011431751735011126 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: bley Maintainer: Evgeni Golov Source: http://bley.mx Files: * Copyright: 2009-2010 Evgeni Golov License: 3-BSD Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/patches/0000755000000000000000000000000012120050713010604 5ustar debian/patches/02-drop-dnsbl.njabl.org-it-s-not-maintained-anymore.patch0000644000000000000000000000126512120050621023214 0ustar From 22ffed1223fbf8076ad7c72a9fecb51005a26251 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 12 Mar 2013 08:07:36 +0100 Subject: [PATCH] drop dnsbl.njabl.org, it's not maintained anymore --- bley.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bley.conf b/bley.conf index 21de6ae..c20e7bd 100644 --- a/bley.conf +++ b/bley.conf @@ -18,7 +18,7 @@ dbpass = bley dbname = bley # Which DNSBLs and DNSWLs to use? -dnsbls = ix.dnsbl.manitu.net, dnsbl.njabl.org, dnsbl.ahbl.org, dnsbl.sorbs.net +dnsbls = ix.dnsbl.manitu.net, dnsbl.ahbl.org, dnsbl.sorbs.net dnswls = list.dnswl.org # Whitelist after dnswl_threshold hits. -- 1.7.10.4 debian/patches/series0000644000000000000000000000013312120050730012015 0ustar 01-debian_config_and_paths.patch 02-drop-dnsbl.njabl.org-it-s-not-maintained-anymore.patch debian/patches/01-debian_config_and_paths.patch0000644000000000000000000000153211365541320016645 0ustar Description: Use Debian paths and a Debian specific config Needed for dbconfig-common usage. Author: Evgeni Golov Forwarded: not-needed Last-Update: 2010-04-26 --- bley-0.1.1.orig/bley +++ bley-0.1.1/bley @@ -103,7 +103,7 @@ def bley_start(): (settings, args) = parser.parse_args() if not settings.conffile: - settings.conffile = '/etc/bley/bley.conf' + settings.conffile = ['/etc/bley/bley.conf', '/etc/bley/dbconfig-common.conf'] defaults = { 'listen_addr': '127.0.0.1', --- bley-0.1.1.orig/bley.conf +++ bley-0.1.1/bley.conf @@ -4,9 +4,9 @@ listen_addr = 127.0.0.1 listen_port = 1337 # Where to save the PID file? -pid_file = bley.pid +pid_file = /var/run/bley/bley.pid # Where to save the log file? -log_file = bley.log +log_file = syslog reject_msg = greylisted, try again later debian/bley.10000644000000000000000000000112411366247415010212 0ustar .TH BLEY "1" "April 2010" "bley 0.1" "bley" .SH NAME bley \- intelligent greylisting daemon for Postfix .SH SYNOPSIS .B bley [\fIoptions\fR] .SH OPTIONS .TP \fB\-\-version\fR show program's version number and exit .TP \fB\-h\fR, \fB\-\-help\fR show this help message and exit .TP \fB\-p\fR \fIPID_FILE\fR, \fB\-\-pidfile\fR=\fIPID_FILE\fR use PID_FILE for storing the PID .TP \fB\-c\fR \fICONFFILE\fR, \fB\-\-config\fR=\fICONFFILE\fR load configuration from CONFFILE .TP \fB\-v\fR, \fB\-\-verbose\fR use verbose output .TP \fB\-d\fR, \fB\-\-debug\fR don't daemonize the process and log to stdout debian/source/0000755000000000000000000000000011363267501010472 5ustar debian/source/format0000644000000000000000000000001411363267501011700 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000030211555101547010245 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --with python2 override_dh_auto_clean: dh_auto_clean $(RM) -rf bley.egg-info debian/bley.postinst0000644000000000000000000000245111377417206011740 0ustar #!/bin/sh # postinst script for bley # # see: dh_installdeb(1) set -e case "$1" in configure) if ! getent passwd bley >/dev/null 2>&1; then adduser --system \ --quiet \ --disabled-password \ --no-create-home \ --home "/var/run/bley" \ --gecos "intelligent greylisting daemon for Postfix" \ --group bley fi if ! dpkg-statoverride --list /etc/bley >/dev/null; then chown root:bley /etc/bley chmod 750 /etc/bley fi if ! dpkg-statoverride --list /etc/bley/bley.conf >/dev/null; then chown bley:bley /etc/bley/bley.conf chmod 600 /etc/bley/bley.conf fi . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/postinst dbc_generate_include_args="-o template_infile=/usr/share/bley/bley.conf.template" dbc_generate_include_owner="bley" dbc_generate_include=template:/etc/bley/dbconfig-common.conf dbc_go bley $@ # db_stop is needed, or configure will hang forever db_stop ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/README.Debian0000644000000000000000000000236411365543647011252 0ustar README.Debian for bley ====================== bley is autoconfigured with dbconfig-common in Debian. When, for some reason, you want to do it by hand, you have to execute the following steps: 1. Create a database and an user who can write to it. For PostgreSQL, you can do this with: CREATE USER bley WITH PASSWORD 'bley'; CREATE DATABASE bley; GRANT ALL ON DATABASE bley TO bley; For MySQL, it should be something like: CREATE USER 'bley'@'localhost' IDENTIFIED BY 'bley'; CREATE DATABASE bley; GRANT ALL ON bley.* TO 'bley'@'localhost'; 2. Tell bley to use these settings for accessing the database: Edit /etc/bley/dbconfig-common.conf and set dbtype=pgsql (or mysql if you are using MySQL) and dbhost, dbname, dbuser, dbpass to the appropriate values. (Yes, really no quotes, this is a Python ConfigParser config.) 3. Restart bley. Now bley is running and you can configure Postfix to use it as a policy server by editing /etc/postfix/main.cf and setting smtpd_recipient_restrictions to smtpd_recipient_restrictions = ..., check_policy_service inet:127.0.0.1:1337 After reloading the Postfix configuration, it will use bley for filtering spam. -- Evgeni Golov Mon, 26 Apr 2010 11:30:50 +0200 debian/bley.init0000644000000000000000000000716111377417347011031 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: bley # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: bley initscript # Description: intelligent greylisting daemon for Postfix. ### END INIT INFO # Author: Evgeni Golov # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="intelligent greylisting daemon for Postfix" NAME=bley DAEMON=/usr/bin/$NAME DAEMON_ARGS="" DAEMON_USER=$NAME PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # Add pidfile to DAEMON_ARGS DAEMON_ARGS="-p $PIDFILE $DAEMON_ARGS" # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started # prepare /var/run/bley which can be gone if /var/run is cleaned on reboot if [ ! -d /var/run/bley ]; then mkdir /var/run/bley chown bley:bley /var/run/bley fi # start bley start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $DAEMON_USER --startas $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debian/watch0000644000000000000000000000007111363270546010224 0ustar version=3 http://bley.mx/download/ bley-([\d\.]+).tar.gz debian/config0000644000000000000000000000035411364016402010355 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/config ]; then dbc_dbtypes="mysql, pgsql" dbc_authmethod_user="password" . /usr/share/dbconfig-common/dpkg/config dbc_go bley $@ fi