Handle hostnames with upper-case letters
[webmin.git] / postfix / manual_update.cgi
1 #!/usr/local/bin/perl
2 # Update a manually edited config file
3
4 require './postfix-lib.pl';
5 &error_setup($text{'cmanual_err'});
6 $access{'manual'} || &error($text{'cmanual_ecannot'});
7 &ReadParseMime();
8
9 # Work out the file
10 @files = ( $config{'postfix_config_file'}, $config{'postfix_master'} );
11 &indexof($in{'file'}, @files) >= 0 || &error($text{'cmanual_efile'});
12 $in{'data'} =~ s/\r//g;
13 if ($in{'file'} eq $files[0]) {
14         $in{'data'} =~ /\S/ || &error($text{'cmanual_edata'});
15         }
16
17 # Write to it
18 &open_lock_tempfile(DATA, ">$in{'file'}");
19 &print_tempfile(DATA, $in{'data'});
20 &close_tempfile(DATA);
21
22 &webmin_log("manual", undef, $in{'file'});
23 &redirect("");
24