dovecot-2.0: lmtp: Fixed handling recipient_delimiter when it wa...

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 4 19:48:31 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/c34d871a7bb6
changeset: 12585:c34d871a7bb6
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 04 19:48:29 2011 +0200
description:
lmtp: Fixed handling recipient_delimiter when it was found from domain name.

diffstat:

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

diffs (34 lines):

diff -r 826981b2c5c4 -r c34d871a7bb6 src/lmtp/commands.c
--- a/src/lmtp/commands.c	Wed Feb 02 23:58:32 2011 +0200
+++ b/src/lmtp/commands.c	Fri Feb 04 19:48:29 2011 +0200
@@ -323,7 +323,7 @@
 static void rcpt_address_parse(struct client *client, const char *address,
 			       const char **username_r, const char **detail_r)
 {
-	const char *p, *p2;
+	const char *p, *domain;
 
 	*username_r = address;
 	*detail_r = "";
@@ -331,16 +331,16 @@
 	if (*client->set->recipient_delimiter == '\0')
 		return;
 
+	domain = strchr(address, '@');
 	p = strstr(address, client->set->recipient_delimiter);
-	if (p != NULL) {
+	if (p != NULL && (domain == NULL || p < domain)) {
 		/* user+detail at domain */
 		*username_r = t_strdup_until(*username_r, p);
-		p2 = strchr(p, '@');
-		if (p2 == NULL)
+		if (domain == NULL)
 			*detail_r = p+1;
 		else {
-			*detail_r = t_strdup_until(p+1, p2);
-			*username_r = t_strconcat(*username_r, p2, NULL);
+			*detail_r = t_strdup_until(p+1, domain);
+			*username_r = t_strconcat(*username_r, domain, NULL);
 		}
 	}
 }


More information about the dovecot-cvs mailing list