# BEGIN_MTA_INIT
# MTA: libmilter

# amavis-milter sends /tmp/directory as arg 1, sender as arg2 and 
# all recips as other args

# error codes
$VIRUSERR = 99;
# anything except 0 or 99 will be interpreted as "virus scan failed"
$REGERR = 1;

# set path explicitly
$ENV{PATH} = "/bin:/usr/bin:/usr/local/bin";

if ($#untaint_ARGV < 2) {
    exit($REGERR);
}

$TEMPDIR = shift(@untaint_ARGV);

if ($TEMPDIR =~ /(\Q$TEMPBASE\E\/.*)/) {
    $TEMPDIR=$1;
# untaint the directory option...
} else {
    exit($REGERR);
}

# END_MTA_INIT
