Handle hostnames with upper-case letters
[webmin.git] / sendmail / save_cgs.cgi
1 #!/usr/local/bin/perl
2 # save_cgs.cgi
3 # Save sendmail.cg list
4
5 require './sendmail-lib.pl';
6 &ReadParseMime();
7 $access{'cgs'} || &error($text{'cgs_ecannot'});
8 &error_setup($text{'cgs_err'});
9 &lock_file($config{'sendmail_cf'});
10 $conf = &get_sendmailcf();
11 @dlist = split(/\s+/, $in{'dlist'});
12 foreach $d (@dlist) {
13         $d =~ /^[A-z0-9\-\.]+$/ ||
14                 &error(&text('cgs_ehost', $d));
15         &check_ipaddress($d) &&
16                 &error(&text('cgs_eip', $d));
17         }
18 @dlist = &unique(@dlist);
19
20 # Update outgoing domains
21 &save_file_or_config($conf, "G", \@dlist);
22 &flush_file_lines();
23
24 &unlock_file($config{'sendmail_cf'});
25 &restart_sendmail();
26 &webmin_log("cgs");
27 &redirect("");
28