#!/usr/local/bin/perl # Allow changing of the rule for delivering spam require './spam-lib.pl'; &can_use_check("procmail"); &ui_print_header(undef, $text{'procmail_title'}, ""); print &text('procmail_desc', "$pmrc"),"

\n"; # Find the existing recipe &foreign_require("procmail", "procmail-lib.pl"); @pmrcs = &get_procmailrc(); $pmrc = $pmrcs[$#pmrcs]; @recipes = &procmail::parse_procmail_file($pmrc); $spamrec = &find_file_recipe(\@recipes); if (!$spamrec) { $mode = 4; } elsif ($spamrec->{'action'} eq "\$DEFAULT") { $mode = 4; } elsif ($spamrec->{'action'} eq "/dev/null") { $mode = 0; } elsif ($spamrec->{'action'} =~ /^(.*)\/$/) { $mode = 2; $file = $1; } elsif ($spamrec->{'action'} =~ /^(.*)\/\.$/) { $mode = 3; $file = $1; } elsif ($spamrec->{'type'} eq '!') { $mode = 5; $email = $spamrec->{'action'}; } else { $mode = 1; $file = $spamrec->{'action'}; } print "

\n"; print "\n"; # Spam destination inputs print "\n"; printf "\n", $mode == 0 ? "checked" : "", $text{'setup_null'}; printf "\n", $mode == 4 ? "checked" : "", $text{'setup_default'}; printf "\n", $mode == 1 ? "checked" : "", $text{'setup_file'}; printf "\n", $mode == 1 ? $file : undef; printf "\n", $mode == 2 ? "checked" : "", $text{'setup_maildir'}; printf "\n", $mode == 2 ? $file : undef; printf "\n", $mode == 3 ? "checked" : "", $text{'setup_mhdir'}; printf "\n", $mode == 3 ? $file : undef; printf "\n", $mode == 5 ? "checked" : "", $text{'setup_email'}; printf "\n", $mode == 5 ? $email : undef; print "
$text{'setup_to'} %s
%s
%s
%s
%s
%s

\n"; if ($module_info{'usermin'}) { print "$text{'setup_rel'}

\n"; } else { print "$text{'setup_home'}

\n"; } print "$text{'setup_head'}

\n"; print "

\n"; &ui_print_footer("", $text{'index_return'});