Release 4.62.7 beta
Julian Field
MailScanner at ecs.soton.ac.uk
Sun Jul 29 12:59:42 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have modified your code a bit (but it has the same overall effect) and
release 4.62.7-3.
Have you found anything else wrong for me?
Thanks!
UxBoD wrote:
> Changed it back to the original IO::File as it was purely a perms problem :-
>
> --- SweepViruses.pm.orig 2007-07-29 10:39:57.000000000 +0100
> +++ SweepViruses.pm 2007-07-29 10:41:48.000000000 +0100
> @@ -1314,11 +1314,22 @@ sub InitClamAVModParser {
> my($id, $message);
> while(($id, $message) = each %{$batch->{messages}}) {
> next if $message->{deleted};
> +
> + my $target = new FileHandle;
> + my $filename = $BaseDir . '/' . $id . '.message';
> +
> my $target = new IO::File "$BaseDir/$id.message", "w";
> MailScanner::Log::DieLog("writing to $BaseDir/$id.message: $!")
> if not defined $target;
> +
> $message->{store}->WriteEntireMessage($message, $target);
> +
> $target->close;
> +
> + # Set the owner of the message file
> + chown $global::MS->{work}->{uid}, $global::MS->{work}->{gid}, $filename
> + if $global::MS->{work}->{changeowner};
> + chmod 0660, $filename;
> }
> }
> }
>
>
> Regards,
>
> --[ UxBoD ]--
> // PGP Key: "curl -s https://www.splatnix.net/uxbod.asc | gpg --import"
> // Fingerprint: C759 8F52 1D17 B3C5 5854 36BD 1FB1 B02F 5DB5 687B
> // Keyserver: www.keyserver.net Key-ID: 0x5DB5687B
> // Phone: +44 845 869 2749 SIP Phone: uxbod at sip.splatnix.net
>
> ----- Original Message -----
> From: "UxBoD" <uxbod at splatnix.net>
> To: "MailScanner Beta-testers" <mailscanner-beta at lists.mailscanner.info>
> Sent: 29 July 2007 10:35:54 o'clock (GMT) Europe/London
> Subject: Re: Release 4.62.7 beta
>
> Jules,
>
> I changed the code too this which fixed the problem, but I do not understand why I needed the chmod?!??! It is the same code as what is used to create the <MESSAGE.ID>.header file :-
>
> sub InitClamAVModParser {
> my($BaseDir, $batch) = @_;
>
> if (MailScanner::Config::Value('clamavspam')) {
> # Write the whole message into $id.message in the headers directory
> my($id, $message);
> while(($id, $message) = each %{$batch->{messages}}) {
> next if $message->{deleted};
>
> my $target = new FileHandle;
> my $filename = $global::MS->{work}->{dir} . '/' . $id . '.message';
>
> MailScanner::Lock::openlock($target, ">$filename", "w")
> or MailScanner::Log::DieLog("Cannot create + lock message file %s, %s", $filename, $!);
> $message->{store}->WriteEntireMessage($message, $target);
>
> MailScanner::Lock::unlockclose($target);
>
> # Set the owner of the message file
> chown $global::MS->{work}->{uid}, $global::MS->{work}->{gid}, $filename
> if $global::MS->{work}->{changeowner};
> chmod 0660, $filename;
> }
> }
> }
>
> I presume it is more efficient to use IO::File as nothing else should be accessing the .message file anyway, and therefore a lock is not required. If that is the case, then would the same hold true for the header file?
>
> Regards,
>
> --[ UxBoD ]--
> // PGP Key: "curl -s https://www.splatnix.net/uxbod.asc | gpg --import"
> // Fingerprint: C759 8F52 1D17 B3C5 5854 36BD 1FB1 B02F 5DB5 687B
> // Keyserver: www.keyserver.net Key-ID: 0x5DB5687B
> // Phone: +44 845 869 2749 SIP Phone: uxbod at sip.splatnix.net
>
> ----- Original Message -----
> From: "UxBoD" <uxbod at splatnix.net>
> To: "MailScanner Beta-testers" <mailscanner-beta at lists.mailscanner.info>
> Sent: 29 July 2007 10:19:47 o'clock (GMT) Europe/London
> Subject: Re: Release 4.62.7 beta
>
> Yeah perms does seem to be the problem. I have changed the code to be the same as what Jules uses to create the .header file to see if that cures the problem.
>
> Regards,
>
> --[ UxBoD ]--
> // PGP Key: "curl -s https://www.splatnix.net/uxbod.asc | gpg --import"
> // Fingerprint: C759 8F52 1D17 B3C5 5854 36BD 1FB1 B02F 5DB5 687B
> // Keyserver: www.keyserver.net Key-ID: 0x5DB5687B
> // Phone: +44 845 869 2749 SIP Phone: uxbod at sip.splatnix.net
>
> ----- Original Message -----
> From: "Glenn Steen" <glenn.steen at gmail.com>
> To: "MailScanner Beta-testers" <mailscanner-beta at lists.mailscanner.info>
> Sent: 29 July 2007 10:02:10 o'clock (GMT) Europe/London
> Subject: Re: Release 4.62.7 beta
>
> On 29/07/07, UxBoD <uxbod at splatnix.net> wrote:
>
>> The file doesn't appear to even get created.
>>
>> Also, the reporting on infections appears to be incorrect aswell as shown below. The message is actually clean :-
>>
>> Jul 29 09:01:33 mailhub MailScanner[2145]: New Batch: Scanning 1 messages, 3149 bytes
>> Jul 29 09:01:37 mailhub MailScanner[2145]: Virus and Content Scanning: Starting
>> Jul 29 09:01:37 mailhub MailScanner[2145]: ERROR:: UNKNOWN CLAMD RETURN ./35485178092.E26FC.message/Unable to open file or directory ERROR :: /var/spool/MailScanner/incoming/2145
>> Jul 29 09:01:37 mailhub MailScanner[2145]: Virus Scanning: Clamd found 1 infections
>> Jul 29 09:01:38 mailhub MailScanner[2145]: Virus Scanning: Nod32 found 1 infections
>> Jul 29 09:01:38 mailhub MailScanner[2145]: Virus Scanning: Found 1 viruses
>> Jul 29 09:01:38 mailhub MailScanner[2145]: Requeue: 35485178092.E26FC to 6FDD4178094
>> Jul 29 09:01:38 mailhub postfix/qmgr[22696]: 6FDD4178094: from=<users-return-61884-uxbod=splatnix.net at spamassassin.apache.org>, size=2529, nrcpt=1 (queue active)
>> Jul 29 09:01:38 mailhub MailScanner[2145]: Uninfected: Delivered 1 messages
>> Jul 29 09:01:38 mailhub MailScanner[2145]: Logging message 35485178092.E26FC to SQL
>>
>>
>> Regards,
>>
>>
> Ok, looks a bit ... strange.... What do you have for incoming work dir
> perms/user/group in MS, and how did you solve the clamd permission
> "clash" with PF?
> The error seems to be about the MS childs work dir not being ...
> accessible... to the child. So .. does all messages exhibit this
> problem or not?
> I assume this all worked in the previous beta? I'd help check on my
> testsystem, but I'm actually outdoors (well... actually am changing
> some doors on the house... Rot hag gotten into them,,, Pretty far from
> MailScanner:-).
>
> Cheers
>
Jules
- --
Julian Field MEng CITP
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
For all your IT requirements visit www.transtec.co.uk
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.6.2 (Build 2014)
Charset: UTF-8
wj8DBQFGrI8/EfZZRxQVtlQRAjG3AKCG1RO7EBVw2QemHTuhJIhQ4QnP/wCg6QC/
NYbfLgysEJiPgW0ux8M6+qA=
=crLz
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit www.transtec.co.uk
More information about the MailScanner-Beta
mailing list