getting Mailscanner to work with Mailwatch/Postfix

Glenn Steen glenn.steen at gmail.com
Tue Mar 18 22:32:03 GMT 2008


On 18/03/2008, John Baker <johnnyb at marlboro.edu> wrote:
> Yeah, I'm seeing what happened here now. I didn't differentiate between
>  the permissions on the directories and those on the files and did a mass
>  chmod -R 660 on the quarantine directory. The default for the quarantine
>  directory appears to be 751 but the subdirectories are 700 while the
>  files get written as whatever is in the Mailscanner.conf.
>
>  It looks like the solution is to share group ownership with www-data and
>  give the directories 770 permission.
>
>  Can anyone explain what decides the subdirectory permissions when new
>  ones are created?  The only worry I have now is that the new one
>  tomorrow and its subdirectories are still written to 700 rather than the
>  770 that I changed the rest to.
>

This is the relevant piece of code from a system not too far away from
me... It is in the WorkArea.pm file... The slightly different names
are... normal... Look at ConfigDefs.pl to see how they are translated
(and for defaults) from the "Quarantine Permissions" ->
quarantinepermissions -> quarantineperms ... Anyway, here is the
snippet:
----
  my($perms, $dirumask, $fileumask);

  $perms = MailScanner::Config::Value('workperms') || '0600';

  $perms = sprintf "0%lo", $perms unless $perms =~ /^0/; # Make it octal

  $dirumask = $perms;

  $dirumask =~ s/[1-7]/$&|1/ge; # If they want r or w give them x too

  $this->{dirumask}  = oct($dirumask) ^ 0777;

  $fileumask = $perms;

  $this->{fileumask} = oct($fileumask) ^ 0777;
----
Pretty self-explanatory (well-commented code, and sanely written
IMO... As always with Jules:).
With a "mask" of 0660, this will translate to 0770 for directories...
At least if I'm reading it right:-). My system agrees with me:-):-).

>  Thanks
>

Cheers
-- 
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se


More information about the MailScanner mailing list