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

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

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


Revision 1.1 - (hide annotations) (download)
Wed Mar 16 15:34:06 2016 UTC (8 years, 8 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-learn-1_0-10_el5_sme, smeserver-learn-1_0-12_el5_sme, smeserver-learn-1_0-11_el5_sme, HEAD
* Wed Mar 16 2016 JP Pialasse <tests@pialasse.com> 1.0-10.sme
- fix encoding problem when removing or adding tags [SME: 9282]
- fix moving file not working MOVE patch [SME: 9314]

1 unnilennium 1.1 diff -up smeserver-learn-1.0/root/usr/bin/Learn.pl.MOVE smeserver-learn-1.0/root/usr/bin/Learn.pl
2     --- smeserver-learn-1.0/root/usr/bin/Learn.pl.MOVE 2016-03-16 11:20:03.245000000 -0400
3     +++ smeserver-learn-1.0/root/usr/bin/Learn.pl 2016-03-16 11:27:32.880000000 -0400
4     @@ -43,6 +43,7 @@ my $agesecs=60*60*24*$DelayToMove;
5     my $daysago=time-$agesecs; #the time stamp of $agedays ago in seconds
6     my $daysago2=localtime($daysago); #the time stamp of $agedays ago in words - mainly for printing
7     my $SpamLinks = $sadb->get_prop("LearnAsSpam", "SpamLinks") or "";
8     +my @files;
9    
10     #getting user list
11     my @users = $adb->users;
12     @@ -69,7 +70,7 @@ foreach my $user (@users) {
13    
14     printf("Checking for user (%s): %s %s\n", $key,$firstname, $lastname);
15    
16     - my $MailDir = ($key eq "admin")? "/home/e-smith/" . "/Maildir" : "/home/e-smith/files/users/" . $key . "/Maildir";
17     + my $MailDir = ($key eq "admin")? "/home/e-smith" . "/Maildir" : "/home/e-smith/files/users/" . $key . "/Maildir";
18    
19     my @modes = ("LearnAsSpam","LearnAsHam","LearnInWL");
20     foreach my $mode (@modes) {
21     @@ -122,7 +123,7 @@ foreach my $user (@users) {
22     if ($mode eq "LearnAsSpam" and $sadb->get_prop($mode, "DeleteAfterLearn") eq "enabled" and $DelayToMove >0) {
23     my $SpamDir = $MailDir . "/" . $logdir . "/cur/";
24     return unless (-e $SpamDir and -d $SpamDir);
25     - my @files;
26     + @files=();
27     find(\&wanted, $junkdir ."/cur" );
28     find(\&wanted, $junkdir ."/new" ) if ($sadb->get_prop($mode, "LearnNew") eq "enabled" or $sadb->get_prop($mode, "LearnNew") eq "junkmail");
29     sub wanted {
30     @@ -137,8 +138,7 @@ foreach my $user (@users) {
31     undef @files;
32     foreach $filename (sort keys %filehash){
33     print "--> moving $filename $filehash{$filename}\n";
34     - my $flname = basename($filename);
35     - move $filename,"$Learndir/$flname" ;
36     + move $filename,"$MailDir/$dirname/cur" ;
37     }
38     }
39    

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