FilesSubmittedBranchesLabelsClientsUsersJobsHelp
Tree viewShow/hide recent activityInformation
Recent activity in //depot/...
2412005/11/08ksimpsonprocmail: pharma spam that sneaks past greylistd. v1agra, c1alis, 'replica watches'.
2342005/11/02zz9fast: print solve time. 0.004s. ken's main branch: 0.31s. just saying.
2272005/10/30nullbytestrip <script> out of page bodies. someone (zz9) had an XSS in FrontPage within
2192005/10/20ksimpsoniTunes 4.9 does podcasts natively now, so podgrab is officially obsolete.
2082005/09/17nullbytegreylistd 0.4: point people at a page explaining the 450 instead of just being rude
Change 110

Change 110 by nullbyte@nullbyte-gentoo on 2004/12/24 15:30:00

greylistd 0.31: whitelist file for the networks that never retry properly. merry xmas, spammers. here is a lump of 450.
Affected files ...
//depot/projects/greylistd/lib/Mail/Greylist.pm#5 editktext
//depot/projects/greylistd/bin/greylistd#4 editxtext
//depot/projects/greylistd/t/01-basic.t#2 edittext
//depot/projects/greylistd/Changes#4 edittext
Differences ...

==== //depot/projects/greylistd/lib/Mail/Greylist.pm#5 (ktext) ====

@@ -11,7 +11,7 @@
1111use DB_File;
1212use Fcntl;
1313
14our $VERSION = '0.3';
14our $VERSION = '0.31';
1515
1616my $DELAY = 300; # seconds a new triplet must wait
1717my $LIFETIME = 36 * 86400; # forget triplets after this long
@@ -21,6 +21,7 @@
2121 my $self = {
2222 dbfile => $args{dbfile} || '/var/lib/greylistd/triplets.db',
2323 delay => defined $args{delay} ? $args{delay} : $DELAY,
24 white => $args{whitelist} || [],
2425 db => {},
2526 };
2627 tie %{ $self->{db} }, 'DB_File', $self->{dbfile}, O_RDWR|O_CREAT, 0600, $DB_HASH
@@ -38,6 +39,9 @@
3839# returns "DUNNO" to let postfix carry on, or a defer action
3940sub check {
4041 my ($self, %req) = @_;
42 for my $re (@{ $self->{white} }) {
43 return "DUNNO" if $req{client_address} =~ $re;
44 }
4145 my $key = $self->triplet($req{client_address}, $req{sender}, $req{recipient});
4246 my $now = time;
4347

==== //depot/projects/greylistd/bin/greylistd#4 (xtext) ====

@@ -17,7 +17,18 @@
1717
1818$| = 1;
1919openlog('greylistd', 'pid', 'mail');
20my $gl = Mail::Greylist->new(delay => $opt{d}, dbfile => $opt{f});
20my @white;
21if (open my $wl, '<', '/etc/greylistd/whitelist') {
22 while (<$wl>) {
23 s/#.*//;
24 s/^\s+|\s+$//g;
25 push @white, qr/^\Q$_\E/ if length;
26 }
27 close $wl;
28}
29
30my $gl = Mail::Greylist->new(delay => $opt{d}, dbfile => $opt{f},
31 whitelist => \@white);
2132my %req;
2233
2334while (my $line = <STDIN>) {

==== //depot/projects/greylistd/t/01-basic.t#2 (text) ====

@@ -1,6 +1,6 @@
11#!/usr/bin/perl -w
22use strict;
3use Test::More tests => 5;
3use Test::More tests => 7;
44use File::Temp qw(tempdir);
55
66use_ok('Mail::Greylist');
@@ -17,3 +17,12 @@
1717like($gl->check(%req), qr/^DEFER/, 'immediate retry still deferred');
1818sleep 3;
1919is($gl->check(%req), 'DUNNO', 'retry after delay is accepted');
20
21# same /24 counts as the same sender (job000004)
22$req{client_address} = '10.1.2.99';
23is($gl->check(%req), 'DUNNO', 'same /24 is accepted');
24
25my $gl2 = Mail::Greylist->new(dbfile => "$dir/t2.db",
26 whitelist => [ qr/^192\.168\./ ]);
27is($gl2->check(%req, client_address => '192.168.0.5'), 'DUNNO',
28 'whitelisted network skips the greylist');

==== //depot/projects/greylistd/Changes#4 (text) ====

@@ -1,5 +1,9 @@
11Revision history for Mail::Greylist
22
30.31 Fri Dec 24 2004
4 - /etc/greylistd/whitelist: one network prefix per line
5 - tests for the /24 behaviour and the whitelist
6
370.3 Wed Jun 30 2004
48 - log every decision via syslog
59 - Makefile.PL lists all prereqs

P4Web/LINUX26X86/2005.1/82295 · Copyright © 1995-2005 Perforce Software · ttul.org