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 Michael Valenty <mi...@valenty.com> on 2007/05/18 23:33:22 UTC

POP3 Gateway

I would to use James as a POP3 gateway to an existing messaging/crm system.
So far, I think I need to write a custom MailStore or MailRepository (or
both) to work with my company's crm application. I have been looking around
and I haven't seen much discussion or examples of similar projects which
leads me to beleive I'm on the wrong path. Any insight or starting point
would be appreciated.

In other words, how do I integrate James with a proprietary backend for
authentication and messages storage?
-- 
View this message in context: http://www.nabble.com/POP3-Gateway-tf3780260.html#a10690723
Sent from the James - Dev mailing list archive at Nabble.com.


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


Re: POP3 Gateway

Posted by robert burrell donkin <ro...@gmail.com>.
On 5/27/07, Stefano Bagnara <ap...@bago.org> wrote:
> robert burrell donkin ha scritto:
> >> My intention is to do everything without changing JAMES sourcecode. Looks
> >> very doable.
> >
> > you may find IMAP difficult since the released design is quite
> > monolithic. the code on trunk is better factored but there are no
> > plans ATM to backport.
>
> Robert, FYI IMAP exists only in trunk.
> 2.3.1 is our latest release and does not include IMAP at all.

my mistake

- robert

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


Re: POP3 Gateway

Posted by Stefano Bagnara <ap...@bago.org>.
robert burrell donkin ha scritto:
>> My intention is to do everything without changing JAMES sourcecode. Looks
>> very doable.
> 
> you may find IMAP difficult since the released design is quite
> monolithic. the code on trunk is better factored but there are no
> plans ATM to backport.

Robert, FYI IMAP exists only in trunk.
2.3.1 is our latest release and does not include IMAP at all.

Stefano


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


Re: POP3 Gateway

Posted by robert burrell donkin <ro...@gmail.com>.
On 5/23/07, Michael Valenty <mi...@valenty.com> wrote:
>
> >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.
>
> I started looking for a POP3 solution, but James looks like it has a lot to
> offer and I don't want to confine it only POP3. I will probably use IMAP &
> SMTP too.

SMTP is solid but i know that the IMAP code base has some serious
issues. these are fixable but the IMAP code base is in the middle of a
major refactoring and is being developed on trunk only.

are you using the code in trunk or the latest release?

> >Maybe you can do everything without changing JAMES sourcecode and only
> >adding your own components.
>
> My intention is to do everything without changing JAMES sourcecode. Looks
> very doable.

you may find IMAP difficult since the released design is quite
monolithic. the code on trunk is better factored but there are no
plans ATM to backport.

> I got a proof of concept working by registering MyMailRepository in
> config.xml > mailstore > repositories > repository and then setting
> config.xml > inboxRepository > respository.destinationURL to use the
> protocol I defined in the mailstore block.
>
> I was able to connect with a pop3 client and retreive my test mail from
> MyMailRepository. Very cool!!! Now I will work on a UsersRepository...

cool :-)

- robert

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


Re: POP3 Gateway

Posted by Stefano Bagnara <ap...@bago.org>.
Michael Valenty ha scritto:
>> 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.
> 
> I started looking for a POP3 solution, but James looks like it has a lot to
> offer and I don't want to confine it only POP3. I will probably use IMAP &
> SMTP too.
> 
>> Maybe you can do everything without changing JAMES sourcecode and only
>> adding your own components.
> 
> My intention is to do everything without changing JAMES sourcecode. Looks
> very doable.
> 
> I got a proof of concept working by registering MyMailRepository in
> config.xml > mailstore > repositories > repository and then setting
> config.xml > inboxRepository > respository.destinationURL to use the
> protocol I defined in the mailstore block.
> 
> I was able to connect with a pop3 client and retreive my test mail from
> MyMailRepository. Very cool!!! Now I will work on a UsersRepository...

As you plan to also use other JAMES Server services this is the best
choice :-)

I'm happy your PoC worked! You did exactly what I would have suggested
to do in case you replied that you need also other services :-)

Stefano


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


Re: POP3 Gateway

Posted by Michael Valenty <mi...@valenty.com>.
>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.

I started looking for a POP3 solution, but James looks like it has a lot to
offer and I don't want to confine it only POP3. I will probably use IMAP &
SMTP too.

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

My intention is to do everything without changing JAMES sourcecode. Looks
very doable.

I got a proof of concept working by registering MyMailRepository in
config.xml > mailstore > repositories > repository and then setting
config.xml > inboxRepository > respository.destinationURL to use the
protocol I defined in the mailstore block.

I was able to connect with a pop3 client and retreive my test mail from
MyMailRepository. Very cool!!! Now I will work on a UsersRepository...
-- 
View this message in context: http://www.nabble.com/POP3-Gateway-tf3780260.html#a10770298
Sent from the James - Dev mailing list archive at Nabble.com.


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


Re: POP3 Gateway

Posted by Stefano Bagnara <ap...@bago.org>.
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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: POP3 Gateway

Posted by Michael Valenty <mi...@valenty.com>.
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.


Stefano Bagnara-2 wrote:
> 
> Michael Valenty ha scritto:
>> I wrote a simple MailRepository to work out the kinks, and I'm having
>> trouble
>> configuring James. I added the following to assembly.xml:
>> 
>> <block name="pop3server" class="org.apache.james.pop3server.POP3Server">
>> 	<provide name="mymailrespository"
>> role="org.apache.james.services.MailRepository" />
>> 	...
>> </block>
>> 
>> ...
>> 	
>> <block name="mymailrespository" class="com.mycompany.MyMailRepository"/>
>> 
>> When I start James, I get an error message stating "Missing BlockInfo for
>> class com.mycompany.MyMailRepository".
> 
> You have to create a MyMailRepository.xinfo file to publish a block.
> Btw I don't understand what are you trying to achieve: POP3Server does
> not lookup a MailRepository object, so I don't see what the
> configuration above is used for.
> 
> Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/POP3-Gateway-tf3780260.html#a10744889
Sent from the James - Dev mailing list archive at Nabble.com.


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


Re: Registering a custom MailRepository

Posted by Michael Valenty <mi...@valenty.com>.
>Btw I don't understand what are you trying to achieve: POP3Server does
>not lookup a MailRepository object, so I don't see what the
>configuration above is used for.

I pulled that out of the POP3Server block and moved it to config.xml >
mailstore > repositories and then referenced it in inboxRespository. Looking
at MBoxMailRepository from the James source was a big help. I was able to
retreive my test mail using a pop3 client.
-- 
View this message in context: http://www.nabble.com/POP3-Gateway-tf3780260.html#a10770456
Sent from the James - Dev mailing list archive at Nabble.com.


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


Re: POP3 Gateway

Posted by Stefano Bagnara <ap...@bago.org>.
Michael Valenty ha scritto:
> I wrote a simple MailRepository to work out the kinks, and I'm having trouble
> configuring James. I added the following to assembly.xml:
> 
> <block name="pop3server" class="org.apache.james.pop3server.POP3Server">
> 	<provide name="mymailrespository"
> role="org.apache.james.services.MailRepository" />
> 	...
> </block>
> 
> ...
> 	
> <block name="mymailrespository" class="com.mycompany.MyMailRepository"/>
> 
> When I start James, I get an error message stating "Missing BlockInfo for
> class com.mycompany.MyMailRepository".

You have to create a MyMailRepository.xinfo file to publish a block.
Btw I don't understand what are you trying to achieve: POP3Server does
not lookup a MailRepository object, so I don't see what the
configuration above is used for.

Stefano


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


Re: POP3 Gateway

Posted by Michael Valenty <mi...@valenty.com>.
I wrote a simple MailRepository to work out the kinks, and I'm having trouble
configuring James. I added the following to assembly.xml:

<block name="pop3server" class="org.apache.james.pop3server.POP3Server">
	<provide name="mymailrespository"
role="org.apache.james.services.MailRepository" />
	...
</block>

...
	
<block name="mymailrespository" class="com.mycompany.MyMailRepository"/>

When I start James, I get an error message stating "Missing BlockInfo for
class com.mycompany.MyMailRepository".

Also, do I need to modify config.xml and add a block under mailstore >
repositories? My repository uses a proprietary system and does not follow
the file, mbox, db, or dbfile protocol.


Norman Maurer-3 wrote:
> 
> Hi Michael,
> 
> for a costum message store you need to implement the MailRepository
> interface. Maybe AbstractMailRepository should be a good starting point
> too.. Keep in mind that a MailRepository needs be thread-safe!
> For a costum authentication backend you you create your own
> UserRepository.
> 
> After you did the job you need to modify the assembly.xml to load your
> implementations.
> 
> bye
> Norman
> 
> Michael Valenty schrieb:
>> I would to use James as a POP3 gateway to an existing messaging/crm
>> system.
>> So far, I think I need to write a custom MailStore or MailRepository (or
>> both) to work with my company's crm application. I have been looking
>> around
>> and I haven't seen much discussion or examples of similar projects which
>> leads me to beleive I'm on the wrong path. Any insight or starting point
>> would be appreciated.
>>
>> In other words, how do I integrate James with a proprietary backend for
>> authentication and messages storage?
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/POP3-Gateway-tf3780260.html#a10743526
Sent from the James - Dev mailing list archive at Nabble.com.


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


Re: POP3 Gateway

Posted by Norman Maurer <no...@apache.org>.
Hi Michael,

for a costum message store you need to implement the MailRepository
interface. Maybe AbstractMailRepository should be a good starting point
too.. Keep in mind that a MailRepository needs be thread-safe!
For a costum authentication backend you you create your own UserRepository.

After you did the job you need to modify the assembly.xml to load your
implementations.

bye
Norman

Michael Valenty schrieb:
> I would to use James as a POP3 gateway to an existing messaging/crm system.
> So far, I think I need to write a custom MailStore or MailRepository (or
> both) to work with my company's crm application. I have been looking around
> and I haven't seen much discussion or examples of similar projects which
> leads me to beleive I'm on the wrong path. Any insight or starting point
> would be appreciated.
>
> In other words, how do I integrate James with a proprietary backend for
> authentication and messages storage?
>   


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