File: //usr/sbin/vnewclam
#!/usr/bin/perl
# will work even without an easytecc install
use lib '/usr/local/www/apache24/cgi-bin/easytecc3';
eval
{
require easytecc;
};
my $type = $ARGV[0];
unless($type =~ /^(milter|template|whitelist)$/){
print "Usage: vnewclam [milter|template|whitelist]";
exit(0);
}
my $mxhost = `cat /etc/mxhost 2>/dev/null`;
chomp $mxhost;
if ($mxhost) {
my $socket = easytecc::make_socket();
print $socket "write_clamav=$type\n";
easytecc::close_socket($socket) if $socket;
}
exit(0);