#!/usr/local/bin/perl # edit_rfile.cgi # Display the contents of an autoreply file require './forward-lib.pl'; &ReadParse(); &ui_print_header(undef, $text{'rfile_title'}, ""); $in{'vfile'} = &make_absolute($in{'vfile'}); open(FILE, $in{'vfile'}); while() { if (/^Reply-Tracking:\s*(.*)/) { $replies = $1; } elsif (/^Reply-Period:\s*(.*)/) { $period = $1; } elsif (/^No-Autoreply:\s*(.*)/) { $no_autoreply = $1; } elsif (/^From:\s*(.*)/) { $from = $1; } else { push(@lines, $_); } } close(FILE); if (!-r $in{'vfile'}) { ($froms, $doms) = &mailbox::list_from_addresses(); $from = $froms->[0]; } print &text('rfile_desc', "$in{'vfile'}"),"

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

\n"; print "

\n"; print &ui_hidden("file", $in{'file'}),"\n"; print &ui_hidden("num", $in{'num'}),"\n"; print &ui_hidden("vfile", $in{'vfile'}),"\n"; print "

\n"; print "\n"; # Show From: address option print "\n"; printf "\n", $from; print "\n"; # Show reply-tracking option printf "\n", $replies ? "checked" : "", $text{'rfile_replies'}; print "\n"; # Show reply period input print "\n"; printf "\n", $period, $text{'rfile_secs'}; # Show people to not autoreply to print "\n"; printf "\n", $no_autoreply; print "
$text{'rfile_from'} %s\n", $from eq '' ? "checked" : "", $text{'rfile_auto'}; printf "\n", $from eq '' ? "" :"checked"; printf "
$text{'rfile_fromdesc'}
%s
   $text{'rfile_period'} %s\n", $period eq '' ? "checked" : "", $text{'rfile_default'}; printf "\n", $period eq '' ? "" :"checked"; printf " %s
$text{'rfile_no_autoreply'}
\n"; print " ", "\n"; print "

\n"; &ui_print_footer("edit_alias.cgi?num=$in{'num'}&file=$in{'file'}", $text{'aform_return'});