Hi there, you can register a MailboxListener in the MailboxManager instance and so get notifications about mailbox events. This should do the job.
Have a look here: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxManager.java?view=markup http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxListenerSupport.java?view=markup http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxListener.java?view=markup Let me know if you need more info.. Bye, Norman 2012/1/26 l0c4l h0st <l0c4lh0st.d...@gmail.com>: > Hello, > > What I'm trying to do is capture events that the IMAP-server should > (or is supposed to) raise. > > Whenever a message gets marked as read, I want to get a notification > of this event. > Whenever a message gets marked as unread, I want to get a notification > of this event. > Whenever a message gets flagged, I want to get a notification of this event. > Etc. etc. > > Whenever a user moves a message to a different IMAP folder, I want to > get a notification of this event. > Whenever a user deletes a message to a different IMAP folder, I want > to get a notification of this event. > Whenever a user copies a message to a different IMAP folder, I want to > get a notification of this event. > > Right now, I don't see any way of doing this. I thought this would be > possible with the Matchers and Mailets, but I don't see how this would > be possible. > > I can define a custom mailet, that matches on ALL, when I add this > mailet in the root- and transport-processors, I get notifications only > of mail that arrives through SMTP and mail that is sent through SMTP. > > Am I missing the IMAP way of doing this? Or is there currently no way > of doing this with IMAP? > > I've tried searching through the code, but I don't see any event > listeners or anything that would be triggered. I did find > ImapStateAwareMailboxListener, but I cannot find how to subscribe to > this event or anything. > > Also, I found the UpdatedFlags class, but there is no notification > sent anywhere. > > SO: > How can I get a notification of every single change that is made to a > message in IMAP? IMAP is currently most important for us. > > The reason I want to do this is we have a custom CRM tool that has a > custom mail database and we want to slowly migrate to a real > mailserver, we thought of using Apache JAMES to do synchronisation, > because at this time we cannot yet realize a full migration. We want > to do this in steps. > > My ultimate goal, regarding synchronisation, is to receive all events > that are occurring in the IMAP part of JAMES, so we can update the > status of the messages in our CRM-tool. My goal is also to synchronize > changes in the CRM-tool back to IMAP-JAMES. But this can easily be > done through an IMAP-session. That shouldn't be a problem. > > I hope anyone can help me out on this, because I find a lack of > documentation regarding this subject. > > Right now, the only way of doing this seems to me creating database > triggers (we're using this with PostgreSQL). > > Thank you in advance. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org > For additional commands, e-mail: server-dev-h...@james.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org