/[smecontribs]/rpms/smeserver-mailstats/contribs7/smeserver-mailstats-configdb_multiple_open.patch
ViewVC logotype

Annotation of /rpms/smeserver-mailstats/contribs7/smeserver-mailstats-configdb_multiple_open.patch

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


Revision 1.1 - (hide annotations) (download)
Fri Feb 15 18:10:51 2008 UTC (16 years, 3 months ago) by slords
Branch: MAIN
Import on branch contribs7 of package smeserver-mailstats-0.0.2-07.src.rpm

1 slords 1.1 diff -Nur -x '*.orig' -x '*.rej' smeserver-mailstats-0.0.2/root/usr/bin/spamfilter-stats-7.pl mezzanine_patched_smeserver-mailstats-0.0.2/root/usr/bin/spamfilter-stats-7.pl
2     --- smeserver-mailstats-0.0.2/root/usr/bin/spamfilter-stats-7.pl 2007-10-11 16:51:20.000000000 -0400
3     +++ mezzanine_patched_smeserver-mailstats-0.0.2/root/usr/bin/spamfilter-stats-7.pl 2007-10-11 16:51:11.000000000 -0400
4     @@ -75,6 +75,7 @@
5     # 0.6.15 - bjr - fix columns included in totals
6     # - sort out domains when more that one email address in recipient field
7     # 0.6.16 - cb - fix date range bug (http://bugs.contribs.org/show_bug.cgi?id=3366)
8     +# 0.6.17 - cb - avoid numerous re-openings of config db
9     #
10     # TODO
11     # ----
12     @@ -231,16 +232,18 @@
13    
14     # store the domain of interest. Every other records are stored in a 'Other' zone
15     my $ddb = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB : $!\n";
16     +my $cdb = esmith::ConfigDB->open_ro or die "Couldn't open ConfigDB : $!\n";
17     +
18     foreach my $domain( $ddb->get_all_by_prop( type => "domain" ) ) {
19     $byrcptdomain{ $domain->key }{ 'type' }='local';
20     }
21     -$byrcptdomain{ esmith::ConfigDB->open_ro->get('SystemName')->value . "."
22     - . esmith::ConfigDB->open_ro->get('DomainName')->value }{ 'type' } = 'local';
23     +$byrcptdomain{ $cdb->get('SystemName')->value . "."
24     + . $cdb->get('DomainName')->value }{ 'type' } = 'local';
25    
26     # is this system a MX-Backup ?
27     -if (esmith::ConfigDB->open_ro->get('mxbackup')){
28     - if ( ( esmith::ConfigDB->open_ro->get('mxbackup')->prop('status') || 'disabled' ) eq 'enabled' ) {
29     - my %MXValues = split( /,/, ( esmith::ConfigDB->open_ro->get('mxbackup')->prop('name') || '' ) ) ;
30     +if ($cdb->get('mxbackup')){
31     + if ( ( $cdb->get('mxbackup')->prop('status') || 'disabled' ) eq 'enabled' ) {
32     + my %MXValues = split( /,/, ( $cdb->get('mxbackup')->prop('name') || '' ) ) ;
33     foreach my $data ( keys %MXValues ) {
34     $byrcptdomain{ $data }{ 'type' } = "mxbackup-$MXValues{ $data }" ;
35     if ( $MXValues{ $data } == 1 ) { # subdomains allowed, must take care of this
36     @@ -256,32 +259,32 @@
37     # First check current configuration for logging, DNS enable and Max threshold for spamassassin
38     #
39    
40     -my $LogLevel = esmith::ConfigDB->open_ro->get('qpsmtpd')->prop('LogLevel');
41     +my $LogLevel = $cdb->get('qpsmtpd')->prop('LogLevel');
42     my $HighLogLevel = ( $LogLevel > 6 );
43    
44     my $RHSenabled =
45     - ( esmith::ConfigDB->open_ro->get('qpsmtpd')->prop('RHSBL') eq 'enabled' );
46     + ( $cdb->get('qpsmtpd')->prop('RHSBL') eq 'enabled' );
47     my $DNSenabled =
48     - ( esmith::ConfigDB->open_ro->get('qpsmtpd')->prop('DNSBL') eq 'enabled' );
49     + ( $cdb->get('qpsmtpd')->prop('DNSBL') eq 'enabled' );
50     my $SARejectLevel =
51     - esmith::ConfigDB->open_ro->get('spamassassin')->prop('RejectLevel');
52     + $cdb->get('spamassassin')->prop('RejectLevel');
53     my $SATagLevel =
54     - esmith::ConfigDB->open_ro->get('spamassassin')->prop('TagLevel');
55     + $cdb->get('spamassassin')->prop('TagLevel');
56     my $DomainName =
57     - esmith::ConfigDB->open_ro->get('DomainName')->value;
58     + $cdb->get('DomainName')->value;
59    
60     # check that logterse is in use
61     #my pluginfile = '/var/service/qpsmtpd/config/peers/0';
62    
63     #and see if mailstats are disabled
64     -if (esmith::ConfigDB->open_ro->get('mailstats')){
65     - $disabled = !((esmith::ConfigDB->open_ro->get('mailstats')->prop('Status') || 'enabled') eq 'enabled');
66     +if ($cdb->get('mailstats')){
67     + $disabled = !(($cdb->get('mailstats')->prop('Status') || 'enabled') eq 'enabled');
68     } else {
69     my $db = esmith::ConfigDB->open; my $record = $db->new_record('mailstats', { type => 'report', Status => 'enabled' });
70     $disabled = $false;
71     }
72     # check mailstats email recipient
73     -my $email = esmith::ConfigDB->open_ro->get('mailstats')->prop('Email') || 'admin';
74     +my $email = $cdb->get('mailstats')->prop('Email') || 'admin';
75     $opt{'mail'} = $email;
76    
77    
78     @@ -317,8 +320,8 @@
79     $ncateg = 0;
80     while ( $ncateg < @categs) {
81     $counts{$GRANDTOTAL}{$categs[$ncateg]} = 0;
82     - if (esmith::ConfigDB->open_ro->get('mailstats')){
83     - $display[$ncateg] = lc(esmith::ConfigDB->open_ro->get('mailstats')->prop($categs[$ncateg])) || "auto";
84     + if ($cdb->get('mailstats')){
85     + $display[$ncateg] = lc($cdb->get('mailstats')->prop($categs[$ncateg])) || "auto";
86     } else {
87     $display[$ncateg] = 'auto'
88     }
89     @@ -905,10 +908,10 @@
90     my $enableqpsmtpdcodes;
91     my $enableSARules;
92     my $enablejunkMailList;
93     - if (esmith::ConfigDB->open_ro->get('mailstats')){
94     - $enableqpsmtpdcodes = esmith::ConfigDB->open_ro->get('mailstats')->prop("QpsmtpdCodes") || "enabled" eq "enabled" || $true;
95     - $enableSARules = esmith::ConfigDB->open_ro->get('mailstats')->prop("SARules") || "enabled" eq "enabled" || $true;
96     - $enablejunkMailList = esmith::ConfigDB->open_ro->get('mailstats')->prop("JunkMailList") || "enabled" eq "enabled" || $true;
97     + if ($cdb->get('mailstats')){
98     + $enableqpsmtpdcodes = $cdb->get('mailstats')->prop("QpsmtpdCodes") || "enabled" eq "enabled" || $true;
99     + $enableSARules = $cdb->get('mailstats')->prop("SARules") || "enabled" eq "enabled" || $true;
100     + $enablejunkMailList = $cdb->get('mailstats')->prop("JunkMailList") || "enabled" eq "enabled" || $true;
101     } else {
102     $enableqpsmtpdcodes = $true;
103     $enableSARules = $true;
104     @@ -1070,8 +1073,8 @@
105     } else {
106     $defaultpercentthreshold = $mincutoff
107     }
108     - if (esmith::ConfigDB->open_ro->get('mailstats')){
109     - $percentthreshold = esmith::ConfigDB->open_ro->get('mailstats')->prop("SARulePercentThreshold") || $defaultpercentthreshold;
110     + if ($cdb->get('mailstats')){
111     + $percentthreshold = $cdb->get('mailstats')->prop("SARulePercentThreshold") || $defaultpercentthreshold;
112     } else {
113     $percentthreshold = $defaultpercentthreshold
114     }

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