Author: norman Date: Thu Feb 3 11:24:16 2011 New Revision: 1066780 URL: http://svn.apache.org/viewvc?rev=1066780&view=rev Log: Just skip a MessageResult if a Field can not be parsed and was requested. Before this let the whole fetch operation fail.See IMAP-253
Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java?rev=1066780&r1=1066779&r2=1066780&view=diff ============================================================================== --- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java (original) +++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java Thu Feb 3 11:24:16 2011 @@ -100,9 +100,13 @@ public class FetchProcessor extends Abst final Iterator<MessageResult> it = mailbox.getMessages(batchSet.get(a), resultToFetch, mailboxSession); while (it.hasNext()) { final MessageResult result = (MessageResult) it.next(); - final FetchResponse response = builder.build(fetch, result, mailbox, - session, useUids); - responder.respond(response); + try { + final FetchResponse response = builder.build(fetch, result, mailbox, session, useUids); + responder.respond(response); + } catch (ParseException e) { + // we can't for whatever reason parse the message so just skip it and log it to debug + session.getLog().debug("Unable to parse message with uid " + result.getUid(), e); + } } } } @@ -115,8 +119,6 @@ public class FetchProcessor extends Abst taggedBad(command, tag, responder, HumanReadableText.INVALID_MESSAGESET); } catch (MailboxException e) { no(command, tag, responder, HumanReadableText.SEARCH_FAILED); - } catch (ParseException e) { - no(command, tag, responder, HumanReadableText.FAILURE_MAIL_PARSE); } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org