my $cmd = "sudo /usr/bin/amavisd-release $id 2"; to my $cmd = "sudo /usr/bin/amavisd-release $id";