trunk/postfix-policyd-spf-perl

* use version;
* Bumped version number to 1.08.1.
* Purely cosmetic code clean-up.
* Added svn properties:
  svn:mime-type = text/x-perl
  svn:keywords  = "Author Date Id Rev URL"
  svn:eol-style = native

trunk/README
* Bumped version number to 1.08.1.
* Added Scott Kitterman to copyright statement.
* Updated website URL.

trunk/INSTALL
* Added version Perl module to list of run-time requirements.

trunk/INSTALL
trunk/LICENSE
* Added svn properties:
  svn:mime-type = text/plain
  svn:keywords  = "Author Date Id Rev URL"
  svn:eol-style = native

trunk/CHANGES
trunk/debian/changelog
* Described changes for 1.08.1 release.

trunk/debian/control
* New maintainer: Scott Kitterman <scott@kitterman.com>
* Priority: extra (was: optional)
* Removed Build-Depends-Indep: perl, as there really is no need for it.
* Depends: libversion-perl

trunk/debian/copyright
* Updated for 1.08.1 release.
This commit is contained in:
Julian Mehnle 2007-01-10 20:00:57 +00:00
commit 01e939ac3d
7 changed files with 130 additions and 88 deletions

16
CHANGES
View file

@ -4,6 +4,22 @@
# ! = Changed something significant, or removed a feature # ! = Changed something significant, or removed a feature
# * = Fixed a bug, or made a minor improvement # * = Fixed a bug, or made a minor improvement
--- 1.08.1 (2007-01-10 21:00)
postfix-policyd-spf-perl:
* Minor and purely cosmetic code clean-up.
Miscellaneous:
* Updated README file with new website URL and copyright.
* Added LICENSE file as an explicit copy of the GPLv2.
Debian:
* New maintainer: Scott Kitterman <scott@kitterman.com>
* Priority: extra (was: optional)
* Removed Build-Depends-Indep: perl, as there really is no need for it.
* Depends: libversion-perl
* Updated debian/copyright.
--- 1.08 (2006-06-17 20:00) --- 1.08 (2006-06-17 20:00)
* Added Debian package control files. * Added Debian package control files.

View file

@ -5,6 +5,7 @@ The following Perl version and packages are required for running
postfix-policyd-spf-perl: postfix-policyd-spf-perl:
Perl 5.6 Perl 5.6
version
Mail::SPF::Query Mail::SPF::Query
Installing Installing
@ -30,5 +31,5 @@ Installing
4. Restart Postfix. 4. Restart Postfix.
# $Id: README 167 2005-01-17 18:26:45Z julian $ # $Id$
# vim:tw=79 # vim:tw=79

7
README
View file

@ -1,8 +1,9 @@
postfix-policyd-spf-perl 1.08 postfix-policyd-spf-perl 1.08.1
A Postfix SMTPd policy server for SPF checking A Postfix SMTPd policy server for SPF checking
(C) 2003-2004 Meng Weng Wong <mengwong@pobox.com> (C) 2007 Scott Kitterman <scott@kitterman.com>
2003-2004 Meng Weng Wong <mengwong@pobox.com>
Contributions by various members of the SPF project Contributions by various members of the SPF project
<http://new.openspf.org/Implementations> <http://www.openspf.org/Software#postfix-policyd-spf-perl>
============================================================================== ==============================================================================
postfix-policyd-spf-perl is a Postfix SMTPd policy daemon for SPF checking. postfix-policyd-spf-perl is a Postfix SMTPd policy daemon for SPF checking.

18
debian/changelog vendored
View file

@ -1,3 +1,21 @@
postfix-policyd-spf-perl (1.08.1) unstable; urgency=low
Debian:
* New maintainer: Scott Kitterman <scott@kitterman.com>
* Priority: extra (was: optional)
* Removed Build-Depends-Indep: perl, as there really is no need for it.
* Depends: libversion-perl
* Updated debian/copyright.
postfix-policyd-spf-perl:
* Minor and purely cosmetic code clean-up.
Miscellaneous:
* Updated README file with new website URL and copyright.
* Added LICENSE file as an explicit copy of the GPLv2.
-- Scott Kitterman <scott@kitterman.com> Wed, 10 Jan 2007 21:00:00 +0000
postfix-policyd-spf-perl (1.08) unstable; urgency=low postfix-policyd-spf-perl (1.08) unstable; urgency=low
* Initial release as a Debian package. * Initial release as a Debian package.

7
debian/control vendored
View file

@ -1,14 +1,13 @@
Source: postfix-policyd-spf-perl Source: postfix-policyd-spf-perl
Section: mail Section: mail
Priority: optional Priority: extra
Maintainer: Julian Mehnle <julian@mehnle.net> Maintainer: Scott Kitterman <scott@kitterman.com>
Build-Depends: debhelper (>= 5) Build-Depends: debhelper (>= 5)
Build-Depends-Indep: perl (>= 5.6)
Standards-Version: 3.7.2 Standards-Version: 3.7.2
Package: postfix-policyd-spf-perl Package: postfix-policyd-spf-perl
Architecture: all Architecture: all
Depends: libmail-spf-query-perl Depends: libversion-perl, libmail-spf-query-perl
Recommends: postfix Recommends: postfix
Description: pure-Perl Postfix policy daemon for SPF checking Description: pure-Perl Postfix policy daemon for SPF checking
postfix-policyd-spf-perl is a Postfix SMTPd policy daemon for SPF checking. postfix-policyd-spf-perl is a Postfix SMTPd policy daemon for SPF checking.

9
debian/copyright vendored
View file

@ -1,13 +1,14 @@
This is the Debian package for postfix-policyd-spf-perl, which is available This is the Debian package for postfix-policyd-spf-perl, which is available
from <http://new.openspf.org/Implementations>. from <http://www.openspf.org/Software#postfix-policyd-spf-perl>.
(C) 2003-2004 Meng Weng Wong <mengwong@pobox.com> (C) 2007 Scott Kitterman <scott@kitterman.com>
2003-2004 Meng Weng Wong <mengwong@pobox.com>
Contributions by various members of the SPF project Contributions by various members of the SPF project
Julian Mehnle is the maintainer of the Debian package. Scott Kitterman is the maintainer of the Debian package.
This is free software; you can redistribute it and/or modify it under the terms This is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License (version 2 or later). of the GNU General Public License (version 2 or later).
On Debian systems, the complete text of the GPL v2 can be found here: On Debian systems, the complete text of the GPL v2 can be found here:
/usr/share/common-licenses/GPL-2 /usr/share/common-licenses/GPL-2

View file

@ -3,9 +3,9 @@
# postfix-policyd-spf-perl # postfix-policyd-spf-perl
# http://www.openspf.org/source/software/postfix-policyd-spf-perl/ # http://www.openspf.org/source/software/postfix-policyd-spf-perl/
# version 1.08 # version 1.08
# $Id: postfix-policyd-spf 147 2006-03-14 21:51:58Z julian $ # $Id$
our $VERSION = '1.08'; use version; our $VERSION = qv('1.08.1');
use strict; use strict;
@ -81,7 +81,7 @@ while (<STDIN>) {
} }
} }
fatal_exit ("unrecognized request type: '$attr{request}'") unless $attr{request} eq "smtpd_access_policy"; fatal_exit("unrecognized request type: '$attr{request}'") unless $attr{request} eq "smtpd_access_policy";
my $action = $DEFAULT_RESPONSE; my $action = $DEFAULT_RESPONSE;
my %responses; my %responses;
@ -108,18 +108,26 @@ sub sender_permitted_from {
local %_ = @_; local %_ = @_;
my %attr = %{ $_{attr} }; my %attr = %{ $_{attr} };
my $query = eval { new Mail::SPF::Query (ip =>$attr{client_address}, my $query = eval {
sender=>$attr{sender}, Mail::SPF::Query->new(
helo =>$attr{helo_name}) }; ip => $attr{client_address},
sender => $attr{sender},
helo => $attr{helo_name}
)
};
if ($@) { if ($@) {
syslog(info => "%s: Mail::SPF::Query->new(%s, %s, %s) failed: %s", syslog(
$attr{queue_id}, $attr{client_address}, $attr{sender}, $attr{helo_name}, $@); info => "%s: Mail::SPF::Query->new(%s, %s, %s) failed: %s",
$attr{queue_id}, $attr{client_address}, $attr{sender}, $attr{helo_name}, $@
);
return "DUNNO"; return "DUNNO";
} }
my ($result, $smtp_comment, $header_comment) = $query->result(); my ($result, $smtp_comment, $header_comment) = $query->result();
syslog(info => "%s: SPF %s: smtp_comment=%s, header_comment=%s", syslog(
$attr{queue_id}, $result, $smtp_comment, $header_comment); info => "%s: SPF %s: smtp_comment=%s, header_comment=%s",
$attr{queue_id}, $result, $smtp_comment, $header_comment
);
if ($result eq "fail") { return "REJECT $smtp_comment"; } if ($result eq "fail") { return "REJECT $smtp_comment"; }
elsif ($result eq "error") { return "DEFER_IF_PERMIT $smtp_comment"; } elsif ($result eq "error") { return "DEFER_IF_PERMIT $smtp_comment"; }
@ -133,30 +141,28 @@ sub testing {
local %_ = @_; local %_ = @_;
my %attr = %{ $_{attr} }; my %attr = %{ $_{attr} };
if (lc address_stripped($attr{sender}) eq if (
lc address_stripped($attr{recipient}) lc(address_stripped($attr{sender})) eq lc(address_stripped($attr{recipient})) and
and $attr{recipient} =~ /policyblock/
$attr{recipient} =~ /policyblock/) { ) {
syslog(info => "%s: testing: will block as requested", $attr{queue_id}); syslog(info => "%s: testing: will block as requested", $attr{queue_id});
return "REJECT smtpd-policy blocking $attr{recipient}"; return "REJECT smtpd-policy blocking $attr{recipient}";
} }
else { else {
syslog(info => "%s: testing: stripped sender=%s, stripped rcpt=%s", syslog(
info => "%s: testing: stripped sender=%s, stripped rcpt=%s",
$attr{queue_id}, $attr{queue_id},
address_stripped($attr{sender}), address_stripped($attr{sender}),
address_stripped($attr{recipient}), address_stripped($attr{recipient}),
); );
} }
return "DUNNO"; return "DUNNO";
} }
# my $foo = address_stripped('foo+bar@baz.com'); # returns 'foo@baz.com'
sub address_stripped { sub address_stripped {
# my $foo = localpart_lhs('foo+bar@baz.com'); # returns 'foo@baz.com'
my $string = shift; my $string = shift;
for ($string) { $string =~ s/[+-].*\@/\@/;
s/[+-].*\@/\@/;
}
return $string; return $string;
} }