--- spampd-2.20.orig/debian/patches/00list +++ spampd-2.20/debian/patches/00list @@ -0,0 +1,5 @@ +35-add-Makefile.dpatch +40-fix-shebang-line.dpatch +45-fix-man-references.dpatch +50-fix-fd-usage.dpatch +55-add-envelope-from_to.dpatch --- spampd-2.20.orig/debian/patches/40-fix-shebang-line.dpatch +++ spampd-2.20/debian/patches/40-fix-shebang-line.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh +## fix-shebang-line.dpatch by Sven Mueller +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix first line of script to omit the extra space between ! and +## DP: /usr/bin/perl +set -e + +if [[ "$2" = "" ]]; then + DIR="." +else + DIR="$2" +fi + +TMPFILE=`mktemp` +cat << EOF > $TMPFILE +--- spampd 2004-10-07 03:41:22.000000000 +0200 ++++ spampd 2004-11-13 19:22:12.000000000 +0100 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl -T ++#!/usr/bin/perl -T + + ###################### + # SpamPD - spam proxy daemon +EOF + +cd $DIR +if [[ "$1" = "-patch" ]]; then + patch --dry-run -p0 -E -t < $TMPFILE && patch -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 +else + if [[ "$1" = "-unpatch" ]]; then + patch --dry-run -R -p0 -E -t < $TMPFILE && patch -R -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 + else + echo "unknown commandline option to dpatch script" + fi +fi +rm $TMPFILE +exit 1 --- spampd-2.20.orig/debian/patches/35-add-Makefile.dpatch +++ spampd-2.20/debian/patches/35-add-Makefile.dpatch @@ -0,0 +1,90 @@ +#! /bin/sh +## add-Makefile.dpatch by Sven Mueller +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add a Makefile +set -e + +if [[ "$2" = "" ]]; then + DIR="." +else + DIR="$2" +fi + +TMPFILE=`mktemp` +cat << EOF > $TMPFILE +--- Makefile ++++ Makefile +@@ -0,0 +1,44 @@ ++#!/usr/bin/make -f \$0 ++# ++# Make file for spampd ++# created for the debian project ++# by Sven Mueller ++# published under the GPL ++# ++ETCDIR:=\$(DESTDIR)/etc ++BINDIR:=\$(DESTDIR)/usr/sbin ++INITDIR:=/etc/init.d ++DOCDIR:=\$(DESTDIR)/usr/share/doc/spampd ++#RUNLEVELDIRS:=\$(DESTDIR)/etc/rc3.d ++MANDIR:=\$(DESTDIR)/usr/share/man ++INSTALL:="/usr/bin/install" ++LN:="ln" ++ ++.PHONY: all install clean ++all: spampd.8.gz spampd.html ++ ++install: spampd.8.gz spampd.html ++ \$(INSTALL) -D -m 755 spampd \${BINDIR}/spampd ++# \$(INSTALL) -D -m 644 defaults \${ETCDIR}/default/spampd ++# \$(INSTALL) -D -m 755 spampd-init.sh \$(DESTDIR)\${INITDIR}/spampd ++ \$(INSTALL) -D -m 644 spampd.html \${DOCDIR}/spampd.html ++# \$(INSTALL) -D -m 644 changelog.txt \${DOCDIR}/changelog.txt ++# for i in \${RUNLEVELDIRS}; do \\ ++# \$(LN) -sf \${INITDIR}/spampd \$i/S20spampd ; \\ ++# done ++ \$(INSTALL) -D -m 644 spampd.8.gz \${MANDIR}/man8/spampd.8.gz ++ ++spampd.8.gz: spampd.8 ++ gzip -9 < spampd.8 > spampd.8.gz ++ ++spampd.8: spampd ++ pod2man --section=8 --center="Spam Proxy Daemon" spampd > spampd.8 ++ ++spampd.html: spampd ++ pod2html --outfile spampd.html --header --norecurse --backlink '[Back to top]' --infile spampd ++ rm -f pod2htm?.tmp ++ ++clean: ++ rm -f spampd.8.gz ++ rm -f spampd.8 ++ rm -f spampd.html +EOF + +cd $DIR +if [[ "$1" = "-patch" ]]; then + if patch --dry-run -p0 -E -t < $TMPFILE; then + patch -p0 -E -t < $TMPFILE + rm $TMPFILE + exit 0 + else + rm $TMPFILE + exit 1 + fi +else + if [[ "$1" = "-unpatch" ]]; then + if patch --dry-run -R -p0 -E -t < $TMPFILE; then + patch -R -p0 -E -t < $TMPFILE + rm $TMPFILE + exit 0 + else + rm $TMPFILE + exit 1 + fi + else + echo "unknown commandline option to dpatch script" + fi +fi +rm $TMPFILE +exit 1 --- spampd-2.20.orig/debian/patches/55-add-envelope-from_to.dpatch +++ spampd-2.20/debian/patches/55-add-envelope-from_to.dpatch @@ -0,0 +1,175 @@ +#! /bin/sh +## fix-man-references.dpatch by Sven Mueller +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix references in man page +set -e + +if [[ "$2" = "" ]]; then + DIR="." +else + DIR="$2" +fi + +TMPFILE=`mktemp` +cat << EOF > $TMPFILE +--- spampd 2005-02-02 01:16:41.000000000 +0100 ++++ spampd.fixed 2005-02-02 01:20:23.000000000 +0100 +@@ -435,13 +435,32 @@ + if ( \$size < (\$self->{spampd}->{maxsize} * 1024) ) { + + my (@msglines, \$msgid, \$sender, \$recips, \$tmp, \$mail, \$msg_resp); ++ ++ \$recips = "@{\$self->{smtp_server}->{to}}"; ++ if ("\$self->{smtp_server}->{from}" =~ /(\\<.*?\\>)/ ) {\$sender = \$1;} ++ \$msgid ||= "(unknown)"; ++ \$recips ||= "(unknown)"; ++ \$sender ||= "(unknown)"; + + ## read message into array of lines to feed to SA + my \$inhdr=1; ++ my \$envfrom=0; ++ my \$envto=0; ++ my \$addedenvto=0; + \$fh->seek(0,0) or die "Can't rewind message file: \$!"; + # loop over message file content + while (<\$fh>) { +- \$inhdr = 0 if (/^\\r?\\n\$/); # outside of msg header after first blank line ++ \$envto = 1 if (/^Envelope-To: /); ++ if ( (/^\\r?\\n\$/) && (\$inhdr ==1) ) { ++ \$inhdr = 0; # outside of msg header after first blank line ++ if ( \$self->{spampd}->{envelopeheaders} ) { ++ push(@msglines,"Envelope-From: \$sender\\r\\n") if ( \$envfrom == 0); ++ if ( \$envto == 0) { ++ push(@msglines,"Envelope-To: \$recips\\r\\n"); ++ \$addedenvto=1; ++ } ++ } ++ } + push(@msglines, \$_); + # find the Message-ID for logging (code is mostly from spamd) + if ( \$inhdr && /^Message-Id:\\s+(.*?)\\s*\$/i ) { +@@ -509,12 +529,24 @@ + # out here and leaving a half-written file). + my @resplines = split(/\\r?\\n/, \$msg_resp); + my \$pause_alarm = alarm(0); ++ my \$inhdr = 1; + \$fh->seek(0,0) or die "Can't rewind message file: \$!"; + \$fh->truncate(0) or die "Can't truncate message file: \$!"; + my \$arraycont = @resplines; + for ( 0..\$arraycont ) { +- \$fh->print(\$resplines[\$_] . "\\r\\n") +- or die "Can't print to message file: \$!"; ++ \$inhdr=0 if (\$resplines[\$_] =~ m/^\\r?\\n\$/); ++ if ((\$inhdr==0) ++ || (\$addedenvto==0) ++ || (! \$resplines[\$_] =~ m/^Envelope-To: .*\$/)) { ++ # if we are still in the header, skip over any ++ # "Envelope-To: " line if we have previously ++ # added it. ++ # Envelope-From: lines are preserved though as ++ # don't really leak any - otherwise unavailable - ++ # information. ++ \$fh->print(\$resplines[\$_] . "\\r\\n") ++ or die "Can't print to message file: \$!"; ++ } + } + #restart the alarm + alarm(\$pause_alarm); +@@ -717,6 +749,8 @@ + my \$nsloglevel = 2; # default log level for Net::Server (in the range 0-4) + my \$background = 1; # specifies whether to 'daemonize' and fork into background; + # apparently useful under Win32/cygwin to disable this via --nodetach option; ++my \$envelopeheaders = 0 ; # Set Envelope-To and Envelope-From headers in the mail before ++ # passing it to spamassassin. Set to 1 to enable this + + my %options = (port => \\\$port, + host => \\\$host, +@@ -732,6 +766,7 @@ + children => \\\$children, + # maxchildren => \\\$maxchildren, + logsock => \\\$logsock, ++ envelopeheaders => \\\$envelopeheaders + ); + + usage(1) unless GetOptions(\\%options, +@@ -761,7 +796,8 @@ + 'add-sc-header|ash', # deprecated + 'hostname=s', # deprecated + 'logsock=s', +- 'nodetach' ++ 'nodetach', ++ 'set-envelope-headers|seh' + ); + + usage(0) if \$options{help}; +@@ -771,6 +807,7 @@ + } + + if ( \$options{tagall} ) { \$tagall = 1; } ++if ( \$options{'set-envelope-headers'} ) { \$envelopeheaders = 1; } + if ( \$options{'log-rules-hit'} ) { \$rh = 1; } + if ( \$options{debug} ) { \$debug = 1; \$nsloglevel = 4; } + if ( \$options{dose} ) { \$dose = 1; } +@@ -847,6 +884,7 @@ + debug => \$debug, + dose => \$dose, + instance => 0, ++ envelopeheaders => \$envelopeheaders + }, + }, 'SpamPD'; + +@@ -910,6 +948,11 @@ + (SA versions => 3.0 now control this via local.cf). + --local-only or -L Turn off all SA network-based tests (RBL, Razor, etc). + --debug or -d Turn on SA debugging (sent to log file). ++ ++ --set-envelope-headers Set Envelope-From and Envelope-To headers before ++ or -seh passing the mail to spamassassin. This is disabled ++ by default because it potentially leaks information. ++ NOTE: Please read the manpage before enabling this! + + --help or -h This message + +@@ -978,7 +1021,7 @@ + [B<--auto-whitelist|aw>] + [B<--local-only|L>] + [B<--debug|d>] +- ++[B<--set-envelope-headers|seh>] + B B<--help> + + =head1 Description +@@ -1293,6 +1336,18 @@ + what spampd is doing (new in v2). Also increases log level of Net::Server + to 4 (debug), adding more yet info (but not too much) (new in v2.20). + ++=item B<--set-envelope-headers> or B<--seh> C<(added after v2.20)> ++ ++Turns on addition of Envelope-To and Envelope-From headers to the mail ++being scanned before it is passed to SpamAssassin. This potentially leaks ++information to all recipients of the mail scanned, namely the list of all ++recipients of that mail (even BCC'ed ones). Therefore usage of this option ++is discouraged. ++I: Even though spampd tries to prevent this leakage by removing the ++Envelope-To header after scanning, SpamAssassin itself might add headers ++itself which report one or more of the recipients which had been listed in ++this header. ++ + =item B<--help> or B<--h> + + Prints usage information. +EOF + +cd $DIR +if [[ "$1" = "-patch" ]]; then + patch --dry-run -p0 -E -t < $TMPFILE && patch -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 +else + if [[ "$1" = "-unpatch" ]]; then + patch --dry-run -R -p0 -E -t < $TMPFILE && patch -R -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 + else + echo "unknown commandline option to dpatch script" + fi +fi +rm $TMPFILE +exit 1 --- spampd-2.20.orig/debian/patches/45-fix-man-references.dpatch +++ spampd-2.20/debian/patches/45-fix-man-references.dpatch @@ -0,0 +1,39 @@ +#! /bin/sh +## fix-man-references.dpatch by Sven Mueller +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix references in man page +set -e + +if [[ "$2" = "" ]]; then + DIR="." +else + DIR="$2" +fi + +TMPFILE=`mktemp` +cat << EOF > $TMPFILE +--- spampd 2004-10-07 03:41:22.000000000 +0200 ++++ spampd 2004-11-13 19:26:15.000000000 +0100 +@@ -1414,5 +1414,5 @@ + + =head1 See Also + +-perl(1), Spam::Assassin(3), L, +-L ++perl(1), Mail::SpamAssassin(3pm), L, ++L, spamassassin(1p) +EOF + +cd $DIR +if [[ "$1" = "-patch" ]]; then + patch --dry-run -p0 -E -t < $TMPFILE && patch -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 +else + if [[ "$1" = "-unpatch" ]]; then + patch --dry-run -R -p0 -E -t < $TMPFILE && patch -R -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 + else + echo "unknown commandline option to dpatch script" + fi +fi +rm $TMPFILE +exit 1 --- spampd-2.20.orig/debian/patches/50-fix-fd-usage.dpatch +++ spampd-2.20/debian/patches/50-fix-fd-usage.dpatch @@ -0,0 +1,43 @@ +#! /bin/sh +## fix-fd-usage.dpatch by Sven Mueller +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix filedescriptor usage: detach stdin/stdout/stderr when backrgounding +## DP: daemon +set -e + +if [[ "$2" = "" ]]; then + DIR="." +else + DIR="$2" +fi + +TMPFILE=`mktemp` +cat << EOF > $TMPFILE +--- spampd 2004-10-07 03:41:22.000000000 +0200 ++++ spampd 2004-11-13 19:20:55.000000000 +0100 +@@ -825,7 +825,9 @@ + syslog_ident => 'spampd', + syslog_facility => 'mail', + background => \$background, +- # setsid => 1, ++ setsid => \$background, # this causes stdin/stderr/stdout to ++ # be opened to /dev/null, cleanly ++ # detaching from current console + pid_file => \$pidfile, + user => \$user, + group => \$group, +EOF + +cd $DIR +if [[ "$1" = "-patch" ]]; then + patch --dry-run -p0 -E -t < $TMPFILE && patch -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 +else + if [[ "$1" = "-unpatch" ]]; then + patch --dry-run -R -p0 -E -t < $TMPFILE && patch -R -p0 -E -t < $TMPFILE && rm $TMPFILE && exit 0 + else + echo "unknown commandline option to dpatch script" + fi +fi +rm $TMPFILE +exit 1 --- spampd-2.20.orig/debian/rules +++ spampd-2.20/debian/rules @@ -0,0 +1,85 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: patch build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/spampd.sgml > spampd.1 + + touch build-stamp + +clean-patched: + dh_testdir + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +clean: clean-patched unpatch + rm -f spampd.orig + +patch: patch-stamp +patch-stamp: + dpatch apply-all + touch patch-stamp + +unpatch: + dpatch deapply-all + rm -rf patch-stamp debian/patched + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/spampd. + $(MAKE) install DESTDIR=$(CURDIR)/debian/spampd + + +# Build architecture-independent files here. +binary-arch: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-indep: build install + dh_testdir + dh_installdocs + dh_installinit + dh_installman + dh_installchangelogs changelog.txt + dh_compress + dh_fixperms + dh_installdeb + dh_perl + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- spampd-2.20.orig/debian/dirs +++ spampd-2.20/debian/dirs @@ -0,0 +1 @@ +usr/sbin --- spampd-2.20.orig/debian/README.Debian +++ spampd-2.20/debian/README.Debian @@ -0,0 +1,27 @@ +spampd for Debian +----------------- + +There is nothing special to note about spampd, configuration takes +place in /etc/default/spampd as far as the network connections are +concerned. +Any more advanced configuration of the SpamAssassin part is done as +usual with SpamAssassin: in /etc/spamassassin/local.cf + +A bug report made me aware that the intended way to use spampd isn't +clear to everyone. +spampd is (like amavisd-new and similar filters) intended to be run +as a _post-queue_ filter in postfix or in a similar way with other +MTAs. However, the following hints might help you to use it as a +pre-queue filter or even in front of your MTA (the later is really +_not_ recommended). + +By default, spampd times out after 5 minutes of no network paket or +after 6 minutes have gone by since start of the SMTP dialogue. The +first parameter isn't directly adjustable, but that shouldn't be a +problem in any case. The second one however can pose a problem for +really slow clients. If you experience such problems (i.e. a client +isn't able to send large mails even though it slowly but steadily +sends data), try passing "--childtimeout=3600" (60 minutes) to +spampd using the ADDOPTS entry in /etc/default/spampd. + + -- Sven Mueller , Mon, 13 Sep 2004 17:00:16 +0200 --- spampd-2.20.orig/debian/changelog +++ spampd-2.20/debian/changelog @@ -0,0 +1,155 @@ +spampd (2.20-9) unstable; urgency=low + + * Fix line duplication introduced by the add-envelope-from_to patch + * Fix a typo in debian/patches/55-add-envelope-from_to.dpatch which + prevented the patch from being applied. (closes: #295590) + - The option to enable addition of envelope headers is -seh or + --set-envelope-headers + * Fix a typo in the package description (closes: #300066) + * remove dh_testroot from build and clean targets. It's only needed + in the install target + + -- Sven Mueller Mon, 21 Mar 2005 21:28:52 +0100 + +spampd (2.20-8) unstable; urgency=high + + * Fix two problems in the patch to add Envelope-To and Envelope-From + headers, which was introduced with the last upload (closes: #292410) + * Add some documentation regarding timeout values do the + debian readme (see also #292064) + * Add a ADDOPTS variable to /etc/default/spampd and use it + in /etc/init.d/spampd to allow passing of additional + commandline arguments to spampd + + -- Sven Mueller Wed, 2 Feb 2005 01:38:55 +0100 + +spampd (2.20-7) unstable; urgency=low + + * Added patch which allows addition of Envelope-To and Envelope-From + headers before passing the message to SpamAssassin (closes: #285531) + * Remove spampd user only when the package is purged, not when removed + * Don't redirect any output (stdout/stderr) from adduser in postinst + script. Use --quiet instead + * Remove spampd.orig (is sometimes created by the dpatch scripts) + in the clean target + + -- Sven Mueller Sat, 1 Jan 2005 18:15:47 +0100 + +spampd (2.20-6) unstable; urgency=low + + * Allow configuration of the syslog destination + via /etc/default/spampd (INET socket or UNIX socket) + * Switch default syslog destination to UNIX because Debian + standard configuration of syslogd doesn't allow logging + via INET socket. + + -- Sven Mueller Sun, 12 Dec 2004 01:12:00 +0100 + +spampd (2.20-5) unstable; urgency=low + + * Added martin f. krafft as a co-maintainer on his request + * Depend on dpkg >= 1.10.23 (closes: #281101) + * pass setsid -> 1 to Net::Server when backgrounded + thereby closing stdin/stdout/stderr when daemonized + * don't redirect stdin/stdout/stderr on start-stop-daemon + in initscript (not needed anymore due to previous fix) + * Fix a minor mistake in debian/README.debian + * Moved over to dpatch for patch handling + * Replace Build-Depends with more appropriate + Build-Depends-Indep + + -- Sven Mueller Tue, 16 Nov 2004 18:54:51 +0100 + +spampd (2.20-4) unstable; urgency=low + + * Fixed postinst and prerm scripts to suppress adduser/deluser + output. It just doesn't say anything important anyway. + * Suppress start-stop-daemon output on "/etc/init.d/spampd stop" + if the daemon is disabled in /etc/default/spampd. + + -- Sven Mueller Sun, 10 Oct 2004 19:56:33 +0200 + +spampd (2.20-3) unstable; urgency=low + + * Fixed up the init script to some degree + * Changed init script to use start-stop-daemon instead of handling + everything manually + + -- Sven Mueller Sat, 9 Oct 2004 12:55:57 +0200 + +spampd (2.20-2) unstable; urgency=low + + * Fixed a bug in preinst script which caused the spampd user not + to be added + * Added check after adding the user wether or not the user now + exists. Fail preinst script if it doesn't exist + * Upstream changed version number without significant source + changes, to fix upgrade problems because of 2.2 being smaller + than 2.12 + + -- Sven Mueller Fri, 8 Oct 2004 02:00:23 +0200 + +spampd (2.2-1) unstable; urgency=low + + * Updated to new upstream release + * Now supports spamassassin 2.6 again + + -- Sven Mueller Wed, 6 Oct 2004 13:28:17 +0200 + +spampd (2.12-8) unstable; urgency=low + + * Update control file to Standards version 3.6.1.1 + * Corrected problems in package description + * Modified init script to accept yes/true/enable/1 to + enable an option in /etc/default/spampd + * Sponsored by martin f. krafft + (closes: Bug#220007). + + -- Sven Mueller Tue, 5 Oct 2004 18:52:09 +0200 + +spampd (2.12-7) unstable; urgency=low + + * Patched spampd to work with SpamAssassin version 3 + (This breaks compatibility with SpamAssassin version 2!) + * Changed dependecy on SpamAssassin from << 3 to >= 3 + + -- Sven Mueller Wed, 29 Sep 2004 19:49:07 +0200 + +spampd (2.12-6) unstable; urgency=low + + * Added a < 3 to the SpamAssassin dependency + + -- Sven Mueller Wed, 26 Sep 2004 19:49:07 +0200 + +spampd (2.12-5) unstable; urgency=low + + * Made the init script full LSB 2.0 compliant + + -- Sven Mueller Thu, 25 Sep 2004 13:09:17 +0200 + +spampd (2.12-4) unstable; urgency=low + + * Fixed a typo in the init script which made it ignore various + /etc/default/spampd settings + + -- Sven Mueller Wed, 24 Sep 2004 19:53:07 +0200 + +spampd (2.12-3) unstable; urgency=low + + * Removed default html documentation file and added make rule + to generate it freshly from the perl file (pod2html). + + -- Sven Mueller Mon, 15 Sep 2004 19:49:07 +0200 + +spampd (2.12-2) unstable; urgency=low + + * Added manpages + + -- Sven Mueller Mon, 14 Sep 2004 18:48:23 +0200 + +spampd (2.12-1) unstable; urgency=low + + * Initial Release. + + -- Sven Mueller Mon, 13 Sep 2004 17:00:16 +0200 + --- spampd-2.20.orig/debian/compat +++ spampd-2.20/debian/compat @@ -0,0 +1 @@ +4 --- spampd-2.20.orig/debian/control +++ spampd-2.20/debian/control @@ -0,0 +1,31 @@ +Source: spampd +Section: mail +Priority: optional +Maintainer: Sven Mueller +Build-Depends-Indep: debhelper (>= 4.0.0), dpatch +Standards-Version: 3.6.1.1 +Uploaders: martin f. krafft + +Package: spampd +Architecture: all +Depends: ${perl:Depends}, spamassassin (>= 2.6), libnet-server-perl, adduser (>= 3.59), coreutils, dpkg (>= 1.10.23) +Description: spamassassin based SMTP/LMTP proxy daemon + spampd is an SMTP/LMTP server designed to be hooked into the + MTA processing chain (e.g. as a content filter). It is + written in Perl and uses the Net::Server framework. It is + intended to provide spam filtering at the system level (i.e. + ususally for all users). If you rely on per-user configuration + or per-user Bayes databases, spampd is not for you. + . + The major advantage of spampd over plain SpamAssassin (both + directly and through spamd) is that it doesn't need to load + all needed perl modules on every invocation or spawn + a C programme for every mail it receives. Compared to using + spamc/spamd, spampd can usually provide a 25% performance + with local-only tests. + . + The advantage of spampd over amavisd-new is that it uses the + original SpamAssassin header tags, which are more verbose than + the tags which amavisd-new provides. This allows easier + filtering in the mail client and easier tuning of SpamAssassin. + --- spampd-2.20.orig/debian/copyright +++ spampd-2.20/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Sven Mueller on +Mon, 13 Sep 2004 17:00:16 +0200. + +It was downloaded from http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm + +Upstream Author: Maxim Paperno + +Copyright: + +spampd is Copyright © 2002 by World Design Group Inc. and Maxim Paperno + +Portions are Copyright © 2001 Morgan Stanley Dean Witter as mentioned +in the CREDITS section at: http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm + +This program 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. + +The GNU GPL can be found at http://www.fsf.org/copyleft/gpl.html +or at /usr/share/common-licenses/GPL --- spampd-2.20.orig/debian/spampd.default +++ spampd-2.20/debian/spampd.default @@ -0,0 +1,49 @@ +# Defaults file for spampd, the spam proxy daemon +# (spampd is using spamassassin to scan mails) + +# On boolean options, 0 means off/no/false, 1 means on/yes/true + +# Wether or not to start spampd (0/1) +STARTSPAMPD=0 + +# where to put the PID file +PIDFILE=/var/run/spampd.pid + +# The IP to listen on +LISTENHOST=127.0.0.1 + +# The port to listen on +LISTENPORT=10025 + +# The host to forward the connection to +DESTHOST=127.0.0.1 + +# The port to forward the connection to +DESTPORT=10026 + +# How many parallel checks can be done in parallel +CHILDREN=3 + +# user ID to run as +USERID=spampd + +# group ID to run as +GRPID=spampd + +# Wether or not to tag all messages (0/1) +TAGALL=1 + +# Wether or not to use auto-whitelisting (0/1) +AUTOWHITELIST=1 + +# Wether or not to do only local checks +# if this is turned on, no network based checks +# (like DNS-Blacklists) are done. (0/1) +LOCALONLY=0 + +# Wether to prefer INET (network) for syslog logging +# instead of UNIX (unix domain socket) (0/1) +LOGINET=0 + +# Any additional parameters you want to pass to spampd +ADDOPTS="" --- spampd-2.20.orig/debian/spampd.init +++ spampd-2.20/debian/spampd.init @@ -0,0 +1,160 @@ +#!/bin/sh -e +# +# spampd SpamPD is a spamdetection proxy daemon for SMTP and LMTP +# +# This script was written for debian +# by Sven Mueller +# +# Version: 1.0 13-Sep-2004 debian@incase.de + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin +DESC='spam checking proxy daemon' +NAME='spampd' +PROGRAM=/usr/sbin/spampd +#EXECUTABLE=`head -n 1 $PROGRAM | sed -e 's,^#![ ]*/,/,;s,[ ].*$,,'` +EXECUTABLE=/usr/bin/perl +PIDFILE=/var/run/spampd.pid + +# set some important defaults (overridable via /etc/default/spampd) +USERID=spampd +GRPID=spampd + +if [[ -f /etc/default/$NAME ]]; then + . /etc/default/$NAME +fi + +function istrue () { + ANS=$(echo $1 | tr A-Z a-z) + [[ "$ANS" = 'yes' || "$ANS" = 'true' || "$ANS" = 'enable' || "$ANS" = '1' ]] +} + +# +# find out wether to start spampd or not +# +istrue ${STARTSPAMPD} && STARTSPAMPD='true' + +# +# Check wether the program is actually there +# +[[ -x $PROGRAM ]] || exit 0 + +# +# Calculate final commandline +# +S_TAGALL='' +S_AWL='' +S_LOCALONLY='' + +istrue "$TAGALL" \ +&& S_TAGALL='--tagall' + +istrue "$AUTOWHITELIST" \ +&& S_AWL='--auto-whitelist' + +istrue "$LOCALONLY" \ +&& S_LOCALONLY='--L' + +istrue "$LOGINET" \ +&& LOGTARGET="inet" \ +|| LOGTARGET="unix" + +ARGS="${S_LOCALONLY} ${S_AWL} ${S_TAGALL} " + +[[ -n "${LISTENPORT}" ]] && ARGS="${ARGS} --port=${LISTENPORT}" + +[[ -n "${LISTENHOST}" ]] && ARGS="${ARGS} --host=${LISTENHOST}" + +[[ -n "${DESTPORT}" ]] && ARGS="${ARGS} --relayport=${DESTPORT}" + +[[ -n "${DESTHOST}" ]] && ARGS="${ARGS} --relayhost=${DESTHOST}" + +[[ -n "${PIDFILE}" ]] && ARGS="${ARGS} --pid=${PIDFILE}" + +[[ -n "${CHILDREN}" ]] && ARGS="${ARGS} --children=${CHILDREN}" + +[[ -n "${USERID}" ]] && ARGS="${ARGS} --user=${USERID}" + +[[ -n "${GRPID}" ]] && ARGS="${ARGS} --group=${GRPID}" + +[[ -n "${LOGTARGET}" ]] && ARGS="${ARGS} --logsock=${LOGTARGET}" + +[[ -n "${ADDOPTS}" ]] && ARGS="${ARGS} ${ADDOPTS}" + +function check_pid () { + [[ "$3" == "verbose" ]] && VERBOSE=1 + if [[ -f $2 ]]; then + kill -0 `cat $2` >& /dev/null + RETVAL=$? + if [[ "$RETVAL" = "0" ]]; then + [[ "$VERBOSE" ]] && echo "$1 is running as `cat $2`" + return 0 + else + [[ "$VERBOSE" ]] && echo "PIDFILE $2 for $1 exists, but $1 is not running." + rm $2 + return 1 + fi + else + [[ "$VERBOSE" ]] && echo "PIDFILE $2 for $1 doesn't exists." + return 4 + fi +} + +case "$1" in + start) + if ! istrue "${STARTSPAMPD}"; then + echo "Starting $DESC: $NAME (disabled in /etc/default/$NAME)." + exit 0 + fi + echo -n "Starting $DESC: $NAME" + # if pidfile exists, but no matching process, remove PIDFILE + check_pid spampd $PIDFILE || /bin/true + # start daemon + start-stop-daemon --start --exec $EXECUTABLE \ + --startas $PROGRAM --pidfile $PIDFILE \ + --user $USERID --group $GRPID -- $ARGS + if [[ "$?" == '0' ]]; then + echo '.' + exit 0 + else + echo '' + exit 1 + fi + ;; + stop) + echo -n "Stopping $DESC: $NAME " + set +e + if istrue "$STARTSPAMPD" ; then + start-stop-daemon --stop --exec $EXECUTABLE \ + --pidfile $PIDFILE + else + start-stop-daemon --stop --exec $EXECUTABLE \ + --pidfile $PIDFILE >& /dev/null + fi + if [[ "$?" = "0" ]]; then + echo '.' + rm $PIDFILE + exit 0 + else + echo '' + exit 4 + fi + ;; + status) + check_pid $PROGRAM $PIDFILE verbose + exit $? + ;; + force-reload|try-restart) + check_pid $PROGRAM $PIDFILE && exec $0 restart \ + || echo "$DESC is not running. Try '$0 start' to start it." + ;; + restart) + check_pid $PROGRAM $PIDFILE && $0 stop + exec $0 start + ;; + *) + echo "Usage: $0 (start|stop|restart|try-restart|force-reload|status)" + ;; + +esac + +exit 0 --- spampd-2.20.orig/debian/spampd.postinst +++ spampd-2.20/debian/spampd.postinst @@ -0,0 +1,13 @@ +#!/bin/sh -e + +case "$1" in + configure|install|upgrade) + adduser --system --group \ + --no-create-home --home /nonexistent \ + --quiet spampd + ;; + *) + ;; +esac + +#DEBHELPER# --- spampd-2.20.orig/debian/spampd.prerm +++ spampd-2.20/debian/spampd.prerm @@ -0,0 +1,12 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + purge) + deluser spampd > /dev/null 2>&1 || true + delgroup spampd > /dev/null 2>&1 || true + ;; + *) + ;; +esac --- spampd-2.20.orig/debian/watch +++ spampd-2.20/debian/watch @@ -0,0 +1,7 @@ +# Example watch control file for uscan +version=2 +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +#sunsite.unc.edu /pub/Linux/Incoming spampd-(.*)\.tar\.gz debian uupdate +http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm .*\/spampd\/spampd-([\d\.]*).tar.gz debian uupdate --- spampd-2.20.orig/spampd +++ spampd-2.20/spampd @@ -825,7 +825,9 @@ syslog_ident => 'spampd', syslog_facility => 'mail', background => $background, - # setsid => 1, + setsid => $background, # this causes stdin/stderr/stdout to + # be opened to /dev/null, cleanly + # detaching from current console pid_file => $pidfile, user => $user, group => $group,