From 81e509d738395fbfd837fbda1681971591109f8a Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Thu, 16 Mar 2006 11:14:46 +0000 Subject: [PATCH] User, not system, error message for VRFY defer. --- doc/doc-txt/ChangeLog | 5 ++++- src/src/smtp_in.c | 10 +++++----- test/confs/0042 | 5 +++++ test/scripts/0000-Basic/0042 | 1 + test/stderr/0042 | 12 ++++++++++++ test/stdout/0042 | 1 + 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index f28bb3286..1545e72c4 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.327 2006/03/09 15:10:16 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.328 2006/03/16 11:14:46 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -303,6 +303,9 @@ PH/58 Allow for the insertion of a newline as well as a space when a string PH/59 Added the following errors that can be detected in retry rules: mail_4xx, data_4xx, lost_connection, tls_required. +PH/60 When a VRFY deferred or FAILED, the log message rather than the user + message was being sent as an SMTP response. + Exim version 4.60 ----------------- diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 1ed5183a6..e83235836 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/smtp_in.c,v 1.36 2006/03/08 10:49:18 ph10 Exp $ */ +/* $Cambridge: exim/src/src/smtp_in.c,v 1.37 2006/03/16 11:14:46 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -3208,14 +3208,14 @@ while (done <= 0) break; case DEFER: - s = (addr->message != NULL)? - string_sprintf("451 <%s> %s", address, addr->message) : + s = (addr->user_message != NULL)? + string_sprintf("451 <%s> %s", address, addr->user_message) : string_sprintf("451 Cannot resolve <%s> at this time", address); break; case FAIL: - s = (addr->message != NULL)? - string_sprintf("550 <%s> %s", address, addr->message) : + s = (addr->user_message != NULL)? + string_sprintf("550 <%s> %s", address, addr->user_message) : string_sprintf("550 <%s> is not deliverable", address); log_write(0, LOG_MAIN, "VRFY failed for %s %s", smtp_cmd_argument, host_and_ident(TRUE)); diff --git a/test/confs/0042 b/test/confs/0042 index 15e1e6729..4d994e4c5 100644 --- a/test/confs/0042 +++ b/test/confs/0042 @@ -24,6 +24,11 @@ fail_remote_domains: domains = ! +local_domains data = :fail: unrouteable mail domain "$domain" +fail_expansion: + driver = redirect + local_parts = expan + data = ${if with syntax error + localuser: driver = accept local_parts = userx diff --git a/test/scripts/0000-Basic/0042 b/test/scripts/0000-Basic/0042 index a0b2e4f2c..2c8975a69 100644 --- a/test/scripts/0000-Basic/0042 +++ b/test/scripts/0000-Basic/0042 @@ -2,4 +2,5 @@ exim -bh 1.1.1.1 vrfy userx@test.ex vrfy junkjunk@test.ex +vrfy expan@test.ex quit diff --git a/test/stderr/0042 b/test/stderr/0042 index 2c4cc1dc8..740dc1bfa 100644 --- a/test/stderr/0042 +++ b/test/stderr/0042 @@ -13,6 +13,7 @@ >>> routing userx@test.ex >>> test.ex in "test.ex"? yes (matched "test.ex") >>> test.ex in "! +local_domains"? no (matched "! +local_domains") +>>> userx in "expan"? no (end of list) >>> userx in "userx"? yes (matched "userx") >>> calling localuser router >>> routed by localuser router @@ -22,6 +23,17 @@ >>> routing junkjunk@test.ex >>> test.ex in "test.ex"? yes (matched "test.ex") >>> test.ex in "! +local_domains"? no (matched "! +local_domains") +>>> junkjunk in "expan"? no (end of list) >>> junkjunk in "userx"? no (end of list) >>> no more routers LOG: VRFY failed for junkjunk@test.ex H=[1.1.1.1] +>>> processing "accept" +>>> accept: condition test succeeded +>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>> routing expan@test.ex +>>> test.ex in "test.ex"? yes (matched "test.ex") +>>> test.ex in "! +local_domains"? no (matched "! +local_domains") +>>> expan in "expan"? yes (matched "expan") +>>> calling fail_expansion router +>>> fail_expansion router: defer for expan@test.ex +>>> message: failed to expand "${if with syntax error": unknown condition "with" diff --git a/test/stdout/0042 b/test/stdout/0042 index 76d3552bc..8602d02d3 100644 --- a/test/stdout/0042 +++ b/test/stdout/0042 @@ -6,4 +6,5 @@ 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 is deliverable 550 Unrouteable address +451 Cannot resolve at this time 221 the.local.host.name closing connection -- 2.25.1