dovecot-2.0: lmtp: Don't allow mixed proxy/non-proxy RCPT TO des...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 8 20:38:36 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/97e60c1a4f8d
changeset: 12399:97e60c1a4f8d
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 08 18:38:31 2010 +0000
description:
lmtp: Don't allow mixed proxy/non-proxy RCPT TO destinations.
Although the code attempts to handle this case already, the DATA replies
aren't sent in correct order.

diffstat:

 src/lmtp/commands.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r 748e613fd73a -r 97e60c1a4f8d src/lmtp/commands.c
--- a/src/lmtp/commands.c	Mon Nov 08 18:37:25 2010 +0000
+++ b/src/lmtp/commands.c	Mon Nov 08 18:38:31 2010 +0000
@@ -256,9 +256,16 @@
 		client_send_line(client, "554 5.4.6 <%s> "
 				 "Proxying loops to itself", address);
 		pool_unref(&pool);
-		return FALSE;
+		return TRUE;
 	}
 
+	if (array_count(&client->state.rcpt_to) != 0) {
+		client_send_line(client, "451 4.3.0 <%s> "
+			"Can't handle mixed proxy/non-proxy destinations",
+			address);
+		pool_unref(&pool);
+		return TRUE;
+	}
 	if (client->proxy == NULL) {
 		client->proxy = lmtp_proxy_init(client->set->hostname,
 						dns_client_socket_path,
@@ -375,6 +382,13 @@
 			return 0;
 	}
 
+	if (client->proxy != NULL) {
+		client_send_line(client, "451 4.3.0 <%s> "
+			"Can't handle mixed proxy/non-proxy destinations",
+			address);
+		return 0;
+	}
+
 	memset(&input, 0, sizeof(input));
 	input.module = input.service = "lmtp";
 	input.username = username;


More information about the dovecot-cvs mailing list