throw new MessagingException(e.getMessage());
}
final MailboxSession session;
try {
session = mailboxManager.createSystemSession(username, new MailetContextLog(getMailetContext()));
} catch (BadCredentialsException e) {
throw new MessagingException("Unable to authenticate to mailbox", e);
} catch (MailboxException e) {
throw new MessagingException("Can not access mailbox", e);
}