* @see org.apache.james.smtpserver.protocol.ConnectHandler#onConnect(SMTPSession)
*/
public Response onConnect(SMTPSession session) {
String smtpGreeting = session.getSMTPGreeting();
SMTPResponse welcomeResponse;
// if no greeting was configured use a default
if (smtpGreeting == null) {
// Initially greet the connector
// Format is: Sat, 24 Jan 1998 13:16:09 -0500
welcomeResponse = new SMTPResponse(SMTPRetCode.SERVICE_READY,
new StringBuilder(256)
.append(session.getHelloName())
.append(" SMTP Server (")
.append(getProductName())
.append(") ready ")
.append(rfc822DateFormat.format(new Date())));
} else {
welcomeResponse = new SMTPResponse(SMTPRetCode.SERVICE_READY,smtpGreeting);
}
return welcomeResponse;
}