protected void processMessageRanges(final ImapSession session, final MessageManager mailbox, final List<MessageRange> ranges, final FetchData fetch, final boolean useUids, final MailboxSession mailboxSession, final Responder responder) throws MailboxException {
final FetchResponseBuilder builder = new FetchResponseBuilder(new EnvelopeBuilder(session.getLog()));
FetchGroup resultToFetch = getFetchGroup(fetch);
for (int i = 0; i < ranges.size(); i++) {
mailbox.getMessages(ranges.get(i), resultToFetch, mailboxSession, new MessageCallback() {
public void onMessages(Iterator<MessageResult> it) throws MailboxException {
while (it.hasNext()) {
final MessageResult result = it.next();
try {