⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 save_opts.cgi

📁 Unix下基于Web的管理工具
💻 CGI
字号:
#!/usr/local/bin/perl# save_opts.cgi# Save various sendmail optionsrequire './sendmail-lib.pl';&ReadParse();$access{'opts'} || &error($text{'opts_ecannot'});&error_setup($text{'opts_err'});$conf = &get_sendmailcf();# Save directives&save_doption("S", "DS", 1);&save_doption("R", "DR", 1);&save_doption("H", "DH", 1);# Save other options&save_option("QueueLA", '[\d\.]+', $text{'opts_queuela'});&save_option("RefuseLA", '[\d\.]+', $text{'opts_refusela'});&save_option("MaxDaemonChildren", '\d+', $text{'opts_maxch'});&save_option("ConnectionRateThrottle", '\d+', $text{'opts_throttle'});&save_option("MinQueueAge", '\d+\S', $text{'opts_minqueueage'});&save_option("MaxQueueRunSize", '\d+', $text{'opts_runsize'});&save_option("Timeout.queuereturn", '\d+[dmhwsy]', $text{'opts_queuereturn'});&save_option("Timeout.queuewarn", '\d+[dmhwsy]', $text{'opts_queuewarn'});&save_option("QueueDirectory", '\/\S+', $text{'opts_queue'});&save_option("PostMasterCopy", '\S+', $text{'opts_postmaster'});&save_option("ForwardPath", '\S+', $text{'opts_forward'});&save_option("MinFreeBlocks", '\d+', $text{'opts_minfree'});&save_option("MaxMessageSize", '\d+', $text{'opts_maxmessage'});&save_option("LogLevel", '\d+', $text{'opts_loglevel'});&save_option("SendMimeErrors", '.*');&flush_file_lines();&restart_sendmail();&redirect("");# save_doption(type2, input, blank)sub save_doption{local ($oldstr, $old) = &find_type2("D", $_[0], $conf);@oldlist = $oldstr ? ( $oldstr ) : ( );if ($in{"$_[1]_def"}) {	@newlist = $_[2] && $oldstr ?			( { 'type' => 'D', 'values' => [ $_[0] ] } ) : ( );	}elsif ($in{$_[1]} !~ /^\S+$/) {	&error(&text('opts_ehost', $in{$_[1]}));	}else {	@newlist = ( { 'type' => 'D', 'values' => [ $_[0].$in{$_[1]} ] } );	}&save_directives($conf, \@oldlist, \@newlist);}# save_option(name, regexp, what)sub save_option{local ($oldstr, $old) = &find_option($_[0], $conf);local @oldlist = $oldstr ? ( $oldstr ) : ( );local (@newlist, $re); $re = $_[1];if ($in{"$_[0]_def"}) { @newlist = (); }elsif ($in{$_[0]} !~ /^$re$/) {	&error(&text('opts_einvalid', $in{$_[0]}, $_[2]));	}else { @newlist = ( { 'type' => 'O', 'values' => [ " $_[0]=$in{$_[0]}" ] } ); }&save_directives($conf, \@oldlist, \@newlist);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -