Hi,

The mail is conciously written out in a single field to avoid the overhead of 
unneccesary processing, though there is no good reason for using a BLOB rather than 
TEXT since it has to be encoded for transfer as ASCII anyway.

On the whole the only action James takes is to re-create a Mail Object from this data.

If you're using MySQL you can use TEXT, MEDUMTEXT and LONGTEXT for this field, what 
you have to do is either modify your existing db or edit the file sqlResources.xml (in 
apps/james/conf I believe)
Then MySQL should be able to perform text and regex searches on it.
I also believe, but I'm not sure, that MySQL will also let you create a full text 
index and use the fancy search facility this provides.

On the other hand you might also use Lucene.

As far as splitting the message up is concerned with Mime supporting a nested 
structure it is not really practical to attempt to flatten this out, it would require 
a relational datastructure and recursive processing which are too expensive, in 
performance, without some good justification. Extracting common headers would be less 
expensive, but simply because James itself has no need of it we haven't provided it.

There is a third, much more time consuming route which you may or may not like, which 
is to create your own repository class.
(which we'd love to see if you wanted to contribute it)
The architecture is intended to be extensible in this respect, but in practice it may 
not be as straightforward as it seems.

Extend org.apache.james.mailrepository.JDBCRepository and override store() and 
retrieve() to support a different data structure.
As I hinted this class isn't well suited to having these methods overriden, it could 
use some re-factoring, and you may well need to cut'n'paste some of the code to get 
connections from James' pool and such like, but it would probably give you a more 
complete solution than just using TEXT.

Be warned, however, that repositories are not (yet?) part of the Mailet API, they're 
internal to James, and future changes to configuration and more complex repository 
interfaces may break your repository without warning.
(Its one of my goals for v3 to add repository specifictions to the Mailet API, but 
this might not help repository developers only mailet developers)

To use your implementation you would then edit config.xml and either replace the 
classname, or create a whole new protocol for your repository, and specify it as 
normal for your archive mailet using a URL. 

this is the node you're looking for:
 <repository class="org.apache.james.mailrepository.JDBCMailRepository">
 <protocols>
  <protocol>db</protocol> 
  </protocols>
 <types>
  <type>MAIL</type> 
  </types>
 <config>
  <sqlFile>file://conf/sqlResources.xml</sqlFile> 
  </config>
 </repository>

d.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to