More than one Custom Function

Julian Field MailScanner at ecs.soton.ac.uk
Fri May 15 15:10:22 IST 2009



On 15/05/2009 14:39, Paul wrote:
>
>> Thanks Rick thats works like a treat - logging to both mysql and 
>> postgres!
>>
>> I just realised another issue I have, the postgres set up has to use
>>
>> Quarantine Whole Messages As Queue Files = yes
>>
>> as when it releases a message it just copies the qf and df file to 
>> the mqueue.
>>
>> Mailwatch requires
>>
>> Quarantine Whole Messages As Queue Files = no
>>
>> without changing to much code does anyone know how I can run with 
>> both? i.e. quarantine files as both qf df and also as one file?
>>
>> Cheers
>>
>> Paul
>>
>>
>
> Hi Julien
>
> I think you replied to this to say you have the source, i seem to have 
> deleted your reply sorry!
>
> I use sendmail and I have altered the CopyEntireMessage subroutine in 
> SMDiskStore.pm (bit I changed is noted by >>>>>)
>
> sub CopyEntireMessage {
>  my $this = shift;
>  my($message, $targetdir, $targetfile, $uid, $gid, $changeowner) = @_;
>
>  #my $hfile = $message->{headerspath};
>  #my $dfile = $this->{dpath};
>  #my $hpath = $this->{hpath};
>  #
>  if (MailScanner::Config::Value('storeentireasdfqf')) {
>    # Don't need cp or cat any more! Yay :-)
>    #system($global::cp . " \"$hpath\" \"$dfile\" \"$targetdir\"");
> >>>>>    my $target = new IO::File "$targetdir/$targetfile", "w"; 
> >>>>>    MailScanner::Log::DieLog("writing to $targetdir/$targetfile: 
> $!")
> >>>>>      if not defined $target;
> >>>>>    $this->WriteEntireMessage($message, $target);
>    return $this->CopyToDir($targetdir, $targetfile, $uid, $gid, 
> $changeowner);
>  } else {
>    #system($global::cat . " \"$hfile\" \"$dfile\" > 
> \"$targetdir/$targetfile\"");
>    my $target = new IO::File "$targetdir/$targetfile", "w";
>    MailScanner::Log::DieLog("writing to $targetdir/$targetfile: $!")
>      if not defined $target;
>    $this->WriteEntireMessage($message, $target);
>    return ($targetdir . '/' . $targetfile);
>  }
> }
>
> All I did was copy the code minus the return from the else part of the 
> routine.
>
> It seems to be working but I just wondered if you can think of 
> anything else I may have broke by doing this? I only want to run it in 
> tandom whilst I phase out the old system I have.
I think that should work okay. They both rewind the file as needed 
anyway, so that shouldn't be a problem.

Jules

-- 
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM and twitter.com/MailScanner


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list