/[smeserver]/rpms/qpsmtpd/sme10/qpsmtpd-0.96-karma_strikes.patch
ViewVC logotype

Annotation of /rpms/qpsmtpd/sme10/qpsmtpd-0.96-karma_strikes.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Apr 21 21:07:10 2016 UTC (8 years, 6 months ago) by vip-ire
Branch: MAIN
CVS Tags: qpsmtpd-0_96-21_el7_sme, qpsmtpd-0_96-19_el7_sme, qpsmtpd-0_96-23_el7_sme, qpsmtpd-0_96-10_el7_sme, qpsmtpd-0_96-20_el7_sme, qpsmtpd-0_96-12_el7_sme, qpsmtpd-0_96-22_el7_sme, qpsmtpd-0_96-14_el7_sme, qpsmtpd-0_96-11_el7_sme, qpsmtpd-0_96-16_el7_sme, qpsmtpd-0_96-13_el7_sme, qpsmtpd-0_96-15_el7_sme, qpsmtpd-0_96-17_el7_sme, qpsmtpd-0_96-9_el7_sme, qpsmtpd-0_96-8_el7_sme, qpsmtpd-0_96-5_el7_sme, qpsmtpd-0_96-6_el7_sme, qpsmtpd-0_96-18_el7_sme, HEAD
Changes since 1.1: +1 -1 lines
* Thu Apr 21 2016 Daniel Berteaud <daniel@firewall-services.com> 0.96-5.sme
- Fix a typo in previou patch [SME: 9462]

1 vip-ire 1.1 diff -Nur -x '*.orig' -x '*.rej' qpsmtpd-0.96/plugins/karma mezzanine_patched_qpsmtpd-0.96/plugins/karma
2     --- qpsmtpd-0.96/plugins/karma 2016-02-16 23:52:02.000000000 +0100
3     +++ mezzanine_patched_qpsmtpd-0.96/plugins/karma 2016-04-20 18:39:43.299979947 +0200
4     @@ -50,6 +50,16 @@
5     penalize a "mostly good" sender. Raising it to 2 reduces that possibility to
6     improbable.
7    
8     +=head2 strikes <integer>
9     +
10     +How many strikes is needed to consider the mail nice or naughty.
11     +Various plugins can adjust the karma (see USING KARMA IN OTHER PLUGINS).
12     +For example, with the default value of 3, if the karma of this message is 3
13     +or above, the mail is considered to be a nice one. If it's -3 or less, it's
14     +considered a naughty one. Between -2 and +2 it's neutral
15     +
16     +Default: 3
17     +
18     =head2 penalty_days <days>
19    
20     The number of days a naughty sender is refused connections. Use a decimal
21     @@ -238,6 +248,7 @@
22     $self->log(LOGERROR, "Bad arguments") if @_ % 2;
23     $self->{_args} = {@_};
24     $self->{_args}{negative} ||= 1;
25     + $self->{_args}{strikes} ||= 3;
26     $self->{_args}{penalty_days} ||= 1;
27     $self->{_args}{reject_type} ||= 'disconnect';
28    
29     @@ -428,7 +439,7 @@
30     my $history = ($nice || 0) - $naughty;
31     my $log_mess = '';
32    
33     - if ($karma < -2) { # they achieved at least 2 strikes
34 vip-ire 1.2 + if ($karma <= $self->{_args}{strikes}) { # Enough negative strikes ?
35 vip-ire 1.1 $history--;
36     my $negative_limit = 0 - $self->{_args}{negative};
37     if ($history <= $negative_limit) {
38     @@ -445,7 +456,7 @@
39     $log_mess = "negative";
40     }
41     }
42     - elsif ($karma > 2) {
43     + elsif ($karma >= $self->{_args}{strikes}) {
44     $nice++;
45     $log_mess = "positive";
46     }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed