From: Jeremy Harris Date: Thu, 19 Jan 2017 12:26:35 +0000 (+0000) Subject: VRFY: add docs note on results, and additional test cases X-Git-Tag: exim-4_89_RC1~36 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c39b93a62e182a09450f212b03705dcafa7431aa;p=exim.git VRFY: add docs note on results, and additional test cases --- diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 18e171036..8303848c8 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -28093,6 +28093,11 @@ run. A &"discard"& return from the DATA or the non-SMTP ACL discards all the remaining recipients. The &"discard"& return is not permitted for the &%acl_smtp_predata%& ACL. +.new +If the ACL for VRFY returns &"accept"&, a recipient verify (without callout) +is done on the address and the result determines the SMTP response. +.wen + .cindex "&[local_scan()]& function" "when all recipients discarded" The &[local_scan()]& function is always run, even if there are no remaining diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 655e25394..890c7c517 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -4617,7 +4617,7 @@ while (done <= 0) friends now makes it absolutely clear that it means *mailbox*. Consequently we must always qualify this address, regardless. */ - if (recipient_domain == 0) + if (!recipient_domain) if (!(recipient_domain = qualify_recipient(&recipient, smtp_cmd_data, US"recipient"))) { @@ -4875,7 +4875,7 @@ while (done <= 0) break; } - if (recipient_domain == 0) + if (!recipient_domain) if (!(recipient_domain = qualify_recipient(&address, smtp_cmd_data, US"verify"))) break; diff --git a/test/confs/0041 b/test/confs/0041 index 5157170f2..f7fa61ed8 100644 --- a/test/confs/0041 +++ b/test/confs/0041 @@ -11,6 +11,7 @@ acl_smtp_vrfy = check_vrfy acl_smtp_expn = check_expn qualify_domain = test.ex no_write_rejectlog +recipient_unqualified_hosts = 3.3.3.3 # ----- ACLs ----- @@ -20,6 +21,9 @@ begin acl check_vrfy: deny local_parts = hardfail message = 599 custom reject + accept local_parts = acceptable + accept local_parts = ok_with_dom + domains = test.ex check_expn: accept hosts = 2.2.2.2 @@ -36,7 +40,7 @@ system_aliases: localuser: driver = accept - local_parts = userx + local_parts = userx : ok_with_dom : acceptable transport = local_delivery diff --git a/test/scripts/0000-Basic/0041 b/test/scripts/0000-Basic/0041 index 0f8cdb3b5..521c00618 100644 --- a/test/scripts/0000-Basic/0041 +++ b/test/scripts/0000-Basic/0041 @@ -2,11 +2,16 @@ exim -bh 1.1.1.1 vrfy userx@test.ex vrfy hardfail@test.ex +vrfy ok_with_dom@test.ex vrfy unqual vrfy expn postmaster quit **** +exim -bh 3.3.3.3 +vrfy acceptable +quit +**** exim -bh 2.2.2.2 expn list quit diff --git a/test/stderr/0041 b/test/stderr/0041 index b00305212..0d3f40044 100644 --- a/test/stderr/0041 +++ b/test/stderr/0041 @@ -2,7 +2,7 @@ >>> host in host_lookup? no (option unset) >>> host in host_reject_connection? no (option unset) >>> host in sender_unqualified_hosts? no (option unset) ->>> host in recipient_unqualified_hosts? no (option unset) +>>> host in recipient_unqualified_hosts? no (end of list) >>> host in helo_verify_hosts? no (option unset) >>> host in helo_try_verify_hosts? no (option unset) >>> host in helo_accept_junk_hosts? no (option unset) @@ -12,6 +12,14 @@ >>> check local_parts = hardfail >>> userx in "hardfail"? no (end of list) >>> deny: condition test failed in ACL "check_vrfy" +>>> processing "accept" +>>> check local_parts = acceptable +>>> userx in "acceptable"? no (end of list) +>>> accept: condition test failed in ACL "check_vrfy" +>>> processing "accept" +>>> check local_parts = ok_with_dom +>>> userx in "ok_with_dom"? no (end of list) +>>> accept: condition test failed in ACL "check_vrfy" >>> end of ACL "check_vrfy": implicit DENY LOG: H=[1.1.1.1] rejected VRFY userx@test.ex >>> using ACL "check_vrfy" @@ -22,6 +30,29 @@ LOG: H=[1.1.1.1] rejected VRFY userx@test.ex >>> deny: condition test succeeded in ACL "check_vrfy" >>> end of ACL "check_vrfy": DENY LOG: H=[1.1.1.1] rejected VRFY hardfail@test.ex: 599 custom reject +>>> using ACL "check_vrfy" +>>> processing "deny" +>>> check local_parts = hardfail +>>> ok_with_dom in "hardfail"? no (end of list) +>>> deny: condition test failed in ACL "check_vrfy" +>>> processing "accept" +>>> check local_parts = acceptable +>>> ok_with_dom in "acceptable"? no (end of list) +>>> accept: condition test failed in ACL "check_vrfy" +>>> processing "accept" +>>> check local_parts = ok_with_dom +>>> ok_with_dom in "ok_with_dom"? yes (matched "ok_with_dom") +>>> check domains = test.ex +>>> test.ex in "test.ex"? yes (matched "test.ex") +>>> accept: condition test succeeded in ACL "check_vrfy" +>>> end of ACL "check_vrfy": ACCEPT +>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>> routing ok_with_dom@test.ex +>>> calling system_aliases router +>>> system_aliases router declined for ok_with_dom@test.ex +>>> ok_with_dom in "userx : ok_with_dom : acceptable"? yes (matched "ok_with_dom") +>>> calling localuser router +>>> routed by localuser router >>> using ACL "check_expn" >>> processing "accept" >>> check hosts = 2.2.2.2 @@ -33,7 +64,33 @@ LOG: H=[1.1.1.1] rejected EXPN postmaster >>> host in host_lookup? no (option unset) >>> host in host_reject_connection? no (option unset) >>> host in sender_unqualified_hosts? no (option unset) ->>> host in recipient_unqualified_hosts? no (option unset) +>>> host in recipient_unqualified_hosts? yes (matched "3.3.3.3") +>>> host in helo_verify_hosts? no (option unset) +>>> host in helo_try_verify_hosts? no (option unset) +>>> host in helo_accept_junk_hosts? no (option unset) +>>> host in smtp_accept_max_nonmail_hosts? yes (matched "*") +>>> using ACL "check_vrfy" +>>> processing "deny" +>>> check local_parts = hardfail +>>> acceptable in "hardfail"? no (end of list) +>>> deny: condition test failed in ACL "check_vrfy" +>>> processing "accept" +>>> check local_parts = acceptable +>>> acceptable in "acceptable"? yes (matched "acceptable") +>>> accept: condition test succeeded in ACL "check_vrfy" +>>> end of ACL "check_vrfy": ACCEPT +>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>> routing acceptable@test.ex +>>> calling system_aliases router +>>> system_aliases router declined for acceptable@test.ex +>>> acceptable in "userx : ok_with_dom : acceptable"? yes (matched "acceptable") +>>> calling localuser router +>>> routed by localuser router +>>> host in hosts_connection_nolog? no (option unset) +>>> host in host_lookup? no (option unset) +>>> host in host_reject_connection? no (option unset) +>>> host in sender_unqualified_hosts? no (option unset) +>>> host in recipient_unqualified_hosts? no (end of list) >>> host in helo_verify_hosts? no (option unset) >>> host in helo_try_verify_hosts? no (option unset) >>> host in helo_accept_junk_hosts? no (option unset) diff --git a/test/stdout/0041 b/test/stdout/0041 index 6b22865b0..eb2472f52 100644 --- a/test/stdout/0041 +++ b/test/stdout/0041 @@ -6,11 +6,20 @@ 220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 252 Administrative prohibition 599 custom reject +250 is deliverable 501 unqual: recipient address must contain a domain 501 empty address 550 Administrative prohibition 221 the.local.host.name closing connection +**** SMTP testing session as if from host 3.3.3.3 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 is deliverable +221 the.local.host.name closing connection + **** SMTP testing session as if from host 2.2.2.2 **** but without any ident (RFC 1413) callback. **** This is not for real!