@Override
protected void doProcess(AppendRequest request, ImapSession session, String tag, ImapCommand command, Responder responder) {
final String mailboxName = request.getMailboxName();
final InputStream messageIn = request.getMessage();
final Date datetime = request.getDatetime();
final Flags flags = request.getFlags();
final MailboxPath mailboxPath = PathConverter.forSession(session).buildFullPath(mailboxName);
try {
final MailboxManager mailboxManager = getMailboxManager();
final MessageManager mailbox = mailboxManager.getMailbox(mailboxPath, ImapSessionUtils.getMailboxSession(session));
appendToMailbox(messageIn, datetime, flags, session, tag, command, mailbox, responder, mailboxPath);
} catch (MailboxNotFoundException e) {
consume(messageIn);
LOGGER.debug("Append failed for mailbox {}", mailboxPath, e);
tryCreate(session, tag, command, responder, e);
} catch (MailboxException e) {
consume(messageIn);
LOGGER.error("Append failed for mailbox {}", mailboxPath, e);
no(command, tag, responder, HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
}
}