Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-2008, 01:45 AM
Active Member
 
Posts: 40
Default Mutators and Converters

I have some questions about the MimeVisitor class.

I have an extension where I register my converter and my mutator class.

I want the mutator to take actions when I send a message only and not when a new message comes.
The same with a converter. I want my converter's functions to be invoked only when I read a message and not when a new message is added to a mailbox.

My question is how can I check in my function if a message is being send or received ? And what can I do to not invoke a conversion while the new message is comming? Is it possible at all ?

Here is an example of a converter
Code:
    @Override
    protected boolean visitMessage(MimeMessage mm, VisitPhase visitKind) throws MessagingException {
        if (visitKind != VisitPhase.VISIT_BEGIN) {
            return false;
        }
        if (.....) { // here i want to check if it's an old message to start my conversion
            if (mCallback != null && mCallback.onModification() == false) {
                return false;
            }

            // do some modifications on the message .....

            mm.saveChanges();
            return true;
        }
        return false;
    }

Can I access some info about user account (account ID ...) in that function?

Last edited by agnes; 12-02-2008 at 03:14 AM..
Reply With Quote
  #2 (permalink)  
Old 12-02-2008, 06:20 AM
Zimbra Employee
 
Posts: 1,434
Default

Mutators operate both on send and receive, with no exceptions. Can you find a way to detect received messages and skip them? (Maybe look for a "Received" header?)
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 12-02-2008, 07:02 AM
Active Member
 
Posts: 40
Default

Thank you. I will detect new messages like you said.

While we are parsing a message is there any simple way to find out to which mailbox the message belongs?
I need to get some user's properties in my converter. How can I do that ?
Reply With Quote
  #4 (permalink)  
Old 12-02-2008, 08:00 AM
Zimbra Employee
 
Posts: 1,434
Default

I don't believe that's possible at present. Can you file an enhancement request in bugzilla?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.