You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Tim-Christian Mundt <mu...@tzi.de> on 2010/01/06 20:38:41 UTC

Custom MailRepository

Hi,

I'm trying to create a custom MailRepository. As a first step I wanted 
to just modify what's there and found that the following (default) 
configuration:

<inboxRepository>
         <repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
</inboxRepository>

loads the JDBCMailRepository: INFO  17:48:46,078 | james.mailstore | 
Registering Repository instance of class 
org.apache.james.mailrepository.JDBCMailRepository to handle dbfile 
protocol requests for repositories of type MAIL with key dbfileMAIL

Strangly, later in the log I find
INFO  20:27:48,953 | james.mailstore | added repository: 
dbfile://maildb/spool/spoolSPOOL->org.apache.james.mailrepository.JDBCSpoolRepository
as the only dbfile thing; it uses SPOOL opposed to MAIL as found in 
james-config.xml - at least it subclasses JDBCMailStore. Seems I don't 
really get how Repositories are configured, can anybody give me some 
hints? I'd be glad to pour them into some documentation system if desired.

I figured internalStore() and retrieve() in JDBCMailStore should be THE 
methods, so I simply added

        System.out.println("--------------");
        System.err.println("--------------");
        getLogger().debug("***************");

in order to change something obvious and non-destructive. However, 
neither can I see any output when dragging emails into a James IMAP 
folder nor when clicking (retrieving?) on one. What am I doing wrong?

Thanks a lot in advance
Tim

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


Re: Custom MailRepository

Posted by Norman Maurer <no...@googlemail.com>.
Hi Tim,

 comments inside..

2010/1/12 Tim-Christian Mundt <mu...@tzi.de>:
> Hi!
>
>> this link gives some more info about maildir if you are interested:
>>
>> http://www.qmail.org/qmail-manual-html/man5/maildir.html
>>
>
> Thanks for the info!
> I'm generally interested in implementing maildir - or helping to do so if
> someone is willing to participate (I'm new to James). However, I'm still
> trying to estimate the comlexity before diving into a project which I can't
> handle (concerning workload etc).

If you want to implement a new "mailbox" for imap you should have a
look at http://svn.apache.org/repos/asf/james/imap/trunk/ . Especially
in the store and jpa module. For a maildir implementation I'm
currently thinkin about using lucene for building the "search index"
and using normal files for emails. Thoughts ?
>>
>> BTW, what kind of costum implementation you are lookin for ? Will it
>> be opensource?
>>
>
> The custom implementation will probably not be opensource as it will
> interface to a non-opensource software. Maybe there can emerge something
> more general on which the custom implementation is built. For instance a
> framework for creating web-service based managers. That would mean: if a
> mail is dropped into a mailbox, a webservice call would be issued and a
> remote application be informed that an email with ID xyz has arrived in
> mailbox abc and so on. Hope, it's clear what I intend to do.

Sounds cool :)

>
> By the way, I can't really find anything helpful here:
>>>
>>> http://james.apache.org/imap/index.html
>>>
>

See above..


> Best,
> Tim
>
> --------------------------------------------------------------------

Bye,
Norman

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


Re: Custom MailRepository

Posted by Tim-Christian Mundt <mu...@tzi.de>.
Hi!

> this link gives some more info about maildir if you are interested:
>
> http://www.qmail.org/qmail-manual-html/man5/maildir.html
>   
Thanks for the info!
I'm generally interested in implementing maildir - or helping to do so 
if someone is willing to participate (I'm new to James). However, I'm 
still trying to estimate the comlexity before diving into a project 
which I can't handle (concerning workload etc).
> BTW, what kind of costum implementation you are lookin for ? Will it
> be opensource?
>   
The custom implementation will probably not be opensource as it will 
interface to a non-opensource software. Maybe there can emerge something 
more general on which the custom implementation is built. For instance a 
framework for creating web-service based managers. That would mean: if a 
mail is dropped into a mailbox, a webservice call would be issued and a 
remote application be informed that an email with ID xyz has arrived in 
mailbox abc and so on. Hope, it's clear what I intend to do.

By the way, I can't really find anything helpful here:
>> http://james.apache.org/imap/index.html
>>     

Best,
Tim

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


Re: Custom MailRepository

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Wed, Jan 6, 2010 at 9:44 PM, Norman Maurer
<no...@googlemail.com> wrote:
> Hi Tim,
>
> this link gives some more info about maildir if you are interested:
>
> http://www.qmail.org/qmail-manual-html/man5/maildir.html
>
> BTW, what kind of costum implementation you are lookin for ? Will it
> be opensource?

FWIW i know that people have successfully created a number of
alternative IMAP backends. if you plan to open source elsewhere then
the IMAP internal API should still be considered experimental so you
may end up chasing future changes...

- robert

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


Re: Custom MailRepository

Posted by Norman Maurer <no...@googlemail.com>.
Hi Tim,

this link gives some more info about maildir if you are interested:

http://www.qmail.org/qmail-manual-html/man5/maildir.html

BTW, what kind of costum implementation you are lookin for ? Will it
be opensource?


Bye,
Norman

2010/1/6 Norman Maurer <no...@googlemail.com>:
> Hi Tim,
>
> the MailRepository is only used by POP3Server and not by IMAPServer.
> The MailRepository was just not rich enough to support IMAP so we
> dedicited to write a complete new Solution called MailboxManager.
> James use the Sieve mailet to deliver Mails to the MailboxManager used
> by the IMAPServer. For more infos about
> the MailboxManager and its implementations see:
>
> http://james.apache.org/imap/index.html
>
> Currently there are a Torque based and an OpenJPA based
> implementation. I would be very interested in seeing some kind of File
> based implementation which use some kind of Maildir
> (http://cr.yp.to/proto/maildir.html)  style for storing the Messages (
> not sure where to store metadata, maybe db again). Maildir style is
> supported by many MTA's out there already so it would be a plus to
> have this in James IMAP.
>
> If you have more questions feel free to poke me :)
>
> Bye,
> Norman
>
> 2010/1/6 Tim-Christian Mundt <mu...@tzi.de>:
>> Hi,
>>
>> I'm trying to create a custom MailRepository. As a first step I wanted to
>> just modify what's there and found that the following (default)
>> configuration:
>>
>> <inboxRepository>
>>        <repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
>> </inboxRepository>
>>
>> loads the JDBCMailRepository: INFO  17:48:46,078 | james.mailstore |
>> Registering Repository instance of class
>> org.apache.james.mailrepository.JDBCMailRepository to handle dbfile protocol
>> requests for repositories of type MAIL with key dbfileMAIL
>>
>> Strangly, later in the log I find
>> INFO  20:27:48,953 | james.mailstore | added repository:
>> dbfile://maildb/spool/spoolSPOOL->org.apache.james.mailrepository.JDBCSpoolRepository
>> as the only dbfile thing; it uses SPOOL opposed to MAIL as found in
>> james-config.xml - at least it subclasses JDBCMailStore. Seems I don't
>> really get how Repositories are configured, can anybody give me some hints?
>> I'd be glad to pour them into some documentation system if desired.
>>
>> I figured internalStore() and retrieve() in JDBCMailStore should be THE
>> methods, so I simply added
>>
>>       System.out.println("--------------");
>>       System.err.println("--------------");
>>       getLogger().debug("***************");
>>
>> in order to change something obvious and non-destructive. However, neither
>> can I see any output when dragging emails into a James IMAP folder nor when
>> clicking (retrieving?) on one. What am I doing wrong?
>>
>> Thanks a lot in advance
>> Tim
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
>

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


Re: Custom MailRepository

Posted by Norman Maurer <no...@googlemail.com>.
Hi Tim,

the MailRepository is only used by POP3Server and not by IMAPServer.
The MailRepository was just not rich enough to support IMAP so we
dedicited to write a complete new Solution called MailboxManager.
James use the Sieve mailet to deliver Mails to the MailboxManager used
by the IMAPServer. For more infos about
the MailboxManager and its implementations see:

http://james.apache.org/imap/index.html

Currently there are a Torque based and an OpenJPA based
implementation. I would be very interested in seeing some kind of File
based implementation which use some kind of Maildir
(http://cr.yp.to/proto/maildir.html)  style for storing the Messages (
not sure where to store metadata, maybe db again). Maildir style is
supported by many MTA's out there already so it would be a plus to
have this in James IMAP.

If you have more questions feel free to poke me :)

Bye,
Norman

2010/1/6 Tim-Christian Mundt <mu...@tzi.de>:
> Hi,
>
> I'm trying to create a custom MailRepository. As a first step I wanted to
> just modify what's there and found that the following (default)
> configuration:
>
> <inboxRepository>
>        <repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
> </inboxRepository>
>
> loads the JDBCMailRepository: INFO  17:48:46,078 | james.mailstore |
> Registering Repository instance of class
> org.apache.james.mailrepository.JDBCMailRepository to handle dbfile protocol
> requests for repositories of type MAIL with key dbfileMAIL
>
> Strangly, later in the log I find
> INFO  20:27:48,953 | james.mailstore | added repository:
> dbfile://maildb/spool/spoolSPOOL->org.apache.james.mailrepository.JDBCSpoolRepository
> as the only dbfile thing; it uses SPOOL opposed to MAIL as found in
> james-config.xml - at least it subclasses JDBCMailStore. Seems I don't
> really get how Repositories are configured, can anybody give me some hints?
> I'd be glad to pour them into some documentation system if desired.
>
> I figured internalStore() and retrieve() in JDBCMailStore should be THE
> methods, so I simply added
>
>       System.out.println("--------------");
>       System.err.println("--------------");
>       getLogger().debug("***************");
>
> in order to change something obvious and non-destructive. However, neither
> can I see any output when dragging emails into a James IMAP folder nor when
> clicking (retrieving?) on one. What am I doing wrong?
>
> Thanks a lot in advance
> Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

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