save_relay.cgi
来自「Unix下基于Web的管理工具」· CGI 代码 · 共 39 行
CGI
39 行
#!/usr/local/bin/perl# save_relay.cgi# Save relay domains listrequire './sendmail-lib.pl';&ReadParse();$access{'relay'} || &error($text{'relay_ecannot'});&error_setup($text{'relay_err'});$conf = &get_sendmailcf();@dlist = split(/\s+/, $in{'dlist'});foreach $d (@dlist) { $d =~ /^[A-z0-9\-\.]+$/ || &error(&text('relay_edomain', $d)); }@dlist = &unique(@dlist);# get old CR directives@old = grep { $_->{'value'} =~ /^R/ } &find_type("C", $conf);if ($in{'relayfile'}) { # If there is a relay file, write all domains to it and take any # out of sendmail.cf open(RELAY, "> $in{'relayfile'}"); foreach $d (@dlist) { print RELAY $d,"\n"; } close(RELAY); }else { # Stick all domains in sendmail.cf foreach $d (@dlist) { push(@new, { 'type' => 'C', 'values' => [ "R$d" ] }); } }&save_directives($conf, \@old, \@new);&flush_file_lines();&restart_sendmail();&redirect("");
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?