I think it might be easy enough to just apply this dif, which would load the
MimeMessage only if the size limit were in effect. This would stop the early
instantiation unless it were necessary, which I think it is, if we want to do the size
limit. It would also keep us from forking the Handler into two largely identical
classes. I guess we could refactor that later, but I don't know if it's really
necessary to meet this design goal.
347,349c347,351
< //call mail.getSize() to force the message to be
< //loaded. Need to do this to limit the size
< mail.getSize();
---
> //call mail.getSize() to force the message to be
> //loaded. Need to do this to limit the size
> if (maxmessagesize > 0) {
> mail.getSize();
> }
Either way, thanks for applying the patches. I'm glad I can finally contribute
somethiing. I'll be looking at other things to implement/fix in the future. If people
get the chance, please give this some testing time if you're thinking about using it.
As a side note, I'm getting ugly diffs because I have my editor set to convert tabs to
spaces on save. Not sure what the standard for James and Jakarta projects is, but I've
been trying to get used to following the Sun standard of 4 space indenting, no tabs.
Just a thought.
Matt Pangaro
Loki Technologies
http://www.lokitech.com
----- Original Message -----
From: "Charles Benett" <[EMAIL PROTECTED]>
To: "Java Apache Mail Server" <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 10:12 AM
Subject: Re: Some patches for message size limiting
> Matthew,
> Thanks for the patches and classes.
> I've added them to cvs, except that I've made a new
> SizeLimitedSMTPHandler with your patches.
> That's because your call to msg.getSize() instantiates a MimeMessage,
> whereas Serge recently did a whole load of stuff to delay instantiating
> a MimeMessage as long as possible.
> I think what we should do is make SMTPServer configurable, so that
> admins can choose an instantiate early policy (eg if they want to use
> your restricted size stuff) or an instantiate late policy (to minimise
> resouce consumpution by never instantiating messages which can be
> processed without the MimeMessage )
> Thoughts?
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]