Is this on a windows or linux system? What user is your perl script running
as? My assumption would be that the user your perl script runs as does not
have permissions to write to the directory/file(s) that you wish to write
to, but that when you login to test it you login as root/admin and then you
are running as that priveledged user who can write to the directory/file(s).
To fix this, you will want to make sure that the directory you are writing
to has it's ownership set to allow for the perl script to write to it.

Jason

>
> 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]
>

-
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]

Reply via email to