Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAMEL-7873 Add capability to sort incoming mail messages #277

Closed
wants to merge 2 commits into from

Conversation

camann9
Copy link

@camann9 camann9 commented Sep 24, 2014

Camel should have the ability to sort incoming mail messages. This patch adds that ability. There is one caveat:
POP3 does not support sorting and for IMAP it's an extension. To remediate this problem this patch can either use On-Server sorting where the capability exists and Client side sorting for servers that do not support sorting.
There is a test case that tests the route integration and multiple test cases that test the sorting component.
I honestly don't know how to add this to the documentation.

@camann9 camann9 changed the title Add capability to sort incoming mail messages CAMEL-7873 Add capability to sort incoming mail messages Sep 27, 2014

import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.SortTerm;
import org.apache.camel.Exchange;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not supposed to use com.sun packages unless you have good explain of it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we can not find out if a folder is an IMAP folder and we can not call the specific methods we need for sorting (only IMAP supports sorting).
The dependencies I referenced are all part of the maven dependency javax.mail/mail, they are not dependent on the type of JDK/JRE we are running (even though they have the com.sun prefix).
To make it short: there is no way of implementing this functionality without using stuff from com.sun.mail. But I think in this situation it not a problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I got it, we can treat the com.sun.mail as a third part jar. I will merged the code shortly.

@camann9
Copy link
Author

camann9 commented Oct 20, 2014

Has been merged, closing it

@camann9 camann9 closed this Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants