package org.subethamail.smtp.command;

import java.io.IOException;

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

/**
 * @author Ian McFarland &lt;ian@neo.com&gt;
 * @author Jon Stevens
 */
public class QuitCommand extends BaseCommand
{
	public QuitCommand()
	{
		super("QUIT", "Exit the SMTP session.");
	}

	@Override
	public void execute(String commandString, ConnectionContext context) throws IOException
	{
		context.sendResponse("221 Bye");
		context.getSession().quit();
	}
}

@@ -476,63 +476,65 @@
 ext.
-sendResponse(%22221 Bye%22);%0A%09%09context.getSession().quit();
+getSession().quit();%0A%09%09context.sendResponse(%22221 Bye%22);%09%09
 %0A%09%7D%0A

Fix to ensure session is closed on QUIT command response