Hi,
Being a bit of perl newbie and therefore completely lost as to how to write a script, I have put together in the grim hope that it would work this: #!/usr/bin/perl -w ######## READ IN NAME $filename = $ARGV[0]; ######## SET UP DIRECTORY $dirname = "spam/"; ######## MAKE DIRECTORY mkdir($dirname, 0777); ######## COPY ORIGNAL system("cp ".$filename. " ".$dirname.$filename); ######## SPAMASSASSIN system("/usr/bin/spamassassin -P < ".$filename." > ".$dirname.$filename."spamscan"); ######## TIDY UP ALL THE FILES AND MOVE THE FILE BACK TO WHERE IT WAS system("cd ".$dirname.";mv -f ./".$filename."spamscan .../".$filename.";cd ..; rmdir ".$dirname); ####### EXIT WITH FILE ALTERED CODE exit 100; With a filter of ... "/var/MailRoot/externalfilters/checkspam.pl" "@@FILE" But it doesn't work when it's filtering but it does when I have logged in... I am assuming that it's something to do with the permissions. I have done a chmod 777 on the .pl file but it still not working? Any Ideas? Phin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002 - To unsubscribe from this list: send the line "unsubscribe xmail" in the body of a message to [EMAIL PROTECTED] For general help: send the line "help" in the body of a message to [EMAIL PROTECTED]