All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.subethamail.smtp.command.HelloCommand Maven / Gradle / Ivy

There is a newer version: 3.1.7
Show newest version
package org.subethamail.smtp.command;

import java.io.IOException;

import org.subethamail.smtp.server.BaseCommand;
import org.subethamail.smtp.server.Session;

/**
 * @author Ian McFarland <[email protected]>
 * @author Jon Stevens
 * @author Jeff Schnitzer
 * @author Scott Hernandez
 */
public class HelloCommand extends BaseCommand
{
	/** */
	public HelloCommand()
	{
		super("HELO", "Introduce yourself.", "");
	}

	/** */
	@Override
	public void execute(String commandString, Session sess) throws IOException
	{
		String[] args = this.getArgs(commandString);
		if (args.length < 2)
		{
			sess.sendResponse("501 Syntax: HELO ");
			return;
		}

		sess.setHelo(args[1]);

		sess.sendResponse("250 " + sess.getServer().getHostName());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy