/[smecontribs]/rpms/smeserver-learn/contribs8/smeserver-learn-1.0-SME9284.patch
ViewVC logotype

Annotation of /rpms/smeserver-learn/contribs8/smeserver-learn-1.0-SME9284.patch

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


Revision 1.1 - (hide annotations) (download)
Tue Mar 8 08:02:02 2016 UTC (8 years, 8 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-learn-1_0-9_el5_sme, smeserver-learn-1_0-12_el5_sme, smeserver-learn-1_0-11_el5_sme, smeserver-learn-1_0-6_el5_sme, smeserver-learn-1_0-7_el5_sme, smeserver-learn-1_0-5_el5_sme, smeserver-learn-1_0-8_el5_sme, smeserver-learn-1_0-10_el5_sme, HEAD
* Tue Mar 08 2016 JP Pialasse <tests@pialasse.com> 1.0-5.sme
- new version SME8 and SME9
- fix wrong default db key DeleteAfterLearn [SME: 7083]
- added inspection of temp and new subdir [SME: 6862]
- moved default db keys as file outside of spec
- new db properties: (LearnAsHam,LearnInWL)RemoveSPAMTag, (*)LeanNew,(*)Uniq,(LearnAsSpam)SpamLinks
- new account db property for user: SpamLinks
- import to buildsys [SME: 4423]
- use sa-learn per dir and not per message [SME: 1701]
- merge enhancements [SME: 4423] [SME: 1701]
- NFR: create links
- NFR: filter out SPAM tag from HAM and InWL mails
- NFR: added auto create folders if multiple folder disabled
- NFR: create db key for multiple folder to inspect
- enhanced move to junkmail or inbox
- moving job from crontab to /etc/cron.d/Learn
- fixed typo in event email-update (r3)
- fixed wrong file permission on /etc/cron.d/Lean [SME: 9283] (r4)
- fixed messy output [SME: 9284] (r5)

1 unnilennium 1.1 diff -Nur smeserver-learn-1.0/root/usr/bin/Learn.pl.MESSYOUTPUT smeserver-learn-1.0/root/usr/bin/Learn.pl
2     --- smeserver-learn-1.0/root/usr/bin/Learn.pl.MESSYOUTPUT 2016-03-07 11:00:23.000000000 +0100
3     +++ smeserver-learn-1.0/root/usr/bin/Learn.pl 2016-03-08 08:21:55.000000000 +0100
4     @@ -85,8 +85,8 @@
5     if (! @logdirs and ($sadb->get_prop($mode, "Uniq") eq "enabled")) {
6     ($login,$pass,$uid,$gid) = getpwnam($key)
7     or die "$key not in passwd file";
8     + print "+->mkdir :". $MailDir . "/" . $dirname . "\n";
9     foreach $a ('','/cur','/tmp','/new'){
10     - print "mkdir :". $MailDir . "/" . $dirname . "$a\n";
11     mkdir $MailDir . "/" . $dirname . "$a";
12     chown $uid,$gid,$MailDir . "/" . $dirname . "$a";
13     }
14     @@ -100,7 +100,7 @@
15     $a=(substr($a, 0, 1) eq '.')? $a: ".$a";
16     my $Link= $MailDir . "/" . $a;
17     if (! -e $Link) {
18     - print "create link $Link on $junkdir\n";
19     + print "+->create link $Link on $junkdir\n";
20     symlink($junkdir, $Link) or die "Can't create symlink from $Link to $junkdir: $!";
21     };
22     }
23     @@ -137,20 +137,21 @@
24     #sa-learn here to avoid its loading for each files, when it can walk in directories on itself!
25     my $SpamDir = ($sadb->get_prop($mode, "LearnNew") eq "enabled")? $MailDir . "/" . $logdir : $MailDir . "/" . $logdir . "/cur/" ;
26     #taking action according to actual mode
27     - if ($mode eq "LearnAsSpam") {
28     - my $result = `/usr/bin/sa-learn --spam --showdots $SpamDir`;
29     - printf("Learning Spam from %s: %s\n",$SpamDir,$result);
30     + my $counter = 0;
31     + find( { wanted => sub { -f && $counter++;}, no_chdir => 1, follow_fast => 1 }, $SpamDir );
32     + if ($mode eq "LearnAsSpam" and $counter>0) {
33     + my $result = `/usr/bin/sa-learn --spam $SpamDir`;
34     + chomp($result); printf("+Learning Spam from %s: %s\n",$logdir,$result);
35     }
36     - elsif ($mode eq "LearnAsHam") {
37     - my $result = `/usr/bin/sa-learn --ham --showdots $SpamDir`;
38     - printf("Learning Ham from %s: %s\n",$SpamDir,$result);
39     + elsif ($mode eq "LearnAsHam" and $counter>0) {
40     + my $result = `/usr/bin/sa-learn --ham $SpamDir`;
41     + chomp($result);printf("+Learning Ham from %s: %s\n",$logdir,$result);
42     }
43    
44     @list= ($sadb->get_prop($mode, "LearnNew") eq "enabled") ? ('/cur/','/new/'):('/cur/');
45     foreach $a (@list){
46     - my $SpamDir = $MailDir . "/" . $logdir . "$a";#JPP why only the cur and not the new?
47     + my $SpamDir = $MailDir . "/" . $logdir . "$a";
48     # list and sort file in dir
49     - printf("Checking Dir: %s\n",$SpamDir);
50     opendir(SPAMDIR, $SpamDir);
51     my @spamfiles = sort grep { /$hostname/ } readdir(SPAMDIR);
52     closedir(SPAMDIR);
53     @@ -164,7 +165,7 @@
54    
55     #taking action according to actual mode
56     if ($mode eq "LearnInWL") {
57     - printf("Learning in WhiteList: %s\n",$filetolearnbash);
58     + printf("+Learning in WhiteList: %s\n",$filetolearnbash);
59     `/usr/bin/LearnInWL.pl $filetolearnbash`;
60     }
61     # if we are in LearnAsSpam mode and DeleteAfterLearn is enabled delete message, else tagging a move message

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