Private
Server IP : 195.201.23.43  /  Your IP : 18.223.168.194
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/sendmail/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/sendmail/save_opts.cgi
#!/usr/bin/perl
# save_opts.cgi
# Save various sendmail options

require './sendmail-lib.pl';
&ReadParse();
$access{'opts'} || &error($text{'opts_ecannot'});
&error_setup($text{'opts_err'});
&lock_file($config{'sendmail_cf'});
$conf = &get_sendmailcf();
$ver = &check_sendmail_version($conf);

# 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'});
$in{'DontBlameSendmail'} =~ s/\0/ /g;
&save_option("DontBlameSendmail", '.*\S.*', $text{'opts_blame'});
&save_option("SendMimeErrors", '.*');
$in{'DeliveryMode_def'} = 1 if (!$in{'DeliveryMode'});
&save_option("DeliveryMode", '.*');
$in{'QueueSortOrder_def'} = 1 if (!$in{'QueueSortOrder'});
&save_option("QueueSortOrder", '.*');
&save_option("MaxHopCount", '\d+', $text{'opts_hops'});
&save_option("MatchGECOS", '.*');
if ($ver >= 10) {
	&save_option("MaxRecipientsPerMessage", '\d+', $text{'opts_maxrcpt'});
	&save_option("BadRcptThrottle", '\d+', $text{'opts_maxbad'});
	}
&flush_file_lines();
&unlock_file($config{'sendmail_cf'});
&restart_sendmail();
&webmin_log("opts", undef, undef, \%in);
&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);
}

# save_options(name, regexp, what)
sub save_options
{
local @oldlist = map { $_->[0] } &find_options($_[0], $conf);
local @newlist;
if (!$in{"$_[0]_def"}) {
	local $re = $_[1];
	foreach my $v (split(/\r?\n/, $in{$_[0]})) {
		$v =~ /^$re$/ ||
			&error(&text('opts_einvalid', $in{$_[0]}, $_[2]));
		push(@newlist, { 'type' => 'O', 'values' => [ " $_[0]=$v" ] });
		}
	}
&save_directives($conf, \@oldlist, \@newlist);
}

Private