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

Glenn Steen glenn.steen at gmail.com
Fri Jun 7 13:49:10 IST 2013


On 29 May 2013 10:51, Alessandro Dentella <sandro at e-den.it> wrote:
> 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
> quarantine:
>
>
>
> 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?
>
You've set
Keep Spam And MCP Archive Clean = yes
... So if you don't want that, then set it to "no" (should be the default:).

> Thanks again for any help
> sandro
> *:-)
>
>

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