3 # Display the contents of an autoreply file
5 require (-r 'sendmail-lib.pl' ? './sendmail-lib.pl' :
6 -r 'qmail-lib.pl' ? './qmail-lib.pl' :
9 if (substr($in{'file'}, 0, length($access{'apath'})) ne $access{'apath'}) {
10 &error(&text('rfile_efile', $in{'file'}));
13 &ui_print_header(undef, $text{'rfile_title'}, "");
14 &open_readfile(FILE, $in{'file'});
16 if (/^Reply-Tracking:\s*(.*)/) {
19 elsif (/^Reply-Period:\s*(.*)/) {
22 elsif (/^No-Autoreply:\s*(.*)/) {
25 elsif (/^No-Autoreply-Regexp:\s*(.*)/) {
28 elsif (/^From:\s*(.*)/) {
37 print &text('rfile_desc', "<tt>$in{'file'}</tt>"),"<p>\n";
38 print "$text{'rfile_desc2'}<p>\n";
40 print "<form action=save_rfile.cgi method=post enctype=multipart/form-data>\n";
41 print "<input type=hidden name=file value=\"$in{'file'}\">\n";
42 print "<input type=hidden name=num value=\"$in{'num'}\">\n";
43 print "<input type=hidden name=name value=\"$in{'name'}\">\n";
44 print "<textarea name=text rows=20 cols=80 $config{'wrap_mode'}>",
45 join("", @lines),"</textarea>\n";
50 print "<tr> <td>$text{'rfile_from'}</td>\n";
51 printf "<td><input type=radio name=from_def value=1 %s> %s\n",
52 $from eq '' ? "checked" : "", $text{'rfile_auto'};
53 printf "<input type=radio name=from_def value=0 %s>\n",
54 $from eq '' ? "" :"checked";
55 printf "<input name=from size=30 value='%s'></td> </tr>\n",
57 print "<tr> <td></td> <td><font size=-1>$text{'rfile_fromdesc'}</font></td> </tr>\n";
59 # Show reply-tracking file
60 print "<tr> <td>$text{'rfile_replies'}</td>\n";
61 printf "<td><input type=radio name=replies_def value=1 %s> %s\n",
62 $replies eq '' ? "checked" : "", $text{'rfile_none'};
63 printf "<input type=radio name=replies_def value=0 %s> %s\n",
64 $replies eq '' ? "" :"checked", $text{'rfile_file'};
65 printf "<input name=replies size=30 value='%s'> %s</td> </tr>\n",
66 $replies, &file_chooser_button("replies");
69 # Show reply-tracking period
70 print "<tr> <td> $text{'rfile_period'}</td>\n";
71 printf "<td><input type=radio name=period_def value=1 %s> %s\n",
72 $period eq '' ? "checked" : "", $text{'rfile_default'};
73 printf "<input type=radio name=period_def value=0 %s>\n",
74 $period eq '' ? "" :"checked";
75 printf "<input name=period size=5 value='%s'> %s</td> </tr>\n",
76 $period, $text{'rfile_secs'};
78 # Show people to not autoreply to
79 print "<tr> <td>$text{'rfile_no_autoreply'}</td>\n";
80 printf "<td><input name=no_autoreply size=40 value='%s'></td> </tr>\n",
83 # Show regexps to not autoreply to
84 print "<tr> <td>$text{'rfile_no_regexp'}</td>\n";
85 print "<td>",&ui_textarea("no_regexp", join("\n", @no_regexp), 3, 40),"</td> </tr>\n";
89 print "<input type=submit value=\"$text{'save'}\"> ",
90 "<input type=reset value=\"$text{'rfile_undo'}\">\n";
93 &ui_print_footer("edit_alias.cgi?name=$in{'name'}&num=$in{'num'}", $text{'aform_return'});