I wouldn't set levels at 777, either way, but... Likely it is unable to make
the dir $dirname because it doesn't have permission to make a dir in the dir
where you want to make it. I would think chown'ing the dir that you will be
mkdir'ing $dirname in to allow whatever user your perl script is run as to
write to it should fix your problem... (Can I say that in a more obfuscated
manner?)
Example:
/home/tmp/spamtesting
you want to mkdir $dirname in /home/tmp/spamtesting
you need permission to create a directory in /home/tmp/spamtesting in order
for your perl script to work. When you run that perl script as
root/superUser you can do it all day because you have permission to write
anywhere. When you run as say... nobody, nobody has no permission. To fix
this, I would
chown -R /home/tmp/spamtesting nobody
As such, your perl script run as nobody has permission to write in
/home/tmp/spamtesting as nobody recursively. (might want to check man chown
to be sure I got that switch right, could be a lower case -r instead...)
Jason
> I thought 'mkdir($dirname, 0777);' would do that?
>
> Or do I need to set all the previous levels to 777 as well?
>
> Phin
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]] On Behalf Of
> > [EMAIL PROTECTED]
> > Sent: 09 August 2002 18:19
> > To: [EMAIL PROTECTED]
> > Subject: [xmail] Re: SpamAssassin
> >
> >
> >
> >
> >
> > 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]
> >
> > ---
> > Incoming 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
> >
> >
>
> ---
> 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]