1 |
vip-ire |
1.1 |
diff -Nur qpsmtpd-0.96/plugins/karma qpsmtpd-0.96_bz9462/plugins/karma |
2 |
|
|
--- qpsmtpd-0.96/plugins/karma 2016-06-15 22:06:13.483902705 +0200 |
3 |
|
|
+++ qpsmtpd-0.96_bz9462/plugins/karma 2016-06-15 22:11:15.371747989 +0200 |
4 |
|
|
@@ -274,7 +274,6 @@ |
5 |
|
|
#$self->prune_db(); # keep the DB compact |
6 |
|
|
$self->register_hook('connect', 'connect_handler'); |
7 |
|
|
$self->register_hook('mail', 'from_handler'); |
8 |
|
|
- $self->register_hook('rcpt', 'rcpt_handler'); |
9 |
|
|
$self->register_hook('data', 'data_handler'); |
10 |
|
|
$self->register_hook('data_post', 'data_handler'); |
11 |
|
|
$self->register_hook('disconnect', 'disconnect_handler'); |
12 |
|
|
@@ -380,44 +379,6 @@ |
13 |
|
|
return DECLINED; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
-sub rcpt_handler { |
17 |
|
|
- my ($self,$transaction, $recipient, %args) = @_; |
18 |
|
|
- |
19 |
|
|
- $self->illegal_envelope_format( |
20 |
|
|
- $self->connection->notes('envelope_rcpt'), |
21 |
|
|
- ); |
22 |
|
|
- |
23 |
|
|
- my $count = $self->connection->notes('recipient_count') || 0; |
24 |
|
|
- $count++; |
25 |
|
|
- if ( $count > 1 ) { |
26 |
|
|
- $self->log(LOGINFO, "recipients c: $count ($recipient)"); |
27 |
|
|
- $self->connection->notes('recipient_count', $count); |
28 |
|
|
- } |
29 |
|
|
- |
30 |
|
|
- return DECLINED if $self->is_immune(); |
31 |
|
|
- |
32 |
|
|
- my $recipients = scalar $self->transaction->recipients or do { |
33 |
|
|
- $self->log(LOGDEBUG, "info, no recipient count"); |
34 |
|
|
- return DECLINED; |
35 |
|
|
- }; |
36 |
|
|
- $self->log(LOGINFO, "recipients t: $recipients ($recipient)"); |
37 |
|
|
- |
38 |
|
|
- my $history = $self->connection->notes('karma_history'); |
39 |
|
|
- if ( $history > 0 ) { |
40 |
|
|
- $self->log(LOGINFO, "info, good history"); |
41 |
|
|
- return DECLINED; |
42 |
|
|
- } |
43 |
|
|
- |
44 |
|
|
- my $karma = $self->connection->notes('karma'); |
45 |
|
|
- if ( $karma > 0 ) { |
46 |
|
|
- $self->log(LOGINFO, "info, good connection"); |
47 |
|
|
- return DECLINED; |
48 |
|
|
- } |
49 |
|
|
- |
50 |
|
|
- # limit # of recipients if host has negative or unknown karma |
51 |
|
|
- return DENY, "too many recipients for karma $karma (h: $history)"; |
52 |
|
|
-} |
53 |
|
|
- |
54 |
|
|
sub data_handler { |
55 |
|
|
my ($self, $transaction) = @_; |
56 |
|
|
|