uschar *v = smtp_cmd_data + Ustrlen(smtp_cmd_data) - 1;
while (isspace(*v)) v--;
v[1] = 0;
-while (v > smtp_cmd_data && *v != '=' && !isspace(*v)) v--;
+while (v > smtp_cmd_data && *v != '=' && !isspace(*v))
+ {
+ /* Take care to not stop at a space embedded in a quoted local-part */
+
+ if (*v == '"') do v--; while (*v != '"' && v > smtp_cmd_data+1);
+ v--;
+ }
n = v;
if (*v == '=')
--- /dev/null
+# Exim test configuration 0579
+
+.include DIR/aux-var/std_conf_prefix
+
+primary_hostname = myhost.test.ex
+
+# ----- Main settings -----
+
+domainlist local_domains = test.ex
+log_selector = +received_recipients
+
+acl_smtp_rcpt = accept logwrite=cmd '$smtp_command'
+
+# ------ ACLs ------
+
+begin acl
+
+# ------ Routers ------
+
+begin routers
+
+r1:
+ driver = redirect
+ data = :blackhole:
+
+
+# ------ Transports ------
+
+begin transports
+
+# End
--- /dev/null
+# local-part with space, esmtp reception
+#
+exim -DSERVER=server -bd -oX PORT_D
+****
+#
+client 127.0.0.1 PORT_D
+??? 220
+EHLO test
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250 HELP
+MAIL FROM:<>
+??? 250
+RCPT TO:<"name with spaces"@test.ex>
+??? 250
+DATA
+??? 354
+Subject: test
+
+body
+.
+??? 250
+QUIT
+??? 221
+****
+killdaemon