lookup-domain.pl failure

Whenever mail is delivered the procmail.log has this in it :

Insecure $ENV{PATH} while running setgid at /etc/webmin/virtual-server/lookup-domain.pl line 10.
procmail: Program failure (2) of "/etc/webmin/virtual-server/lookup-domain.pl"

permissions on lookup-domain.pl = 777

If I change permission to 644 I get :

/etc/webmin/virtual-server/lookup-domain.pl: line 2: syntax error near unexpected token `CONF,'
/etc/webmin/virtual-server/lookup-domain.pl: line 2: `open(CONF, "/etc/webmin/miniserv.conf");'

I have also tried changing ownership of this file to postfix, and nobody but the errors are the same.

So it seems that procmail is not able to execute the .pl script which kicks off clam and spamassassin.

Status: 
Closed (fixed)