@Override protected ImapMessage decode(ImapCommand command, ImapRequestLineReader request, String tag, ImapSession session) throws DecodingException { final String userid = request.astring(); final String password = request.astring(); request.eol(); return new LoginRequest(command, userid, password, tag); }
@Override protected void doProcess(LoginRequest request, ImapSession session, String tag, ImapCommand command, Responder responder) { // check if the login is allowed with LOGIN command. See IMAP-304 if (session.isPlainAuthDisallowed() && session.isTLSActive() == false) { no(command, tag, responder, HumanReadableText.DISABLED_LOGIN); } else { doAuth(noDelegation(request.getUserid(), request.getPassword()), session, tag, command, responder, HumanReadableText.INVALID_LOGIN); } }
@Override protected Closeable addContextToMDC(LoginRequest message) { return MDCBuilder.create() .addContext(MDCBuilder.ACTION, "LOGIN") .addContext(MDCBuilder.USER, message.getUserid()) .build(); } }
/** * @see org.apache.james.imap.processor.AbstractMailboxProcessor * #doProcess(org.apache.james.imap.api.message.request.ImapRequest, * org.apache.james.imap.api.process.ImapSession, java.lang.String, * org.apache.james.imap.api.ImapCommand, org.apache.james.imap.api.process.ImapProcessor.Responder) */ protected void doProcess(LoginRequest request, ImapSession session, String tag, ImapCommand command, Responder responder) { final String userid = request.getUserid(); final String passwd = request.getPassword(); // check if the login is allowed with LOGIN command. See IMAP-304 if (session.isPlainAuthDisallowed() && session.isTLSActive() == false) { no(command, tag, responder, HumanReadableText.DISABLED_LOGIN); } else { doAuth(userid, passwd, session, tag, command, responder, HumanReadableText.INVALID_LOGIN); } }
/** * @see * org.apache.james.imap.decode.base.AbstractImapCommandParser#decode(org.apache.james.imap.api.ImapCommand, * org.apache.james.imap.decode.ImapRequestLineReader, java.lang.String, * org.apache.james.imap.api.process.ImapSession) */ protected ImapMessage decode(ImapCommand command, ImapRequestLineReader request, String tag, ImapSession session) throws DecodingException { final String userid = request.astring(); final String password = request.astring(); request.eol(); final ImapMessage result = new LoginRequest(command, userid, password, tag); return result; }