On Tue, 30 Oct 2001, Gabriel Bucher wrote: > I think, the getSize() from MimeMessageYYYSource get back the wrong size! The > class MimeMessageWrapper extends from MimeMessage. If you read the JavaDoc from > JavaMail then you can see... that MimeMessage.getSize() is only the size of the > 'Message content'! MimeMessageWrapper.getSize() should get back the same as > MimeMessage.getSize()!
Yes, JavaMail says that MimeMessage.getSize() returns the length of the message content. But in the abstract MimeMessageSource, the root of MimeMessageYYYSource, getSize() returns the message length (header + content length). So does all other MimeMessage source classes. > If you take a look into the MimeMessageInputStreamSource, > you calculate the size of the hole message (headers + content). I didn't change how the class supposed to be working; I just added some features. > I think, the most time, you are more interesting in the size of Headers + > Content (MailImpl.getSize()) (for LIST/STAT) instead of only the size of the > content (MimeMessageWrapper.getSize()). Yes. I believe that's why the MimeMessageSource.getSize() returns the message length. > I think, there are a couple of more problems in the classes MailImpl, > MimeMessageWrapper, .... I believe there's no problem, because nobody uses MailImpl.getSize() :-) Anyway, I think MailImpl should check what kind of MimeMessage it is holding; if it is a MimeMessage (created by new MimeMessage()), then it should add the headers' length; if it is one of the MimeMessage sources, just get the source and invoke its getSize() method. Oki -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
