ReadMessageHandle question

Julian Field MailScanner at ecs.soton.ac.uk
Wed May 3 09:02:18 IST 2006


On 2 May 2006, at 22:09, Leonardo Helman wrote:

> Hi
>
> I've been away from the list for a while.
>
> For all the people out there using zmailer+mailscanner (me)
> I'm porting now some of the last enhacenmnets.
>
> I'm very interested in ReadMessageHandle modif
>
> But I saw two things I don't understand very well
>
> Julian, inside that function, when you wrote this code:
>
>
> my $dhandle = $this->{dpath};
> ..
> sysseek($dhandle, 0, 0); # Rewind the file
> ..
> copy($dhandle , $handle);
> ..
> sysseek($dhandle, 0, 0); # Rewind the file
>
>
> but in the "constructor", it is written like:
> $this->{dpath} = $dir . '/' . $this->{dname};
>
>
> So, this is a file, not really a handle, right?
> so the sysseek are pointless.
> Or am I forgetting something?

No, you are absolutely right, it's a bug. Fortunately one that  
doesn't have any effect. It just renders the sysseeks on $hhandle and  
$dhandle useless.

>
>
> Other thing:
>
> In Message.pm, when you wrote:
>
>     if (!$entity && !MIME::Entity::MailScannerCounter()>=$maxparts) {
>       unless ($this->{dpath}) {
>
> Isn't $this->{dpath} always the name of the datafile (at least for  
> sendmail,
> I really didn't look much of the code for the others), so this  
> "unless"
> is always false (so it could be eliminated)?

Not if it ran out of disk space trying to do it! In that case $this-> 
{dpath} would be empty (and hence 0).


>
>
> Last but not least, I think, we have to change Messages.pm a little  
> and
> move to the DiskStores the references to $this->{dpath}, like
> we have done when I sent to you the zmailer parts.
>
> For those changes for example look, in SMDiskStore.pm, look for: "#  
> LEOH 26/03/2003 We do not have dpath in other mailers" (more than 3  
> years wow!)
> I'm thinking something in the line of getFileNameToLog or  
> something, I don't
> remember, but I think, we have done something like that.

I can't remember this one. From what I *can* remember, dpath exists  
in the Message object for other mailers doesn't it? Does it matter  
what other mailers do here?

> I'm sorry that I couldn't do this port when you change that code  
> for the
> others, but tomorrow (I hope) I'll finish, test and send to you  
> this patch

No problem. Thanks for helping to debug my code :-)

-- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


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



More information about the MailScanner mailing list