Handle hostnames with upper-case letters
[webmin.git] / postfix / save_manual.cgi
1 #!/usr/local/bin/perl
2 # Update a manually edited map file
3
4 require './postfix-lib.pl';
5 &ReadParseMime();
6 &error_setup($text{'manual_err'});
7 $access{'manual'} || &error($text{'manual_ecannot'});
8 @files = &get_maps_files(&get_real_value($in{'map_name'}));
9 &indexof($in{'file'}, @files) >= 0 || &error($text{'manual_efile'});
10
11 # Save the data
12 $in{'data'} =~ s/\r//g;
13 &open_lock_tempfile(FILE, ">$in{'file'}");
14 &print_tempfile(FILE, $in{'data'});
15 &close_tempfile(FILE);
16
17 # Regenerate map
18 &regenerate_map_table($in{'map_name'});
19 &reload_postfix();
20
21 &webmin_log("manual", $in{'map_name'}.'s', $in{'file'});
22 &redirect_to_map_list($in{'map_name'});