#!/usr/local/bin/perl # edit_rfile.cgi # Display the contents of an autoreply file require (-r 'sendmail-lib.pl' ? './sendmail-lib.pl' : -r 'qmail-lib.pl' ? './qmail-lib.pl' : './postfix-lib.pl'); &ReadParse(); if (substr($in{'file'}, 0, length($access{'apath'})) ne $access{'apath'}) { &error(&text('rfile_efile', $in{'file'})); } &ui_print_header(undef, $text{'rfile_title'}, ""); &open_readfile(FILE, $in{'file'}); while() { if (/^Reply-Tracking:\s*(.*)/) { $replies = $1; } elsif (/^Reply-Period:\s*(.*)/) { $period = $1; } elsif (/^No-Autoreply:\s*(.*)/) { $no_autoreply = $1; } elsif (/^No-Autoreply-Regexp:\s*(.*)/) { push(@no_regexp, $1); } elsif (/^From:\s*(.*)/) { $from = $1; } else { push(@lines, $_); } } close(FILE); print &text('rfile_desc', "$in{'file'}"),"

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

\n"; print "

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # Show From: address print "\n"; printf "\n", $from; print "\n"; # Show reply-tracking file print "\n"; printf "\n", $replies, &file_chooser_button("replies"); print " " x 3; # Show reply-tracking period print "\n"; printf "\n", $period, $text{'rfile_secs'}; # Show people to not autoreply to print "\n"; printf "\n", $no_autoreply; # Show regexps to not autoreply to print "\n"; print "\n"; print "
$text{'rfile_from'} %s\n", $from eq '' ? "checked" : "", $text{'rfile_auto'}; printf "\n", $from eq '' ? "" :"checked"; printf "
$text{'rfile_fromdesc'}
$text{'rfile_replies'} %s\n", $replies eq '' ? "checked" : "", $text{'rfile_none'}; printf " %s\n", $replies eq '' ? "" :"checked", $text{'rfile_file'}; printf " %s
   $text{'rfile_period'} %s\n", $period eq '' ? "checked" : "", $text{'rfile_default'}; printf "\n", $period eq '' ? "" :"checked"; printf " %s
$text{'rfile_no_autoreply'}
$text{'rfile_no_regexp'}",&ui_textarea("no_regexp", join("\n", @no_regexp), 3, 40),"
\n"; print " ", "\n"; print "
\n"; &ui_print_footer("edit_alias.cgi?name=$in{'name'}&num=$in{'num'}", $text{'aform_return'});