FilesSubmittedBranchesLabelsClientsUsersJobsHelp
Tree viewShow/hide recent activityInformation
Change 67

Change 67 by nullbyte@nullbyte-gentoo on 2004/04/11 14:02:38

key on the /24 instead of the full IP. hotmail retries from a different box in the farm every time so their mail was never getting through. also -d/-f options, purge().
Jobs fixed ...Affected files ...
//depot/projects/greylistd/lib/Mail/Greylist.pm#3 editktext
//depot/projects/greylistd/bin/greylistd#2 editxtext
//depot/projects/greylistd/Changes#2 edittext
Differences ...

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

@@ -11,7 +11,7 @@
1111use DB_File;
1212use Fcntl;
1313
14our $VERSION = '0.1';
14our $VERSION = '0.2';
1515
1616my $DELAY = 300; # seconds a new triplet must wait
1717my $LIFETIME = 36 * 86400; # forget triplets after this long
@@ -30,7 +30,9 @@
3030
3131sub triplet {
3232 my ($self, $ip, $from, $to) = @_;
33 return join("/", $ip, lc($from || '<>'), lc $to);
33 # big ISPs retry from a different box in the same farm; key on the /24
34 (my $net = $ip) =~ s/\.\d+$//;
35 return join("/", $net, lc($from || '<>'), lc $to);
3436}
3537
3638# returns "DUNNO" to let postfix carry on, or a defer action
@@ -50,6 +52,14 @@
5052 return "DUNNO";
5153}
5254
55sub purge {
56 my $self = shift;
57 my $now = time;
58 my @old = grep { $now - $self->{db}{$_} > $LIFETIME } keys %{ $self->{db} };
59 delete @{ $self->{db} }{@old};
60 return scalar @old;
61}
62
5363sub DESTROY {
5464 my $self = shift;
5565 untie %{ $self->{db} };

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

@@ -9,9 +9,13 @@
99use strict;
1010use lib '/usr/local/lib/greylistd';
1111use Mail::Greylist;
12use Getopt::Std;
1213
14my %opt;
15getopts('d:f:', \%opt) or die "usage: greylistd [-d delay] [-f dbfile]\n";
16
1317$| = 1;
14my $gl = Mail::Greylist->new();
18my $gl = Mail::Greylist->new(delay => $opt{d}, dbfile => $opt{f});
1519my %req;
1620
1721while (my $line = <STDIN>) {

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

@@ -1,4 +1,10 @@
11Revision history for Mail::Greylist
22
30.2 Sun Apr 11 2004
4 - key triplets on the client /24, not the full IP (job000004).
5 hotmail's outbound farm was never getting through.
6 - purge() for stale triplets
7 - greylistd: -d and -f options
8
390.1 Tue Mar 2 2004
410 - first cut. works on my box. spam down 80% overnight.

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