HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: 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,pcntl_unshare,
Upload Files
File: //usr/share/webmin/virtual-server/spamconfig.pl
#!/usr/bin/perl
# For each domain with spam enabled, update the links in it's spamassassin
# config directory to match the global config.
# Also, delete /tmp/clamav-* directories that have not been accessed in more
# than 1 day.

package virtual_server;
$main::no_acl_check++;
$no_virtualmin_plugins = 1;
require './virtual-server-lib.pl';

# Create spamassassin config links
foreach my $d (grep { $_->{'spam'} } &list_domains()) {
	&create_spam_config_links($d);
	}

# Cleanup ClamAV crap in /tmp
$cutoff = time() - 24*60*60;
opendir(TMP, "/tmp");
foreach my $f (readdir(TMP)) {
	$path = "/tmp/$f";
	if ($f =~ /^clamav-([0-9a-f]+)$/ && -d $path) {
		# A clamav-* directory .. have any files in it been
		# accessed lately?
		my $newest = 0;
		opendir(CLAM, $path);
		foreach my $c (readdir(CLAM)) {
			next if ($c eq "." || $c eq "..");
			$cpath = "$path/$c";
			@st = stat($cpath);
			$newest = $st[8] if ($st[8] > $newest);
			$newest = $st[9] if ($st[9] > $newest);
			$newest = $st[10] if ($st[10] > $newest);
			}
		closedir(CLAM);
		if ($newest < $cutoff) {
			# This whole directory needs to go
			&execute_command("rm -rf ".quotemeta($path));
			}
		}
	}
closedir(TMP);