-
Aug 13th, 2010, 09:37 AM
#1
Flag a Email Message
I am new to Spring Integration.
I have a requirement to read mails from a IMAP compliant mail-server, process the contents and then mark them as READ.
I am using imap-idle-channel-adapter. My service gets activated once a new mail arrives to the mailbox.
BUT...
The problem is I am unable to flag/mark the mail as READ / SEEN.
So..
My mailbox is full of UNREAD mail even though I have set the flag by javamail API.
Kindly help me in this context.
Source Code:
MimeMessage mimeMessage = (MimeMessage) msg.getPayload();
System.out.println(mimeMessage.getSubject());
System.out.println(mimeMessage.getSentDate());
//System.out.println(IOUtils.toString(mimeMessage.ge tInputStream()));
System.out.println((mimeMessage.getFrom()[0]).toString());
mimeMessage.setFlag(Flag.RECENT, false);
mimeMessage.setFlag(Flag.ANSWERED, true);
mimeMessage.setFlag(Flag.SEEN, true);
mimeMessage.saveChanges();
MailTransportUtils.closeFolder(mimeMessage.getFold er());
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules