#!/usr/local/bin/perl # edit_ffile.cgi # Allow editing of a filter config file require './qmail-lib.pl'; &ReadParse(); &ui_print_header(undef, $text{'ffile_title'}, ""); open(FILE, $in{'file'}); while() { s/\r|\n//g; if (/^(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) { push(@filter, [ $1, $2, $3, $4 ]); } elsif (/^(2)\s+(\S+)$/) { $other = $2; } } close(FILE); print "",&text('ffile_desc', "$in{'file'}"),"

\n"; print "

\n"; print "\n"; print "\n"; $i = 0; foreach $f (@filter, [ 1, '', '', '' ]) { $field = "\n"; $what = "\n"; $match = "\n"; $action = "\n"; print &text('ffile_line', $field, $what, $match, $action),"
\n"; $i++; } print &text('ffile_other', ""),"
\n"; print "\n"; print "
\n"; &ui_print_footer("edit_alias.cgi?name=$in{'name'}", $text{'aform_return'});