Thanks Eric and Norman for your response.
I understand that the default store for mailbox is JPA but I was unable to 
download the JPA binary and source. Can you please guide me on changing this to 
a file system to test the created mailbox.

I'm using the following code to create mailbox but nothing is listed when I 
call mapper.list(). Please advice.

@Override
        public void createMailbox(MailboxPath mailboxPath, final MailboxSession 
mailboxSession)
    throws MailboxException {
        
        final int length = mailboxPath.getName().length();
        if (length == 0) {
                System.out.println("Ignoring mailbox with empty name");
        
        } else {
            if (mailboxPath.getName().charAt(length - 1) == getDelimiter())
                mailboxPath.setName(mailboxPath.getName().substring(0, length - 
1));
        
            for (final MailboxPath mailbox : 
mailboxPath.getHierarchyLevels(getDelimiter()))

        

        
                        if (!mailboxExists(mailbox, mailboxSession)) {
                            final 
org.apache.james.mailbox.store.mail.model.Mailbox<UUID> m = 
doCreateMailbox(mailbox, mailboxSession);
                            final 
org.apache.james.mailbox.store.mail.MailboxMapper<UUID> mapper = 
getMapperFactory().getMailboxMapper(mailboxSession);
                            mapper.execute(new 
TransactionalMapper.VoidTransaction() {

                                public void runVoid() throws MailboxException {
                                    mapper.save(m);
                                }

                            });
                            
                            // notify listeners
                            getEventDispatcher().mailboxAdded(mailboxSession, 
m);
                        }
                        //return null;

        }
    }

Regards
------------------------------------
Jentu Jain | Datacert, Inc.

Why are major companies rapidly migrating to Passport?  Find Out Here


-----Original Message-----
From: Eric Charles [mailto:[email protected]] 
Sent: Friday, January 27, 2012 12:36 AM
To: James Users List
Subject: Re: Create IMAP wrapper

http://james.apache.org/mailbox/mailbox-store.html

is the place we should enhance to further help guys like you.

But yes, for now, the best place to learn is to checkout the source code, and 
look at it in your favorite IDE.

Mailbox JPA has more implementations has more classes than mailbox maildir 
which relies more on the simple model provided in mailbox store.

Thx,

Eric

On 26/01/12 17:00, Norman Maurer wrote:
> Just implement your own MailboxManager. This can then be used in the 
> IMAP code.
>
> Bye,
> Norman
>
>
> 2012/1/25 Jentu Jain<[email protected]>
>
>>   Hello,****
>>
>> My requirement is to create a server-side IMAP component that would 
>> fetch information from another web application and expose it as IMAP 
>> folders. **
>> **
>>
>> How can this be done?****
>>
>> ** **
>>
>> Regards****
>>
>> ------------------------------------
>> Jentu Jain | Datacert, Inc.****
>>
>> ** **
>>
>> *Why are major companies rapidly migrating to Passport?  Find Out 
>> Here<http://www.datacert.com/>
>> *
>>
>> [image: Description: 
>> cid:[email protected]]<http://www.datacert.com/feed.xml>[image:
>> Description: 
>> cid:[email protected]]<http://twitter.com/datacert>
>> ****
>>
>> ** **
>>
>

--
eric | http://about.echarles.net | @echarles

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to