/** * @see org.apache.james.protocols.smtp.SMTPSession#getHelloName() */ public String getHelloName() { return theConfigData.getHelloName(); }
@Override public String getHeloName() { return theConfigData.getHelloName(); }
@Override protected Response doCoreCmd(SMTPSession session, String command, String parameters) { session.setAttachment(SMTPSession.CURRENT_HELO_MODE, COMMAND_NAME, ProtocolSession.State.Connection); StringBuilder response = new StringBuilder(); response.append(session.getConfiguration().getHelloName()).append( " Hello ").append(parameters).append(" [").append( session.getRemoteAddress().getAddress().getHostAddress()).append("])"); return new SMTPResponse(SMTPRetCode.MAIL_OK, response); }
/** * Handler method called upon receipt of a EHLO command. Responds with a * greeting and informs the client whether client authentication is * required. * * @param session * SMTP session object * @param argument * the argument passed in with the command by the SMTP client */ private Response doEHLO(SMTPSession session, String argument) { SMTPResponse resp = new SMTPResponse(SMTPRetCode.MAIL_OK, new StringBuilder(session.getConfiguration().getHelloName()).append(" Hello ").append(argument) .append(" [") .append(session.getRemoteAddress().getAddress().getHostAddress()).append("])")); session.setAttachment(SMTPSession.CURRENT_HELO_MODE, COMMAND_NAME, State.Connection); processExtensions(session, resp); return resp; }
/** * Handler method called upon receipt of a QUIT command. This method informs * the client that the connection is closing. * * @param session * SMTP session object * @param argument * the argument passed in with the command by the SMTP client */ private Response doQUIT(SMTPSession session, String argument) { if ((argument == null) || (argument.length() == 0)) { StringBuilder response = new StringBuilder(); response.append( DSNStatus.getStatus(DSNStatus.SUCCESS, DSNStatus.UNDEFINED_STATUS)).append(" ").append( session.getConfiguration().getHelloName()).append( " Service closing transmission channel"); SMTPResponse ret = new SMTPResponse(SMTPRetCode.SYSTEM_QUIT, response); ret.setEndSession(true); return ret; } else { return SYNTAX_ERROR; } }
@Override public Response onConnect(SMTPSession session) { String smtpGreeting = session.getConfiguration().getGreeting(); SMTPResponse welcomeResponse; // if no greeting was configured use a default if (smtpGreeting == null) { // Initially greet the connector welcomeResponse = new SMTPResponse(SMTPRetCode.SERVICE_READY, new StringBuilder(256) .append(session.getConfiguration().getHelloName()) .append(" ").append(getServiceType(session)).append(" Server (") .append(session.getConfiguration().getSoftwareName()) .append(") ready")); } else { welcomeResponse = new SMTPResponse(SMTPRetCode.SERVICE_READY,smtpGreeting); } return welcomeResponse; }
headerLineBuffer.append("by ").append(session.getConfiguration().getHelloName()).append(" (").append(session.getConfiguration().getSoftwareName()).append(") with ").append(getServiceType(session, heloMode)); headerLineBuffer.append(" ID ").append(session.getSessionID());