dovecot-2.0: lmtp: Don't forget LHLO host when sending multiple ...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 17 08:12:24 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/aba5a6a24b99
changeset: 12598:aba5a6a24b99
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 17 08:12:21 2011 +0200
description:
lmtp: Don't forget LHLO host when sending multiple messages in session.

diffstat:

 src/lmtp/client.c   |  3 ++-
 src/lmtp/client.h   |  2 +-
 src/lmtp/commands.c |  5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diffs (61 lines):

diff -r 049a922c193c -r aba5a6a24b99 src/lmtp/client.c
--- a/src/lmtp/client.c	Fri Feb 11 23:44:39 2011 +0200
+++ b/src/lmtp/client.c	Thu Feb 17 08:12:21 2011 +0200
@@ -230,7 +230,7 @@
 	client_raw_user_create(client);
 	client_generate_session_id(client);
 	client->my_domain = client->set->hostname;
-	client->state.lhlo = "missing";
+	client->lhlo = i_strdup("missing");
 
 	DLLIST_PREPEND(&clients, client);
 	clients_count++;
@@ -264,6 +264,7 @@
 	if (client->fd_in != client->fd_out)
 		net_disconnect(client->fd_out);
 	client_state_reset(client);
+	i_free(client->lhlo);
 	pool_unref(&client->state_pool);
 	pool_unref(&client->pool);
 
diff -r 049a922c193c -r aba5a6a24b99 src/lmtp/client.h
--- a/src/lmtp/client.h	Fri Feb 11 23:44:39 2011 +0200
+++ b/src/lmtp/client.h	Thu Feb 17 08:12:21 2011 +0200
@@ -12,7 +12,6 @@
 };
 
 struct client_state {
-	const char *lhlo;
 	const char *session_id;
 	const char *mail_from;
 	ARRAY_DEFINE(rcpt_to, struct mail_recipient);
@@ -58,6 +57,7 @@
 
 	struct mail_user *raw_mail_user;
 	const char *my_domain;
+	char *lhlo;
 
 	pool_t state_pool;
 	struct client_state state;
diff -r 049a922c193c -r aba5a6a24b99 src/lmtp/commands.c
--- a/src/lmtp/commands.c	Fri Feb 11 23:44:39 2011 +0200
+++ b/src/lmtp/commands.c	Thu Feb 17 08:12:21 2011 +0200
@@ -71,7 +71,8 @@
 	client_send_line(client, "250-ENHANCEDSTATUSCODES");
 	client_send_line(client, "250 PIPELINING");
 
-	client->state.lhlo = p_strdup(client->state_pool, str_c(domain));
+	i_free(client->lhlo);
+	client->lhlo = i_strdup(str_c(domain));
 	return 0;
 }
 
@@ -712,7 +713,7 @@
 	if (rcpt_to != NULL)
 		str_printfa(str, "Delivered-To: <%s>\r\n", rcpt_to);
 
-	str_printfa(str, "Received: from %s", client->state.lhlo);
+	str_printfa(str, "Received: from %s", client->lhlo);
 	if ((host = net_ip2addr(&client->remote_ip)) != NULL)
 		str_printfa(str, " ([%s])", host);
 	str_printfa(str, "\r\n\tby %s ("PACKAGE_NAME") with LMTP id %s",


More information about the dovecot-cvs mailing list