2 Replies Latest reply on Mar 16, 2005 3:53 PM by Michael Barker

    MailStore Integration

    Michael Barker Apprentice

      Hi,

      I have just committed the first pass of the Mail Store integration.

      Eventually there should be:

      1. Always use store
      2. Never use store
      3. Use store when the message is > N kb


      We have 1 & 2 at the moment. By default it is switched off. To turn it on, configure the UseStore attribute of the MailBodyManager and configure the MailStore that you wish to use (Postgres is recommend).

      The mailstore at the moment is only benifical to the SMTP side of things. When retrieving mail via POP the whole message is still loaded into memory. From the plan I can see that mailbox implementation is changing so for M3 so I didn't much point in making major changes to the Message interface.

      Mailbox interaction is a bit hairy at the moment. I wasn't sure what the plan is with regards to data migration from M2 -> M3, therefore the store changes are designed to be compatiable with M2. To migrate an additional column BODYTYPE NUMBER(2) is required on the ENTITYMESSAGES table. This should be set to 0 for old messages. The MailBodyManager will take care wrapping old mails into SimpleMailBody objects. StoredMailBody objects make available a String handle which is stored in the body column. Going forward we should simply serialise the MailBody object and store it as a byte array. For now I have just implemented the simplest, least breaking change I could manage.

      Next I am going to modify the Hibernate Store to implement a paging mechanism.

      As always, questions, comments are welcome.

      Mike