You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Mark Gulbrandsen <le...@gmail.com> on 2005/07/06 20:08:19 UTC

Custom Mailet or Repository

Hi all,

I want to store emails in a database. But, I want to index the inbox
emails in a different way than the regular inbox table. For example
(MySQL):

create table webmail_inbox (
   id bigint not null auto_increment,
   client_id bigint,
   subject varchar(10000),
   sender varchar(255) not null,
   received_date datetime not null,
   message longtext,
   primary key (id)
) type=InnoDB

Should I create a custom JDBC Repository implementation or simply a
custom Mailet?

One reason why I have the subject, sender, and received_date fields is
to improve inbox rendering performance. So, the custom JDBC Repository
or the custom Mailet would populate these fields for me. Then, when I
render the message, I'll use the javamail APIs.

I'd like to be able to do this with a Mailet. Creating a JDBC
Repository seems like much more work.

Comments?

Thanks,

Mark

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


RE: Custom Mailet or Repository

Posted by Jason Webb <jw...@inovem.com>.

> -----Original Message-----
> From: Mark Gulbrandsen [mailto:lerxster@gmail.com]
> Sent: 06 July 2005 19:08
> To: server-user@james.apache.org
> Subject: Custom Mailet or Repository
> 
> Hi all,
> 
> I want to store emails in a database. But, I want to index the inbox
> emails in a different way than the regular inbox table. For example
> (MySQL):
> 
> create table webmail_inbox (
>    id bigint not null auto_increment,
>    client_id bigint,
>    subject varchar(10000),
>    sender varchar(255) not null,
>    received_date datetime not null,
>    message longtext,
>    primary key (id)
> ) type=InnoDB
> 
> Should I create a custom JDBC Repository implementation or simply a
> custom Mailet?
> 
> One reason why I have the subject, sender, and received_date fields is
> to improve inbox rendering performance. So, the custom JDBC Repository
> or the custom Mailet would populate these fields for me. Then, when I
> render the message, I'll use the javamail APIs.
> 
> I'd like to be able to do this with a Mailet. Creating a JDBC
> Repository seems like much more work.

Yes it is a lot of work. IMHO unless you are making changes that the James
user base has a whole could use I'd not bother with the JDBC Repository and
use a mailet instead. 

The only reasons to use a JDBC Repository are if you want that to act as a
spool as well as a mail store or if you want to use multiple DB platforms.
Then a mailet would not be as useful as you'd have to duplicate a lot of
code that already exists

Hope this helps.

> 
> Comments?
> 
> Thanks,
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org



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