Hi all!!

I'm working with James 3 Beta3 to developp a webmail.I am grabing mailboxes
(gmail, hotmail...) and i stores messages, it works great with James.
After grabbing thoses messages, i want to analys them by finding them back
with james methods.

In the code below, i stock message with james messageManager.appendMessage()
method, keep this id (_mid my test code below) to retrieve this message
juste after. To do so, i 'm using the method messageManager.getMessages()
wich needs a set, a fetchGroup and a mailboxSession.
It appears that i'm having the good set and mailboxSession but my problem is
that i 'm apparently using a deprecated
org.apache.james.mailbox.util.FetchGroupImpl...and had the following error
in my while loop:

WARN  17:17:36,289 | org.apache.james.mime4j.parser.MimeEntity | Unexpected
end of headers detected. Higher level boundary detected or EOF reached.
WARN  17:17:36,290 | org.apache.james.mime4j.parser.MimeEntity | Invalid
header encountered
WARN  17:17:36,291 | org.apache.james.mime4j.parser.MimeEntity | Body part
ended prematurely. Boundary detected in header or EOF reached.

 so i tried to google it and found
org.apache.james.mailboxmanager.impl<http://james.apache.org/imap/apidocs/org/apache/james/mailboxmanager/impl/package-summary.html>.FetchGroupImpl
BUT did nt find the associated jar...

My questions are:
-am i in the good way of doing it?
-where to find this jar?
-after getting back the message with james methods, how to get all headers
and body parts?


-------CODE--------

        long _mid = messageManager.appendMessage(mmis, date, mailboxSession,
true,
                new Flags());
        log.debug("Message ID : "+_mid);

        log.debug("message#
"+messageManager.getMessageCount(mailboxSession));

        MessageRange _set = MessageRange.one(_mid);
        FetchGroup _fetchGroup = new FetchGroupImpl(FetchGroup.BODY_CONTENT
| FetchGroup.HEADERS | FetchGroup.MINIMAL);

        Iterator<MessageResult> _mri = messageManager.getMessages(_set,
_fetchGroup, mailboxSession);

        int i=0;
        while ( _mri.hasNext() ){
              MessageResult _mr = _mri.next();
              logger.debug("_mr.toString() : "+_mr.toString());
              logger.debug("_mr.getBody().toString() :
"+_mr.getBody().toString());
              logger.debug("_mr.getUid() : "+_mr.getUid());
              ++i;
        }
---------CODE----------

If someone can help, i would be very gratefull.
Thaks in advance.
Mat

Reply via email to