ph10 2006/10/03 11:25:56 BST
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src verify.c
exim-test/aux-fixed 0212.aliases
exim-test/scripts/0000-Basic 0212
exim-test/stdout 0212
Log:
Fix misleading verification output when -v is used with -bv and aliasing
leads to a mixture of successful and unsuccessful verification.
Revision Changes Path
1.402 +9 -0 exim/exim-doc/doc-txt/ChangeLog
1.40 +34 -8 exim/exim-src/src/verify.c
1.2 +2 -0 exim/exim-test/aux-fixed/0212.aliases
1.2 +7 -0 exim/exim-test/scripts/0000-Basic/0212
1.2 +16 -8 exim/exim-test/stdout/0212
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.401
retrieving revision 1.402
diff -u -r1.401 -r1.402
--- ChangeLog 3 Oct 2006 08:54:50 -0000 1.401
+++ ChangeLog 3 Oct 2006 10:25:55 -0000 1.402
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.401 2006/10/03 08:54:50 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.402 2006/10/03 10:25:55 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -81,6 +81,15 @@
PH/13 Added $message_headers_raw to provide the headers without RFC 2047
decoding.
+
+PH/14 Corrected misleading output from -bv when -v was also used. Suppose the
+ address A is aliased to B and C, where B exists and C does not. Without
+ -v the output is "A verified" because verification stops after a
+ successful redirection if more than one address is generated. However,
+ with -v the child addresses are also verified. Exim was outputting "A
+ failed to verify" and then showing the successful verification for C,
+ with its parentage. It now outputs "B failed to verify", showing B's
+ parentage before showing the successful verification of C.
Exim version 4.63
Index: verify.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/verify.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- verify.c 25 Sep 2006 11:25:37 -0000 1.39
+++ verify.c 3 Oct 2006 10:25:55 -0000 1.40
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/verify.c,v 1.39 2006/09/25 11:25:37 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/verify.c,v 1.40 2006/10/03 10:25:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1009,11 +1009,17 @@
while (addr_new != NULL)
{
int rc;
+ uschar *show_address;
address_item *addr = addr_new;
addr_new = addr->next;
addr->next = NULL;
+ /* When full_info is set, child addresses are displayed in top-level
+ messages. Otherwise, we show only the top level address. */
+
+ show_address = full_info? addr->address : address;
+
DEBUG(D_verify)
{
debug_printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
@@ -1207,14 +1213,24 @@
allok = FALSE;
if (f != NULL)
{
- fprintf(f, "%s%s %s", ko_prefix, address,
+ address_item *p = addr->parent;
+
+ fprintf(f, "%s%s %s", ko_prefix, show_address,
address_test_mode? "is undeliverable" : "failed to verify");
if (!expn && admin_user)
{
if (addr->basic_errno > 0)
fprintf(f, ": %s", strerror(addr->basic_errno));
if (addr->message != NULL)
- fprintf(f, ":\n %s", addr->message);
+ fprintf(f, ": %s", addr->message);
+ }
+
+ /* Show parents iff doing full info */
+
+ if (full_info) while (p != NULL)
+ {
+ fprintf(f, "%s\n <-- %s", cr, p->address);
+ p = p->parent;
}
fprintf(f, "%s\n", cr);
}
@@ -1230,25 +1246,35 @@
allok = FALSE;
if (f != NULL)
{
- fprintf(f, "%s%s cannot be resolved at this time", ko_prefix, address);
+ address_item *p = addr->parent;
+ fprintf(f, "%s%s cannot be resolved at this time", ko_prefix,
+ show_address);
if (!expn && admin_user)
{
if (addr->basic_errno > 0)
- fprintf(f, ":\n %s", strerror(addr->basic_errno));
+ fprintf(f, ": %s", strerror(addr->basic_errno));
if (addr->message != NULL)
- fprintf(f, ":\n %s", addr->message);
+ fprintf(f, ": %s", addr->message);
else if (addr->basic_errno <= 0)
- fprintf(f, ":\n unknown error");
+ fprintf(f, ": unknown error");
}
+ /* Show parents iff doing full info */
+
+ if (full_info) while (p != NULL)
+ {
+ fprintf(f, "%s\n <-- %s", cr, p->address);
+ p = p->parent;
+ }
fprintf(f, "%s\n", cr);
}
+
if (!full_info) return copy_error(vaddr, addr, DEFER);
else if (yield == OK) yield = DEFER;
}
/* If we are handling EXPN, we do not want to continue to route beyond
- the top level. */
+ the top level (whose address is in "address"). */
else if (expn)
{
@@ -1295,7 +1321,7 @@
(addr_new != NULL && /* At least one new address AND */
success_on_redirect))) /* success_on_redirect is set */
{
- if (f != NULL) fprintf(f, "%s %s\n", address,
+ if (f != NULL) fprintf(f, "%s %s\n", show_address,
address_test_mode? "is deliverable" : "verified");
/* If we have carried on to verify a child address, we want the value
Index: 0212.aliases
===================================================================
RCS file: /home/cvs/exim/exim-test/aux-fixed/0212.aliases,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0212.aliases 7 Feb 2006 10:16:23 -0000 1.1
+++ 0212.aliases 3 Oct 2006 10:25:55 -0000 1.2
@@ -6,3 +6,5 @@
p: userx
pipe: |/bin/nosuchfile
file: /tmp/junk
+v1: a3, userx
+v2: userx, a3
Index: 0212
===================================================================
RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0212,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0212 7 Feb 2006 10:54:33 -0000 1.1
+++ 0212 3 Oct 2006 10:25:55 -0000 1.2
@@ -40,3 +40,10 @@
vrfy <"smartuser.b@???>
quit
****
+# Check fail/non-fail without and with -v
+0
+exim -bv v1 v2
+****
+2
+exim -v -bv v1 v2
+****
Index: 0212
===================================================================
RCS file: /home/cvs/exim/exim-test/stdout/0212,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0212 7 Feb 2006 10:47:37 -0000 1.1
+++ 0212 3 Oct 2006 10:25:55 -0000 1.2
@@ -1,17 +1,13 @@
> a@??? verified
-> b@??? failed to verify:
- Unrouteable address
-> f@??? failed to verify:
- bad user
+> b@??? failed to verify: Unrouteable address
+> f@??? failed to verify: bad user
> p@??? verified
-> x@??? failed to verify:
- Unrouteable address
+> x@??? failed to verify: Unrouteable address
> y@??? verified
> pipe@??? verified
> file@??? verified
> "smartuser.a@??? verified
-> "smartuser.b@??? failed to verify:
- Unrouteable address
+> "smartuser.b@??? failed to verify: Unrouteable address
> "smartuser.b@??? verified
>
220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
@@ -40,3 +36,15 @@
550 <"smartuser.b@???> Unrouteable address
250 <"smartuser.b@???> is deliverable
221 the.local.host.name closing connection
+v1@??? verified
+v2@??? verified
+a3@??? failed to verify: bad user
+ <-- v1@???
+userx@???
+ <-- v1@???
+ router = all, transport = local_delivery
+a3@??? failed to verify: bad user
+ <-- v2@???
+userx@??? [duplicate, would not be delivered]
+ <-- v2@???
+ router = all, transport = local_delivery