debian/0000755000000000000000000000000012151755715007177 5ustar debian/rules0000755000000000000000000000057012151755715010261 0ustar #!/usr/bin/make -f PACKAGE = $(shell dh_listpackages) TMP = $(CURDIR)/debian/$(PACKAGE) %: dh $@ override_dh_auto_install: dh_auto_install # Special manpage handling for bin/courier-filter-perl: pod2man -s8p bin/courier-filter-perl $(TMP)/usr/share/man/man8/courier-filter-perl.8p override_dh_perl: dh_perl /usr/bin /usr/lib /usr/share/courier-filter-perl/perl5 debian/control0000644000000000000000000000451512151755715010607 0ustar Source: courier-filter-perl Maintainer: Debian Perl Group Uploaders: gregor herrmann Section: mail Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl Standards-Version: 3.9.4 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/courier-filter-perl.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/courier-filter-perl.git Homepage: https://metacpan.org/release/Courier-Filter/ Package: courier-filter-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, courier-mta, liberror-perl Recommends: libarchive-zip-perl, libclamav-client-perl, libio-stringy-perl, libmail-spamassassin-perl, libmail-spf-perl, libmime-tools-perl, libnet-rblclient-perl Suggests: libnet-address-ip-local-perl Description: purely Perl-based mail filter framework for the Courier MTA Courier::Filter implements the Courier MTA's courierfilter interface as a framework for mail filter modules. Authors of filter modules can concentrate on writing the actual filter logic without having to care about the usual low-level details of the courierfilter interface. Logging to various facilities is also supported. . Courier::Filter allows multiple filter modules to be installed in stacked and hierarchically grouped configurations. Also, modules' polarity can be reversed, so some modules can be used for explicitly accepting messages while others are used in the traditional way for rejecting messages. . The following filter modules are included: * BlankBody: matching of blank bodies (a stupid spammer symptom) * DNSBL: matching of calling MTA's IP address against DNS black-lists * SPF: authentication of sender addresses in inbound messages * SPFout: authentication of sender addresses in outbound messages * Envelope: matching of RFC 2821 message envelope fields * Header: matching of RFC 2822 message header fields * FakeDate: detection of implausible and malformed date header fields * ClamAVd: malware detection using the ClamAV scanner * SpamAssassin: spam detection using SpamAssassin * Parts: matching of MIME parts and ZIP archive contents * SendCopy: sending message copies to additional recipients debian/courier-filter-perl.postinst0000755000000000000000000000235112151755715014703 0ustar #!/bin/sh set -e mode=$1 # Move a conffile without triggering a dpkg question mv_conffile() { OLDCONFFILE="$1" NEWCONFFILE="$2" if [ -e "$OLDCONFFILE" ]; then echo "Preserving user changes in $OLDCONFFILE to $NEWCONFFILE ..." mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new mv -f "$OLDCONFFILE" "$NEWCONFFILE" fi } # Move a conffile to a non-conffile mv_conffile_to_noncf() { OLDCONFFILE="$1" NEWCONFFILE="$2" if [ -e "$OLDCONFFILE" ]; then echo "Preserving user changes in $OLDCONFFILE to $NEWCONFFILE ..." mv -f "$OLDCONFFILE" "$NEWCONFFILE" fi } case "$mode" in configure ) old_version=$2 config_file=/etc/courier/filters/courier-filter-perl.conf if dpkg --compare-versions "$old_version" lt "0.200"; then # Preserve customized old config file, if any: mv_conffile_to_noncf /etc/courier/filters/pureperlfilter.conf $config_file fi if [ ! -e $config_file ]; then # No config file exists, create one: cp /usr/share/courier-filter-perl/courier-filter-perl.conf.bare $config_file fi echo "Starting courier-filter-perl mail filter ..." filterctl start courier-filter-perl ;; esac #DEBHELPER# debian/courier-filter-perl.preinst0000755000000000000000000000171712151755715014511 0ustar #!/bin/sh set -e mode=$1 # Prepare to move a conffile without triggering a dpkg question prep_mv_conffile() { PKGNAME="$1" CONFFILE="$2" if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" if [ "$md5sum" = "$old_md5sum" ]; then rm -f "$CONFFILE" fi fi } case "$mode" in install | upgrade ) old_version=$2 if dpkg --compare-versions "$old_version" lt "0.200"; then pureperlfilter_link=/etc/courier/filters/active/pureperlfilter if [ -h $pureperlfilter_link ]; then echo "Disabling pureperlfilter mail filter ..." rm $pureperlfilter_link courierfilter restart fi prep_mv_conffile courier-filter-perl /etc/courier/filters/pureperlfilter.conf fi ;; esac #DEBHELPER# debian/source/0000755000000000000000000000000012151755715010477 5ustar debian/source/format0000644000000000000000000000001412151755715011705 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000003430312151755715011054 0ustar courier-filter-perl (0.200+ds-2) unstable; urgency=low [ Salvatore Bonaccorso ] * Change Vcs-Git to canonical URI (git://anonscm.debian.org) * Change search.cpan.org based URIs to metacpan.org based URIs [ gregor herrmann ] * Update debian/repack.stub. * Install sample config to /usr/share/courier-filter-perl and use this location in the postinst. Thanks to Andreas Beckmann for the bug report. (Closes: #710416) * debian/copyright: switch formatting to Copyright-Format 1.0. Update years of packaging copyright. Add info about debian/repack.stub. * Set Standards-Version to 3.9.4 (no changes). -- gregor herrmann Fri, 31 May 2013 01:07:05 +0200 courier-filter-perl (0.200+ds-1) unstable; urgency=low * Take over for the Debian Perl Group on request of the MIA team. * debian/control: Added: Vcs-Git field (source stanza); Vcs-Browser field (source stanza); Homepage field (source stanza); ${misc:Depends} to Depends: field. Changed: Maintainer set to Debian Perl Group (was: Julian Mehnle ). * Add debian/watch. * Switch to "3.0 (quilt)" source format. * Switch to debhelper compatibility level 8, use tiny debian/rules. * Explicitly "set -e" in maintainer scripts. * Make package non-native, and add repackaging framework to remove debian dir/ shipped in upstream tarball. * Add a patch to fix a POD glitch. * debian/copyright: use DEP5 formatting. * Add /me to Uploaders. * Bump Standards-Version to 3.9.2 (no changes); remove version from perl build dependency. * Remove version from packages in Recommends that are already satisfied in oldstable. -- gregor herrmann Tue, 27 Dec 2011 20:55:35 +0100 courier-filter-perl (0.200) unstable; urgency=low Debian: + New upstream version. (Closes: #344173) + Automatically start and stop courier-filter-perl using Courier's `filterctl` post-installation and pre-removal, respectively. ! "courier-filter-perl.conf" (previously "pureperlfilter.conf") config file is no longer a conffile managed by dpkg. Migrate seamlessly. ! Install courier-filter-perl executable into /usr/lib/courier/filters/ rather than /usr/lib/. > control: * Section: mail (was: perl) * Standards-Version: 3.7.3 * Raised debhelper compat level to 5 / Build-Depends: debhelper (>= 5) * Build-Depends: debhelper (was: Build-Depends-Indep:) * Removed Build-Depends-Indep: libtest-simple-perl (now provided by perl-modules) * Recommends: libmail-spf-perl (was: libmail-spf-query-perl) * Recommends: libnet-rblclient-perl, libclamav-client-perl (was: Suggests:) * Removed Recommends: libdigest-md5-perl (now provided by perl) * Removed Recommends: libnet-dns-perl (unused) * Suggests: libnet-address-ip-local-perl (was: libnet-address-ipv4-local-perl) > rules: * Run `$(BUILD) distclean` only if $(BUILD) actually exists. Courier::Filter: ! Config file has been renamed to "courier-filter-perl.conf" from "pureperlfilter.conf". Courier::Message: * Fixed a bug that caused crashes when encountering invalid (e.g., non-ASCII) characters in raw MIME encoded words. * Fixed fallback decoding of raw message headers from non-ASCII, non-UTF-8 encodings such as ISO-8859-1. Previously, any non-UTF-8 byte sequences would be decoded as the "�" Unicode substitution character. Now this case properly falls back to reinterpreting the entire header as Windows- 1252. Note: In the absence of the experimental "UTF8SMTP" SMTP extension, non-ASCII characters are formally illegal in raw message headers, so this really only affects exceptional cases. * Eliminated some corner case "Use of uninitialized value" warnings. Courier::Config: * Lower-cased and slightly adjusted constant/method names. Compatibility aliases for the old names are provided. + Added courier_executable() and courier_version() methods. See man-page. Courier::Util: + Added as a utility module for use by other modules of the Courier::Filter framework. Courier::Filter::Module: + Added warn() method for writing warning messages to syslog. DNSBL filter module: * Ignore messages received via IPv4/IPv6 loopback addresses (i.e., self submissions). SPF filter module: * Use Mail::SPF instead of the old Mail::SPF::Query. Added new "spf_options" option with options for Mail::SPF::Server. + The switch to Mail::SPF brings IPv6 support! + Support both MAIL FROM and HELO checks separately. ! Deprecated "fallback_guess" and "trusted_forwarders" options in favor of the "default_policy" and "tfwl" keys to the "spf_options" option. The old options induce a warning when specified but are still supported for now. Due to the move from the obsolete Mail::SPF::Query module to the Mail::SPF, the (yet unreleased) Mail::SPF::BlackMagic extension module is now required when using these non-standard options. ! Deprecated the "unknown" and "error" SPF result codes in favor of the new "permerror" and "temperror" ones defined in RFC 4408. The old result codes induce a warning when specified in the "match_on" option but are still supported for now. * Ignore messages with an empty identity of the configured scope (esp. empty MAIL FROM, i.e., bounces) or with an identity in the form of an IP address literal ("[]"). SPFout filter module: * Use Mail::SPF instead of the old Mail::SPF::Query. Added new "spf_options" option with options for Mail::SPF::Server. * Use the IPv6-supporting Net::Address::IP::Local rather than the IPv4-only Net::Address::IPv4::Local module for auto-discovery of the local system's outbound IP addresses. Note that auto-discovery does not work from behind NATs, in which case outbound IP addresses must be configured manually using the "outbound_ip_addresses" option. + The switch to Mail::SPF and Net::Address::IP::Local brings IPv6 support! ! Deprecated the "unknown" and "error" SPF result codes in favor of the new "permerror" and "temperror" ones defined in RFC 4408. The old result codes induce a warning when specified in the "match_on" option but are still supported for now. * Ignore messages with an empty identity of the configured scope (esp. empty MAIL FROM, i.e., bounces) or with an identity in the form of an IP address literal ("[]"). SpamAssassin filter module: + Added a "prefs_file" option for easy configuration of Courier::Filter specific SpamAssassin preferences. SpamAssassin now will not read any preferences besides its default configuration files unless this option is specified. * Eliminated memory leak by properly cleaning up Mail::SpamAssassin::Message objects. BlankBody filter module: + Added for matching blank message bodies (a stupid spammer symptom). FakeDate filter module: + Added for matching implausible and malformed date header fields. SendCopy filter module: + Added for sending message copies to additional recipients. -- Julian Mehnle Sun, 23 Mar 2008 00:36:39 +0000 courier-filter-perl (0.17) unstable; urgency=low Debian: * Recommends: libmime-perl, not libmime-tools-perl. (Closes: #297730) * Recommends: libio-stringy-perl (>= 2.110), libmail-spamassassin-perl, libarchive-zip-perl. Courier::Filter: * If socket already exists, check whether it is dead or alive. If it is dead, remove it and start up normally. If it is alive, die like before. (Closes: #326785) * Ignore connections that don't send any data. Courier::Message: * Decode header text as "UTF-8" encoded, not as "utf8" encoded. Starting with Perl 5.8.7, this does make a difference. "utf8" allows invalid Unicode codepoints (such as UTF-16 surrogates), while "UTF-8" (the official standard UTF-8) doesn't. We want to avoid invalid codepoints because they tend to cause trouble later. * Don't die on invalid characters in encoded-word chunks. If an encoded-word cannot be decoded, retain it undecoded. * "authenticated" property: refined parsing of "Received:" header and "AUTH:" authentication information. * Added "authenticated_user" property. * Corrected documentation of "header" property. SPFout filter module: * Don't be pedantic about what our "public" IPv4 address is vis-à-vis the various recipient MXes. Assume we just have a single public address that applies to all recipient MXes. (Let's see if anyone out there actually has a more complex setup...) Parts filter module: * Requires libio-stringy-perl (>= 2.110), libarchive-zip-perl. SpamAssassin filter module: * Added for SpamAssassin-based spam detection. * Requires libmail-spamassassin-perl. Miscellaneous: * Relaxed sender IPv4 address matching in DNSBL, SPF, and SPFout filter modules, making the "::ffff:" IPv6 prefix optional and thus supporting IPv6-disabled versions of Courier. * Courier::Filter::Overview: Updated mention of pythonfilter from version 0.5 to 0.8. * README: Added license statement. * Minor documentation fixes. -- Julian Mehnle Fri, 11 Nov 2005 03:00:00 +0000 courier-filter-perl (0.16) unstable; urgency=low Debian: * Explicitly specify the dependency on Perl 5.8 so upgrades from Woody are guaranteed to work smoothly and also to simplify backporting. (Closes: #289796) * Recommend libnet-dns-perl. Suggest libnet-rblclient-perl, libnet-address-ipv4-local-perl, and libclamav-client-perl (all of which are not yet packaged for Debian). SPF filter module: * Deprecated the "reject_on" option in favor of the new "match_on" option. * Removed "none" from the default set of result codes to match on. * Changed the documentation to recommend also rejecting on "unknown" results. * Added a reference in the documentation to the spf-draft-200406 specification, to which this module complies. SPFout filter module: * Added for outbound SPF filtering. ClamAVd filter module: * Added for malware filtering using a ClamAV `clamd` dameon. Miscellaneous: * Updated the sample configuration file. * Minor documentation fixes. -- Julian Mehnle Mon, 17 Jan 2005 20:15:13 +0100 courier-filter-perl (0.15) unstable; urgency=low * Courier::Filter is primarily a plug-in for the Courier MTA, not a library of Perl modules intended to be used by other programs or modules. - Renamed package to "courier-filter-perl". - Install included Perl modules in the private path /usr/share/courier-filter-perl/perl5 instead of the standard path /usr/share/perl5. * Added liberror-perl dependency. * Made Build-Depends dependencies into Build-Depends-Indep (architecture independent) dependencies. * Various minor fixes. -- Julian Mehnle Sat, 30 Oct 2004 02:52:47 +0200 libcourier-filter-perl (0.14) unstable; urgency=low * Added documentation for the test-filter-module and pureperlfilter executables. * test-filter-module: - Fixed the command-line parsing and handling of control file names. - Made the result output format compatible with multi-line results. -- Julian Mehnle Fri, 22 Oct 2004 02:16:18 +0200 libcourier-filter-perl (0.13) unstable; urgency=low * Initial Debian release. * Deprecated the MIMEParts filter module in favor of the new Parts filter module, which is compatible but a lot more powerful: - Switched from completely-in-memory processing to using temporary files in order to work around two nasty bugs in MIME::Parser and Archive::Zip. - Renamed the "max_size" constructor option to "max_message_size". "max_size" is deprecated but still supported for now. - The "max_size" constructor option now defaults to 1024**2 (1MB) instead of undef. - Added the "max_part_size" constructor option. - Added "views" support (as constructor option and signature aspect), supporting "raw" and "zip" views for now. - Added the "encrypted" signature aspect. * Added Envelope filter module. * Added etc/pureperlfilter.conf as a default configuration file. * Fixed the mysterious ``Can't call method "close" on an undefined value at Filter.pm line 299´´ bug that caused Courier::Filter to fail starting up on some platforms. (File descriptor 3 must be opened in write mode, not in read mode!) * Fixed filter module group handling: - Skip the rest of the current module group and treat it as an implicit accept if a module in the group states an explicit accept. - Log rejections just once, right after a module has stated a reject, i.e. avoid logging the rejection for all higher recursion levels of the module group structure that contains the rejecting module. - Don't try extracting a logger from filter module groups, only from atomic filter modules. * Fixed the Header filter module: - Fixed handling of undefined header fields. - Prepend a "Header:" keyword to positive match results. * Disabled timestamping for the Syslog logger module, as syslog does its own timestamping. * Reworked configuration file example. * Refined Build.PL script. * Lots of minor documentation fixes. -- Julian Mehnle Tue, 4 Oct 2004 21:42:42 +0200 libcourier-filter-perl (0.12) unstable; urgency=low * chmod the courierfilter socket to 0660, so the Courier daemon system group has write access to the socket. This solves the "sendmail: Unable to submit message" permissions problem that occurred on some platforms. * Make Module::Build automatically create a Makefile.PL to facilitate auto-installation through the CPAN interface. -- Julian Mehnle Tue, 1 Oct 2004 21:42:42 +0200 libcourier-filter-perl (0.11) unstable; urgency=low * Lots of minor documentation fixes. -- Julian Mehnle Tue, 1 Oct 2004 21:42:42 +0200 libcourier-filter-perl (0.10) unstable; urgency=low * Initial Release. -- Julian Mehnle Mon, 26 Feb 2004 23:00:00 +0200 debian/compat0000644000000000000000000000000212151755715010375 0ustar 8 debian/courier-filter-perl.install0000644000000000000000000000017012151755715014460 0ustar bin/courier-filter-perl usr/lib/courier/filters/ examples/courier-filter-perl.conf.bare usr/share/courier-filter-perl/ debian/courier-filter-perl.dirs0000644000000000000000000000002312151755715013750 0ustar usr/share/man/man8 debian/patches/0000755000000000000000000000000012151755715010626 5ustar debian/patches/series0000644000000000000000000000001612151755715012040 0ustar fix-pod.patch debian/patches/fix-pod.patch0000644000000000000000000000075212151755715013221 0ustar Description: pod2man doesn't like the comment before an item; let's start the enumeration later Origin: vendor Forwarded: no Author: gregor herrmann Last-Update: 2011-12-27 --- a/lib/Courier/Filter/Logger/IOHandle.pm +++ b/lib/Courier/Filter/Logger/IOHandle.pm @@ -104,8 +104,6 @@ The following instance methods are provided: -=over - =begin comment =item B: throws Perl exceptions @@ -116,6 +114,8 @@ =end comment +=over + =cut sub log { debian/courier-filter-perl.postrm0000755000000000000000000000020412151755715014337 0ustar #!/bin/sh set -e mode=$1 case "$mode" in purge ) rm /etc/courier/filters/courier-filter-perl.conf ;; esac #DEBHELPER# debian/copyright0000644000000000000000000000231312151755715011131 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Courier-Filter Upstream-Contact: Julian Mehnle Source: https://metacpan.org/release/Courier-Filter/ Files: * Copyright: 2003-2008, Julian Mehnle License: Artistic or GPL-2+ Files: debian/* Copyright: 2004, 2005, 2008, Julian Mehnle 2011-2013, gregor herrmann License: Artistic or GPL-2+ Files: debian/repack.stub Copyright: 2009, Ryan Niebur License: Artistic or GPL-2+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-2+ 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, or (at your option) any later version. . On Debian systems, the complete text of version 2 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. debian/repack.local0000644000000000000000000000004112151755715011453 0ustar SUFFIX=+ds MANIFEST=1 rm debian debian/courier-filter-perl.prerm0000755000000000000000000000027112151755715014144 0ustar #!/bin/sh set -e mode=$1 case "$mode" in remove | upgrade ) echo "Stopping courier-filter-perl mail filter ..." filterctl stop courier-filter-perl ;; esac #DEBHELPER# debian/courier-filter-perl.links0000644000000000000000000000020712151755715014133 0ustar /usr/share/courier-filter-perl/courier-filter-perl.conf.bare /usr/share/doc/courier-filter-perl/examples/courier-filter-perl.conf.bare debian/watch0000644000000000000000000000026712151755715010235 0ustar version=3 opts=dversionmangle=s/\+ds// \ https://metacpan.org/release/Courier-Filter/ .+/Courier-Filter-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ \ debian sh debian/repack.stub debian/repack.stub0000755000000000000000000000346412151755715011355 0ustar #!/bin/sh : <<=cut =pod =head1 NAME repack.stub - script to repack upstream tarballs from uscan =head1 INSTRUCTIONS put this in debian/repack.stub and add "debian sh debian/repack.stub" to the end of the line in debian/watch. you will also need to add a version mangle to debian/watch. then create a debian/repack.local. this is a shell script that is sourced under "set -e", so be careful to check returns codes. =head1 FUNCTIONS =over 4 =item rm rm is replaced by a function that does some magic ("rm -rv" by default), but also changes MANIFEST if $MANIFEST is 1 =item mv mv is replaced by a function that just does mv (by default), but also changes MANIFEST if $MANIFEST is 1 =item requires_version requires_version is there for future usage for requiring certain versions of the script =back =head1 VARIABLES =over 4 =item SUFFIX defaults to +dfsg what to append to the upstream version =item RM_OPTS defaults to -vrf options to pass to rm =item MANIFEST defaults to 0, set to 1 to turn on. this will manipulate MANIFEST files in CPAN tarballs. =item UP_BASE this is the directory where the upstream source is. =back =head1 COPYRIGHT AND LICENSE Copyright 2009, Ryan Niebur License: Artistic or GPL-1+ =cut if [ -z "$REPACK_SH" ]; then if [ -f ../../scripts/repack.sh ]; then REPACK_SH=../../scripts/repack.sh fi if [ -z "$REPACK_SH" ] && which repack.sh > /dev/null; then REPACK_SH=$(which repack.sh) fi fi if [ ! -f "$REPACK_SH" ]; then echo "Couldn't find a repack.sh. please put it in your PATH, put it at ../../scripts/repack.sh, or put it somewhere else and set the REPACK_SH variable" echo "You can get it from http://anonscm.debian.org/gitweb/?p=pkg-perl/scripts.git;a=blob_plain;f=repack.sh;hb=HEAD" exit 1 fi exec "$REPACK_SH" "$@" debian/courier-filter-perl.examples0000644000000000000000000000001312151755715014624 0ustar examples/*