Handle hostnames with upper-case letters
[webmin.git] / sendmail / save_afile.cgi
1 #!/usr/local/bin/perl
2 # save_afile.cgi
3 # Save an addresses file
4
5 require (-r 'sendmail-lib.pl' ? './sendmail-lib.pl' :
6          -r 'qmail-lib.pl' ? './qmail-lib.pl' :
7                              './postfix-lib.pl');
8 &ReadParseMime();
9 if (substr($in{'file'}, 0, length($access{'apath'})) ne $access{'apath'}) {
10         &error(&text('afile_efile', $in{'file'}));
11         }
12
13 $in{'text'} =~ s/\r//g;
14 $in{'text'} =~ s/\n*$/\n/;
15 &open_lock_tempfile(FILE, ">$in{'file'}", 1) || &error(&text('afile_ewrite', $!));
16 &print_tempfile(FILE, $in{'text'});
17 &close_tempfile(FILE);
18 &redirect("edit_alias.cgi?name=$in{'name'}&num=$in{'num'}");
19