Michael Valenty ha scritto:
> I am trying to use James as a pop3/imap front end to my company's messaging
> system. We have a proprietary email platform and rather than write a
> pop3/imap server from scratch, I was hoping to leverage James and just write
> a custom connector (MailRepository/MailStore???). We wrote a custom
> connector for funambol (sync4j) to do calendar sync which worked well and I
> was looking for a similar solution for pop3/imap.

Do you need only pop3 or also other JAMES Server services?
If you need only POP3 maybe you should better take the source code and
adapt it to your needs.

You can write a MailServer implementation that provide userinboxes
(MailRepository) implementations when the POP3 server needs it.

Maybe you can do everything without changing JAMES sourcecode and only
adding your own components.

Starts from assembly:
  <!-- POP3 Server -->
  <block name="pop3server" class="org.apache.james.pop3server.POP3Server" >
    <provide name="localusersrepository"
role="org.apache.james.services.UsersRepository"/>
    <provide name="sockets"

role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
    <provide name="connections"
             role="org.apache.james.services.JamesConnectionManager"/>
    <provide name="James" role="org.apache.james.services.MailServer"/>
    <provide name="thread-manager"
             role="org.apache.avalon.cornerstone.services.threads.Thread

You can remove any block not directly referenced by the pop3server block
(James, localusersrepository, smtpserver, nntpserver, spoolmanager,
mailetloader, matcherloader, remotemanager, etc..).

Then you should provide your own implementation for this services:
org.apache.james.services.MailServer
org.apache.james.services.UsersRepository

The interfaces should be easy enough and you don't need to implement
them completely.

MailServer's "MailRepository getUserInbox(String userName);" method is
what you need to implement for sure.

Just create a new class: MailServerImpl implements MailServer. Start
implementing only the getUserInbox to return a different MailRepository
implementation for each user. For the other methods you can return "new
UnsupportedOperationException" as they are not needed in POP3Server.

Then you create a MailServerImpl.xinfo file to declare the MailServer
service exposed by your component.

This way you can declare a new block "mymailserver" and provide it to
the pop3server instead of "James" block.

The same applies to UsersRepository that is needed to perform
authentication.

I hope all of this makes some sense to you :-)
Stefano


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

Reply via email to