folder = folder.getFolder(m_channel.getInFolder());
folder.open(Folder.READ_WRITE);
bFolderOpen = true;
int nMessageCount = folder.getMessageCount();
CompoundIntegrationException e = null;
if (s_logger.isDebugEnabled())
{
if (nMessageCount != 0)
{
s_logger.debug("Receiving " + nMessageCount + " mail message(s)");
}
}
for (int nMessage = 1; nMessage <= nMessageCount; ++nMessage)
{
try
{
process(context, folder.getMessage(nMessage));
}
catch (Throwable t)
{
if (e == null)
{
e = new CompoundIntegrationException("err.rpc.mailUnhandled");
}
e.addException(t);
}
}
if (e != null)
{