From: Marc Groot Koerkamp <marc@it...> - 2002-06-29 17:20:06
Currently I'm working on a rewrite of mime.php. This is interesting for
you because there are some changes in the architecture.
What am I doing?
I rewrote the fetch_mime_structure thing and I'm currently bussy to get
the thing working. (references / recursion ... :-( )
In the old way we didn't process all the available information in the mime
class. In the new way the following things are changed/added/proposed.
added: address class:
var: personal, adl, mailbox, host, group
added: class disposition:
var: name, properties = array
proposed changed: message:
move the following vars from header to message:
entity_id, mailbox, message_id.
add: uid, uidvalidy, is_seen, is_flagged, is answered, is_deleted,
is_recent, is_mdn, envelope, is_multipart
move the following vars from msg_header to the envelope class:
vars described in rfc2060 (date, subject, from, cc ,...)
to, cc, bcc : array of address objects
from, reply_to: address object.
add: md5, disposition, language
The function I 'm working on to process the bodystructure iterates one
time through to body_structure string and gets all the information,
including the multipart entity properties and the envelope structure of
the message/rfc822 entities. (very usefull to do nice things with digest
messages). Because I see each character in the bodystructure only once it
should be very fast.
After I finished this I introduce a messages_array where we can store the
This message array is stored with a session_register so we only need to
calculate the message_object one time!
key_name: uidvalidity / mailbox name( depends if imap-server supports
array of messages:
key_name: uid / message id (depends if imap-server supports uid)
value: message object.
if we delete or move a message then we should unset the value in the
message_array. In case the imap-server doesn't support the uid stuff then
we should delete all stored message objects.
The registered var msgs can be replaced by the new messages_array.
if we have secured messages then the message contains 2 entities, the
encoded one and the one with the information to decode it.
I already have programmed a routine to decode a full message without need
of a fetch id bodystructure (plugin message_source).
It should be simple to store the information in a message_object.
Possibility to cache the downloaded messages offline (only usefull if
imap-server supports uid).
Comments/ideas are welcome (some of the architecture changes came up in my
mind writing this mail so maybe they are not well overthought).
Marc Groot Koerkamp