storing messages - strace verdict: keepspamarchiveclean - HOW to FIX?

Alessandro Dentella sandro at
Wed May 29 09:51:20 IST 2013

On Mon, May 27, 2013 at 09:10:10PM +0200, Jerry Benton wrote:
> These are the primary things I check for when dealing with this problem:
> 1. Selinux. Put in permissive and then build custom policies. Return to
> enforcing.
> 2. MailScanner Run As and directory ownership and permissions.
> 3. MailScanner store messages as user matches permissions.
> 4. Making sure you add the -U option to MailScanner for the newer versions of
> perl. 
> sed -i 's:#!/usr/bin/perl -I:#!/usr/bin/perl -U -I:g' /usr/sbin/MailScanner

Today I decided to debug using strace, it resulted clearly that the file was
correctly written in quarantine but later deleted (unlink).

I also found the single line that does that, commenting it I get the mail in

sub RemoveInfectedSpam {
  my $this = shift;

  my($id, $message);

  while(($id, $message) = each %{$this->{messages}}) {
    #print STDERR "Message is infected\n" if $message->{infected};
#    next unless $message->{infected};
    next unless
      MailScanner::Config::Value('keepspamarchiveclean', $message) =~ /1/;
    #print STDERR "Deleting " . join(',',@{$message->{spamarchive}}) . "\n";
#    unlink @{$message->{spamarchive}}; # Wipe the spamarchive files   <<<<<  this deletes
    @{$this->{spamarchive}} = (); # Wipe the spamarchive array

So the problem is to understand why
MailScanner::Config::Value('keepspamarchiveclean', $message) =~ /1/; says
that it should be deleted.

How is that evaluated?

Thanks again for any help

Sandro Dentella  *:-)             Soluzioni libere per le scuole        SQLkit home page - PyGTK/python/sqlalchemy

More information about the MailScanner mailing list