FileDocCategorySizeDatePackage
RsetCmdHandler.javaAPI DocApache James 2.3.12890Fri Jan 12 12:56:26 GMT 2007org.apache.james.smtpserver

RsetCmdHandler

public class RsetCmdHandler extends Object implements CommandHandler
Handles RSET command

Fields Summary
private static final String
COMMAND_NAME
The name of the command handled by the command handler
Constructors Summary
Methods Summary
private voiddoRSET(SMTPSession session, java.lang.String argument)
Handler method called upon receipt of a RSET command. Resets message-specific, but not authenticated user, state.

param
session SMTP session object
param
argument the argument passed in with the command by the SMTP client

        String responseString = "";
        if ((argument == null) || (argument.length() == 0)) {
            // remember the ehlo mode
            Object currentHeloMode = session.getState().get(SMTPSession.CURRENT_HELO_MODE);
            session.resetState();
            // start again with the old helo mode
            if (currentHeloMode != null) {
                session.getState().put(SMTPSession.CURRENT_HELO_MODE,currentHeloMode);
            }
            responseString = "250 "+DSNStatus.getStatus(DSNStatus.SUCCESS,DSNStatus.UNDEFINED_STATUS)+" OK";
        } else {
            responseString = "500 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_INVALID_ARG)+" Unexpected argument provided with RSET command";
        }
        session.writeResponse(responseString);
    
public voidonCommand(SMTPSession session)


    /*
     * handles RSET command
     *
     * @see org.apache.james.smtpserver.CommandHandler#onCommand(SMTPSession)
    **/
        
        doRSET(session, session.getCommandArgument());