| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | #!/usr/bin/perl -w |
| 2 | 2 | use strict; |
| 3 | use Test::More tests => 5; | |
| 3 | use Test::More tests => 7; | |
| 4 | 4 | use File::Temp qw(tempdir); |
| 5 | 5 | |
| 6 | 6 | use_ok('Mail::Greylist'); |
| @@ -17,3 +17,12 @@ | ||
| 17 | 17 | like($gl->check(%req), qr/^DEFER/, 'immediate retry still deferred'); |
| 18 | 18 | sleep 3; |
| 19 | 19 | is($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'; | |
| 23 | is($gl->check(%req), 'DUNNO', 'same /24 is accepted'); | |
| 24 | ||
| 25 | my $gl2 = Mail::Greylist->new(dbfile => "$dir/t2.db", | |
| 26 | whitelist => [ qr/^192\.168\./ ]); | |
| 27 | is($gl2->check(%req, client_address => '192.168.0.5'), 'DUNNO', | |
| 28 | 'whitelisted network skips the greylist'); | |