/[smecontribs]/rpms/smeserver-wbl/contribs9/smeserver-wbl-0.3.0.bz807.blacklistfrom.patch
ViewVC logotype

Contents of /rpms/smeserver-wbl/contribs9/smeserver-wbl-0.3.0.bz807.blacklistfrom.patch

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


Revision 1.1 - (show annotations) (download)
Sat Sep 5 20:17:59 2015 UTC (9 years, 2 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-wbl-0_3_0-2_el6_sme, smeserver-wbl-0_3_0-8_el6_sme, smeserver-wbl-0_3_0-7_el6_sme, smeserver-wbl-0_3_0-10_el6_sme, smeserver-wbl-0_3_0-4_el6_sme, smeserver-wbl-0_3_0-13_el6_sme, smeserver-wbl-0_3_0-6_el6_sme, smeserver-wbl-0_3_0-5_el6_sme, smeserver-wbl-0_3_0-18_el6_sme, smeserver-wbl-0_3_0-15_el6_sme, smeserver-wbl-0_3_0-14_el6_sme, smeserver-wbl-0_3_0-11_el6_sme, smeserver-wbl-0_3_0-17_el6_sme, smeserver-wbl-0_3_0-16_el6_sme, smeserver-wbl-0_3_0-9_el6_sme, smeserver-wbl-0_3_0-19_el6_sme, smeserver-wbl-0_3_0-12_el6_sme, smeserver-wbl-0_3_0-3_el6_sme, HEAD
* Sat Sep 05 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 0.3.0-2.sme
- added spamassassin blacklist_from field
- smeserver-wbl-0.3.0.bz807.blacklistfrom.patch

1 diff -Nur smeserver-wbl-0.3.0.bz807.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/wbl smeserver-wbl-0.3.0.bz807.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/wbl
2 --- smeserver-wbl-0.3.0.bz807.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/wbl 2015-09-05 21:29:45.441483049 +0200
3 +++ smeserver-wbl-0.3.0.bz807.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/wbl 2015-09-05 21:55:21.636350340 +0200
4 @@ -174,5 +174,15 @@
5 <base>WHITELISTFROM_LABEL</base>
6 <trans>spamassassin whitelist_from</trans>
7 </entry>
8 -
9 + <entry>
10 + <base>BLACKLISTFROM_LABEL</base>
11 + <trans>spamassassin blacklist_from</trans>
12 + </entry>
13 + <entry>
14 + <base>BLACKLISTFROM_DESCRIPTION</base>
15 + <trans>
16 + Any envelope sender of a mail (*@host or user@host) matching an entry in blacklist_from
17 + will be rejected by spamassassin.
18 + </trans>
19 + </entry>
20 </lexicon>
21 diff -Nur smeserver-wbl-0.3.0.bz807.old/root/etc/e-smith/web/functions/wbl smeserver-wbl-0.3.0.bz807.new/root/etc/e-smith/web/functions/wbl
22 --- smeserver-wbl-0.3.0.bz807.old/root/etc/e-smith/web/functions/wbl 2015-09-05 21:29:47.816654521 +0200
23 +++ smeserver-wbl-0.3.0.bz807.new/root/etc/e-smith/web/functions/wbl 2015-09-05 21:54:26.081297872 +0200
24 @@ -73,6 +73,15 @@
25 <description>BADMAILFROM_DESCRIPTION</description>
26 </field>
27
28 + <field
29 + type="textarea"
30 + id="blacklistfrom"
31 + value="get_blacklistfrom()"
32 + validation="">
33 + <label>BLACKLISTFROM_LABEL</label>
34 + <description>BLACKLISTFROM_DESCRIPTION</description>
35 + </field>
36 +
37 <subroutine src="print_button('SAVE')" />
38 </page>
39
40 diff -Nur smeserver-wbl-0.3.0.bz807.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm smeserver-wbl-0.3.0.bz807.new/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm
41 --- smeserver-wbl-0.3.0.bz807.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm 2015-09-05 21:29:47.946663908 +0200
42 +++ smeserver-wbl-0.3.0.bz807.new/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm 2015-09-05 22:05:51.583825438 +0200
43 @@ -207,6 +207,24 @@
44 foreach $BadMailFrom (@BadMailFrom){
45 $wdb->set_prop('badmailfrom', "$BadMailFrom", 'Black');
46 }
47 + # spamassassin blacklist_from
48 + my %list_wblglobal = $sdb->get('wbl.global')->props;
49 + my $parameter_wblglobal = "";
50 + my $value_wblglobal = "";
51 + while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
52 + if ($parameter_wblglobal eq "type") {next;}
53 +
54 + if ($value_wblglobal eq "Black") {
55 + $sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
56 + }
57 + }
58 +
59 + my $BlacklistFrom = $q->param("blacklistfrom");
60 + $BlacklistFrom =~ s/\r\n/,/g;
61 + my @BlacklistFrom = sort(split /,/, $BlacklistFrom);
62 + foreach $BlacklistFrom (@BlacklistFrom){
63 + $sdb->set_prop('wbl.global', "$BlacklistFrom", 'Black');
64 + }
65
66 ##Update email settings
67 unless ( system ("/sbin/e-smith/signal-event", "email-update") == 0 ){
68 @@ -329,4 +347,24 @@
69
70 }
71
72 +sub get_blacklistfrom
73 +{
74 + my %list = $sdb->get('wbl.global')->props;
75 +
76 + my @blacklistfrom = ();
77 + my $parameter = "";
78 + my $value = "";
79 + while (($parameter,$value) = each(%list)) {
80 + if ($parameter eq "type") {next;}
81 +
82 + if ($value eq "Black") {
83 + push @blacklistfrom, $parameter;
84 + }
85 + }
86 +
87 + return "" unless (scalar @blacklistfrom);
88 +
89 + return join "\n", sort(@blacklistfrom);
90 +}
91 +
92 1;

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