--- smeserver-mailsorting-1.2/root/etc/e-smith/web/functions/userpanel-mailsort.removedropdown 2009-02-22 00:24:56.000000000 +1100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/web/functions/userpanel-mailsort 2009-02-22 00:29:05.000000000 +1100 @@ -123,14 +123,6 @@ - - - - - - - - - + --- smeserver-mailsorting-1.2/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/userpanel-mailsort.removedropdown 2009-02-22 00:23:58.000000000 +1100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/userpanel-mailsort 2009-02-22 00:39:23.000000000 +1100 @@ -78,11 +78,7 @@ DELIVER - Forwarding email address - - - 2ND_DELIVER - 2nd Forwarding address + Folder or email address COPY_TO @@ -113,10 +109,6 @@ Send to my inbox - MAIL_FOLDER - Existing mail folders - - PRIORITY Order of rule execution @@ -146,11 +138,7 @@ ERROR_FORWARD_NO_EMAIL - Error: You attempted to forward but failed to enter an email address - - - ERROR_2ND_FORWARD_NO_EMAIL - Error: You attempted to forward but failed to enter an email address for your copy + Error: Requires a folder to sort to or email address to forward to NO_RULES --- smeserver-mailsorting-1.2/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/mailsort.pm.removedropdown 2009-02-22 00:30:25.000000000 +1100 +++ smeserver-mailsorting-1.2/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/mailsort.pm 2009-02-22 01:03:46.000000000 +1100 @@ -64,7 +64,7 @@ stripe => "#D4D0C8", - fields => [ qw(b1 criterion b2 criterion2 deliver copy copyto Modify Remove) ], + fields => [ qw(b1 criterion b2 criterion2 deliver copy deliver2 Modify Remove) ], labels => 1, @@ -81,7 +81,7 @@ copy => { label => $self->localise("COPY") }, - copyto => { label => $self->localise("COPY_TO") }, + deliver2 => { label => $self->localise("DESTINATION") }, Modify => { label => $self->localise("MODIFY"), @@ -137,8 +137,6 @@ basis2 => $basis2, criterion => $rule->prop("criterion") || '', criterion2 => $rule->prop("criterion2") || '', - mbox => $rule->prop("mbox") || '', - mbox2 => $rule->prop("mbox2") || '', deliver => $deliver, deliver2 => $deliver2, action => $action, @@ -242,10 +240,9 @@ "criterion2=" . $row->{criterion2}, "deliver=" . $row->{deliver}, "deliver2=" . $row->{deliver2}, - "mbox=" . $row->{mbox}, - "mbox2=" . $row->{mbox2}, "action=" . $row->{action}, "action2=" . $row->{action2}, + "copy=" . $row->{copy}, "wherenext=RULE_MODIFY"); } @@ -301,8 +298,6 @@ my $deliver = $q->param ('deliver') || ''; my $deliver2 = $q->param ('deliver2') || ''; my $copy = $q->param ('copy') || ''; - my $mbox = $q->param ('mbox') || ''; - my $mbox2 = $q->param ('mbox2') || ''; my $oldkey = $q->param ('oldkey') || ''; if ($basis eq 'sizelt') { $basis = '<'; } @@ -310,8 +305,6 @@ if ($basis2 eq 'sizelt') { $basis2 = '<'; } if ($basis2 eq 'sizegt') { $basis2 = '>'; } - if ($action eq 'sort') { $deliver = $mbox; } - if ($action2 eq 'sort') { $deliver2 = $mbox2; } if ($copy eq 'no') { $deliver2 = ''; $action2 = ''; } # keys are different but rule at least has part of users name so is likely changed @@ -323,65 +316,15 @@ $rec->delete; } - foreach ("criterion","criterion2","action","copy","mbox","mbox2" ) + foreach ("criterion","criterion2","action","action2","copy","basis","basis2","deliver","deliver2" ) { $pdb->set_prop($rule, "$_", $q->param("$_")); } - $pdb->set_prop($rule, 'basis', $basis); - $pdb->set_prop($rule, 'basis2', $basis2); - $pdb->set_prop($rule, 'deliver', $deliver); - $pdb->set_prop($rule, 'deliver2', $deliver2); - $pdb->set_prop($rule, 'action2', $action2); - unless ( system ("/sbin/e-smith/signal-event mailsorting-conf $PanelUser") == 0 ) { return $self->error('ERROR_UPDATING'); } return $self->success("SUCCESS"); } -our %dirs = (); - -sub get_mbox2 -{ - return \%dirs; -} - -sub get_mbox -{ - my $self = shift; - my $q = $self->{cgi}; - use File::Find; - - sub finddirs - { - my $path = $File::Find::name; - my $strip = "/home/e-smith/files/users/$PanelUser/Maildir"; - - if (-d) - { - # Remove leading path - $path =~ s:^$strip/\.::; - $path =~ s:^$strip::; - - # don't bother to collect Maildir folders, or sent/drafts/trash - foreach (qw( cur tmp new )) - { - return if $path =~ /\/$_\b/; - } - - return if $path =~ "\(Junk|INBOX|INBOX.Sent|INBOX.Trash|INBOX.Drafts)\$"; - return if $path =~ "\(Sent|Trash|sent-mail|Sent Items|Drafts|drafts)\$"; - - $path = GetDisplayName($path); - $dirs{$path} = $path; - } - } - - # find all the Maildirs - find({wanted => \&finddirs, no_chdir => 1}, "/home/e-smith/files/users/$PanelUser/Maildir" ); - - return \%dirs; -} - sub GetDisplayName ($) { my $s = shift; @@ -399,7 +342,7 @@ my $action = $q->param ('action') || ''; my $deliver = $q->param ('deliver') || ''; - if ( $action eq 'forward') + if ( $action ne 'delete') { if (not $deliver) { return "ERROR_FORWARD_NO_EMAIL"; } @@ -420,12 +363,12 @@ my $action = $q->param ('action2') || ''; my $deliver = $q->param ('deliver2') || ''; - if (( $action eq 'forward') && ( $copy eq 'yes')) + if (( $action ne 'delete') && ( $copy eq 'yes')) { if (not $deliver) - { return "ERROR_2ND_FORWARD_NO_EMAIL"; } + { return "ERROR_FORWARD_NO_EMAIL"; } elsif ( $deliver =~ /^\s+$/ ) - { return "ERROR_2ND_FORWARD_NO_EMAIL"; } + { return "ERROR_FORWARD_NO_EMAIL"; } else { return "OK"; } }