<commit_before>package org.subethamail.smtp.command;

import org.subethamail.smtp.server.SMTPServerContext;
import org.subethamail.smtp.session.Session;

/**
 * @author <NAME> &lt;<EMAIL>&gt;
 * @author <NAME>
 */
public class EhloCommand extends BaseCommand
{
	public EhloCommand(CommandDispatcher commandDispatcher)
	{
		super(commandDispatcher, "EHLO");
		helpMessage = new HelpMessage("EHLO", "<hostname>",
				"Introduce yourself.");
	}

	public String execute(String commandString, Session session)
	{
		String[] args = getArgs(commandString);
		if (args.length < 2)
		{
			return "501 Syntax: EHLO <hostname>";
		}
		String remoteHost = args[1];
		
		// http://cr.yp.to/smtp/helo.html#helo
		// "I recommend that they use bracketed IP addresses:"
//		If we cared about the remoteHost IP, we would deal with it here.
//		remoteHost = remoteHost.replace("[", "");
//		remoteHost = remoteHost.replace("]", "");

//		postfix returns...
//		250-server.host.name
//		250-PIPELINING
//		250-SIZE 10240000
//		250-ETRN
//		250 8BITMIME
		if (!session.hasSeenHelo())
		{
			SMTPServerContext serverContext = commandDispatcher.getServerContext();

			session.setHasSeenHelo(true);
			return new StringBuilder().append("250-")
				.append(serverContext.getHostname())
				.append("\r\n")
				.append("250-PIPELINING")
				.append("\r\n")
				.append("250-SIZE 10240000")
				.append("\r\n")
				.append("250 8BITMIME")
				.toString();
		}
		else
		{
			return "503 " + remoteHost + " Duplicate EHLO";
		}
	}
}<commit_msg>Took out ESMTP commands from EHLO response that we don't know how to respond to. Fixes one (new) issue with Thunderbird.<commit_after>package org.subethamail.smtp.command;

import org.subethamail.smtp.server.SMTPServerContext;
import org.subethamail.smtp.session.Session;

/**
 * @author <NAME> &lt;<EMAIL>&gt;
 * @author <NAME>
 */
public class EhloCommand extends BaseCommand
{
	public EhloCommand(CommandDispatcher commandDispatcher)
	{
		super(commandDispatcher, "EHLO");
		helpMessage = new HelpMessage("EHLO", "<hostname>",
				"Introduce yourself.");
	}

	public String execute(String commandString, Session session)
	{
		String[] args = getArgs(commandString);
		if (args.length < 2)
		{
			return "501 Syntax: EHLO <hostname>";
		}
		String remoteHost = args[1];
		
		// http://cr.yp.to/smtp/helo.html#helo
		// "I recommend that they use bracketed IP addresses:"
//		If we cared about the remoteHost IP, we would deal with it here.
//		remoteHost = remoteHost.replace("[", "");
//		remoteHost = remoteHost.replace("]", "");

//		postfix returns...
//		250-server.host.name
//		250-PIPELINING
//		250-SIZE 10240000
//		250-ETRN
//		250 8BITMIME
		if (!session.hasSeenHelo())
		{
			SMTPServerContext serverContext = commandDispatcher.getServerContext();

			session.setHasSeenHelo(true);
			return new StringBuilder().append("250-")
				.append(serverContext.getHostname())
//  We don't understand the SIZE or PIPELINING options, so don't tell people we do.
//				.append("\r\n")
//				.append("250-PIPELINING")
//				.append("\r\n")
//				.append("250-SIZE 10240000")
				.append("\r\n")
				.append("250 8BITMIME")
				.toString();
		}
		else
		{
			return "503 " + remoteHost + " Duplicate EHLO";
		}
	}
}
{'fraction_non_alphanumeric': 0.1536321483771252, 'fraction_numerical': 0.03276661514683153, 'mean_word_length': 3.544943820224719, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4551133', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1121, 'n_words': 248}