
org.subethamail.smtp.internal.command.HelloCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subethasmtp Show documentation
Show all versions of subethasmtp Show documentation
A fork of a fork (!) of SubEtha, an easy-to-use server-side SMTP library for Java.
package org.subethamail.smtp.internal.command;
import java.io.IOException;
import org.subethamail.smtp.internal.server.BaseCommand;
import org.subethamail.smtp.server.Session;
/**
* @author Ian McFarland <[email protected]>
* @author Jon Stevens
* @author Jeff Schnitzer
* @author Scott Hernandez
*/
public final class HelloCommand extends BaseCommand
{
public HelloCommand()
{
super("HELO", "Introduce yourself.", "");
}
@Override
public void execute(String commandString, Session sess) throws IOException
{
String[] args = getArgs(commandString);
if (args.length < 2)
{
sess.sendResponse("501 Syntax: HELO ");
return;
}
sess.resetMailTransaction();
sess.setHelo(args[1]);
sess.sendResponse("250 " + sess.getServer().getHostName());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy