james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: MIME4J - remove parent reference from Body?
Date Wed, 01 Oct 2008 12:21:04 GMT
Markus Wiederkehr ha scritto:
> Okay, I am overwhelmed by your many responses ;-)

Sometimes silence is better than a bunch of complaints or some naive
alternative proposal! ;-)

In this specific case, you always come with patches, so please keep up
pinging us until your patches are applied or refused with some answer. I
swear I won't curse you :-)

> In the meantime I have given it some thought and I think removing the parent
> reference from Body is not such a good idea after all because with this
> approach disposing a Message that shares body parts with another message
> would destroy the other message.
> So I propose something different. How about making Field, Header, Message
> and Body cloneable?
> What I have in mind is copying the structure of an e-mail without copying
> the backing TempFiles. So for example two TempFileBinaryBodys could refer to
> the same TempFile while maintaining a reference counter. The TempFile should
> get deleted if both TempFileBinaryBodys are disposed.

The idea is interesting, but I'm not sure how we can deal with details.
Do you want to place each of that objects (Body,Field,Header,Message)
behind a Copy-On-Write proxy object? Or do you want to do this for
TempFiles ? Or something I misunderstood?

Javamail uses the "SharedInputStream" concept for streams used to create
messages. When a stream is a "SharedInputStream" then every part or even
more messages can simply keep reading from the same stream and remember
what part of the stream they "identify". Is this something related to
what you have in mind?

> This way one could clone an entire message and manipulate it or just clone a
> BodyPart and attach it to another message.
> I would like to implement this if you are interested in such a feature.

This would be cool,

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message