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 Marco Zapletal <ma...@gmail.com> on 2012/09/05 10:19:58 UTC

Exposing a custom message/user store via IMAP using Mailbox

Hi folks,

I have an existing, "custom" message store running, which I want to 
expose via IMAP. The Mailbox project seems to be quite handy for that. 
Could someone please give me feedback whether the following steps are 
correct:

- Mailbox Persistence: Implement Mailbox persistence for my custom 
message store (i.e., provide an implementation quite similar to JPA)
- Mail Repository Store Persistence: There is nothing to implement here, 
or? I just have to configure to use a MySQL for example?
- User persistence/authentication: Users/passwords are already part of 
my custom message store. How do I achieve that requests are 
authenticated against my custom user base?
- any other things I have to consider in the first place...?


Thanks and best regards,

Marco

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


Re: Exposing a custom message/user store via IMAP using Mailbox

Posted by Hamster <ha...@gmail.com>.
A little bit off topic, but if you are interested in redis based user store
for james-2.x then let me know.

Cheers,
Maciej
On Sep 7, 2012 5:29 PM, "Marco Zapletal" <ma...@gmail.com> wrote:

> I digged a bit deeper into customizing James for our message store and
> have two specific questions:
>
> - How are users correlated to mailboxes (via User.userName and
> Mailbox.name)? If so, I guess it is not possible to allow multiple users
> (each of them with his own password) to access the same mailbox?
>
> - In order to have messages stored is the recommended approach to put
> MimeMessage instances as BlobMessages on the SPOOL queue (if I do not use
> the SMTP server directly)?
>
>
>
> Thanks in advance,
>
> Marco
>
> On 05.09.2012 10:19, Marco Zapletal wrote:
>
>> Hi folks,
>>
>> I have an existing, "custom" message store running, which I want to
>> expose via IMAP. The Mailbox project seems to be quite handy for that.
>> Could someone please give me feedback whether the following steps are
>> correct:
>>
>> - Mailbox Persistence: Implement Mailbox persistence for my custom
>> message store (i.e., provide an implementation quite similar to JPA)
>> - Mail Repository Store Persistence: There is nothing to implement here,
>> or? I just have to configure to use a MySQL for example?
>> - User persistence/authentication: Users/passwords are already part of
>> my custom message store. How do I achieve that requests are
>> authenticated against my custom user base?
>> - any other things I have to consider in the first place...?
>>
>>
>> Thanks and best regards,
>>
>> Marco
>>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Exposing a custom message/user store via IMAP using Mailbox

Posted by Eric Charles <er...@apache.org>.
On 14/09/2012 12:32, Marco Zapletal wrote:
...
>
> The messages which I want to expose via IMAP are not delivered using
> SMTP, but via some other protocols. So, my question was how to get my
> messages processed and stored in the James mailbox. In the meantime I
> already got this working by wrapping my message in a MimeMessage
> representation, which is then put as byte[] in an ActiveMQObjectMessage
> on the SPOOL queue. A pitfall was to set the appropriate headers (e.g.,
> "FORCE_DELIVERY") in order to get the message through the message selector.
>

Ok, so you want to behave as a client of the spooling system, which 
sounds reasonable if you have high-load traffic.

If you only have low traffic or only import once process, you could act 
as a direct client of the mailbox.

To try to answer you question, you should paste some snippets of your 
code. The spool implementation is by default an activemq Broker, so you 
would need to have the James server running which kicks off the broker.

Once this is done, you can grab some code form [1]; get the queue and 
queue.enQueue

If you don't want to have activemq, you can configure james to rely on a 
file based queing system, but you code should be the same.

Hope this helps,

Eric

[1] 
https://svn.apache.org/repos/asf/james/server/trunk/queue-jms/src/test/java/org/apache/james/queue/jms/JMSMailQueueTest.java

> Best regards,
> Marco
>
>
> ---------------------------------------------------------------------
> 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


Re: Exposing a custom message/user store via IMAP using Mailbox

Posted by Marco Zapletal <ma...@gmail.com>.
Eric,


thanks for your reply. Please see my comments inline.

On 14.09.2012 12:28, Eric Charles wrote:
> On 07/09/2012 16:28, Marco Zapletal wrote:
>> I digged a bit deeper into customizing James for our message store and
>> have two specific questions:
>>
>> - How are users correlated to mailboxes (via User.userName and
>> Mailbox.name)? If so, I guess it is not possible to allow multiple users
>> (each of them with his own password) to access the same mailbox?
>>
>
> A mailbox belongs to user (Mailbox.user).
> A user can subscribe to a Mailbox so it will appear in its imap client.
> There is an effort to introduce ACL (Access Control List), so a mailbox
> can be accessed by multiple users, depending on assigned rights.

Thanks for the clarification.


>
>> - In order to have messages stored is the recommended approach to put
>> MimeMessage instances as BlobMessages on the SPOOL queue (if I do not
>> use the SMTP server directly)?
>>
>>
>
> Can you please further explain your question, I am not sure to
> understand it.


The messages which I want to expose via IMAP are not delivered using 
SMTP, but via some other protocols. So, my question was how to get my 
messages processed and stored in the James mailbox. In the meantime I 
already got this working by wrapping my message in a MimeMessage 
representation, which is then put as byte[] in an ActiveMQObjectMessage 
on the SPOOL queue. A pitfall was to set the appropriate headers (e.g., 
"FORCE_DELIVERY") in order to get the message through the message selector.

Best regards,
Marco


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


Re: Exposing a custom message/user store via IMAP using Mailbox

Posted by Eric Charles <er...@apache.org>.
On 07/09/2012 16:28, Marco Zapletal wrote:
> I digged a bit deeper into customizing James for our message store and
> have two specific questions:
>
> - How are users correlated to mailboxes (via User.userName and
> Mailbox.name)? If so, I guess it is not possible to allow multiple users
> (each of them with his own password) to access the same mailbox?
>

A mailbox belongs to user (Mailbox.user).
A user can subscribe to a Mailbox so it will appear in its imap client.
There is an effort to introduce ACL (Access Control List), so a mailbox 
can be accessed by multiple users, depending on assigned rights.

> - In order to have messages stored is the recommended approach to put
> MimeMessage instances as BlobMessages on the SPOOL queue (if I do not
> use the SMTP server directly)?
>
>

Can you please further explain your question, I am not sure to 
understand it.

Thx, Eric


>
> Thanks in advance,
>
> Marco
>
> On 05.09.2012 10:19, Marco Zapletal wrote:
>> Hi folks,
>>
>> I have an existing, "custom" message store running, which I want to
>> expose via IMAP. The Mailbox project seems to be quite handy for that.
>> Could someone please give me feedback whether the following steps are
>> correct:
>>
>> - Mailbox Persistence: Implement Mailbox persistence for my custom
>> message store (i.e., provide an implementation quite similar to JPA)
>> - Mail Repository Store Persistence: There is nothing to implement here,
>> or? I just have to configure to use a MySQL for example?
>> - User persistence/authentication: Users/passwords are already part of
>> my custom message store. How do I achieve that requests are
>> authenticated against my custom user base?
>> - any other things I have to consider in the first place...?
>>
>>
>> Thanks and best regards,
>>
>> Marco
>
>
> ---------------------------------------------------------------------
> 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


Re: Exposing a custom message/user store via IMAP using Mailbox

Posted by Marco Zapletal <ma...@gmail.com>.
I digged a bit deeper into customizing James for our message store and 
have two specific questions:

- How are users correlated to mailboxes (via User.userName and 
Mailbox.name)? If so, I guess it is not possible to allow multiple users 
(each of them with his own password) to access the same mailbox?

- In order to have messages stored is the recommended approach to put 
MimeMessage instances as BlobMessages on the SPOOL queue (if I do not 
use the SMTP server directly)?



Thanks in advance,

Marco

On 05.09.2012 10:19, Marco Zapletal wrote:
> Hi folks,
>
> I have an existing, "custom" message store running, which I want to
> expose via IMAP. The Mailbox project seems to be quite handy for that.
> Could someone please give me feedback whether the following steps are
> correct:
>
> - Mailbox Persistence: Implement Mailbox persistence for my custom
> message store (i.e., provide an implementation quite similar to JPA)
> - Mail Repository Store Persistence: There is nothing to implement here,
> or? I just have to configure to use a MySQL for example?
> - User persistence/authentication: Users/passwords are already part of
> my custom message store. How do I achieve that requests are
> authenticated against my custom user base?
> - any other things I have to consider in the first place...?
>
>
> Thanks and best regards,
>
> Marco


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