From 770747fd28008931d72a9f87be83286eaf626a95 Mon Sep 17 00:00:00 2001 From: "Michael Fischer v. Mollard" Date: Wed, 5 Mar 2014 18:19:24 -0800 Subject: Code for verify=header_names_ascii Documentation and test included. Fixed Conflicts: doc/doc-txt/ChangeLog --- test/confs/0569 | 34 ++++++++++ test/log/0027 | 2 +- test/rejectlog/0027 | 2 +- test/scripts/0000-Basic/0569 | 147 +++++++++++++++++++++++++++++++++++++++++++ test/stderr/0569 | 144 ++++++++++++++++++++++++++++++++++++++++++ test/stdout/0569 | 75 ++++++++++++++++++++++ 6 files changed, 402 insertions(+), 2 deletions(-) create mode 100644 test/confs/0569 create mode 100644 test/scripts/0000-Basic/0569 create mode 100644 test/stderr/0569 create mode 100644 test/stdout/0569 (limited to 'test') diff --git a/test/confs/0569 b/test/confs/0569 new file mode 100644 index 000000000..0987e7ed0 --- /dev/null +++ b/test/confs/0569 @@ -0,0 +1,34 @@ +# Exim test configuration 0569 + +exim_path = EXIM_PATH +host_lookup_order = bydns +primary_hostname = myhost.test.ex +rfc1413_query_timeout = 0s +spool_directory = DIR/spool +log_file_path = DIR/spool/log/%slog +gecos_pattern = "" +gecos_name = CALLER_NAME + +# ----- Main settings ----- + +acl_smtp_mail = check_from +acl_smtp_rcpt = accept +acl_smtp_data = check_message + +recipient_unqualified_hosts = V4NET.10.10.9 + +# ----- ACL ----- + +begin acl + +check_from: + accept senders = usery@exim.test.ex + set acl_m_message = I do not like your message + accept + +check_message: + require message = ${if def:acl_m_message {$acl_m_message}} + verify = header_names_ascii + accept + +# End diff --git a/test/log/0027 b/test/log/0027 index 9aade8869..3dbfa0258 100644 --- a/test/log/0027 +++ b/test/log/0027 @@ -3,7 +3,7 @@ 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : deny for userx 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = header_syntax"@test.ex>: cannot verify header_syntax in ACL for RCPT -1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = junk"@test.ex>: expected "sender[=address]", "recipient", "helo", "header_syntax", "header_sender" or "reverse_host_lookup" at start of ACL condition "verify junk" +1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = junk"@test.ex>: expected "sender[=address]", "recipient", "helo", "header_syntax", "header_sender", "header_names_ascii" or "reverse_host_lookup" at start of ACL condition "verify junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny vorify = junk"@test.ex>: unknown ACL condition/modifier in "deny vorify = junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"dony verify = junk"@test.ex>: unknown ACL verb "dony" in "dony verify = junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny !message = abcd"@test.ex>: ACL error: negation is not allowed with "message" diff --git a/test/rejectlog/0027 b/test/rejectlog/0027 index 24bcc70e9..b80e61635 100644 --- a/test/rejectlog/0027 +++ b/test/rejectlog/0027 @@ -3,7 +3,7 @@ 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : deny for userx 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = header_syntax"@test.ex>: cannot verify header_syntax in ACL for RCPT -1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = junk"@test.ex>: expected "sender[=address]", "recipient", "helo", "header_syntax", "header_sender" or "reverse_host_lookup" at start of ACL condition "verify junk" +1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny verify = junk"@test.ex>: expected "sender[=address]", "recipient", "helo", "header_syntax", "header_sender", "header_names_ascii" or "reverse_host_lookup" at start of ACL condition "verify junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny vorify = junk"@test.ex>: unknown ACL condition/modifier in "deny vorify = junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"dony verify = junk"@test.ex>: unknown ACL verb "dony" in "dony verify = junk" 1999-03-02 09:44:33 U=CALLER F=<> temporarily rejected RCPT <"deny !message = abcd"@test.ex>: ACL error: negation is not allowed with "message" diff --git a/test/scripts/0000-Basic/0569 b/test/scripts/0000-Basic/0569 new file mode 100644 index 000000000..41cdb8731 --- /dev/null +++ b/test/scripts/0000-Basic/0569 @@ -0,0 +1,147 @@ +# verify = header_names_ascii +# 1. Headers are good, make sure no misfires. +exim -bh V4NET.10.10.10 +mail from: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +Subject: testing + +. +QUIT +**** +# 3. A non-ASCII character in header name, different from sets an acl variable +# causing custom log message +exim -bh V4NET.10.10.10 +mail from: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +Subjec⍅: testing + +. +QUIT +**** +# 4. A non-ASCII character in header name, uses default rejection message +exim -bh V4NET.10.10.10 +mail from: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +Subjec⍅: testing + +. +QUIT +**** +# 5. Headers are good, Unicode in message body, make sure no misfires. +exim -bh V4NET.10.10.10 +mail from: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +Subject: testing + +Some unicode characters: 顷晦٦ +This email should be accepted because the headers are ok. +. +QUIT +**** +# 6. Headers are good, Unicode in a header content *and* message body, +# make sure no misfires. +exim -bh V4NET.10.10.10 +mail from: +rcpt to: +data +Received: from mail.example.com([10.11.12.13] helo=mail.example.com) + by mail1-int.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRL-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:57:00 +0000 +Received: from mail1-int.example.com([10.120.12.12] helo=mail1-int.example.com) + by webmail1.example.com with esmtp (Exim 4.80) + envelope-from + id 1WIJRK-0005Dw-MW + for XX@YY; Tue, 25 Feb 2014 15:56:58 +0000 +From: userx@exim.test.ex +To: userx@test.ex +Cc: +Subject: testing + +Some unicode characters: 顷晦٦ +This email should be accepted because the headers are ok even though the +content of one of the headers has unicode. +. +QUIT +**** +no_msglog_check diff --git a/test/stderr/0569 b/test/stderr/0569 new file mode 100644 index 000000000..b17c2ac20 --- /dev/null +++ b/test/stderr/0569 @@ -0,0 +1,144 @@ +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> userx@exim.test.ex in "usery@exim.test.ex"? no (end of list) +>>> accept: condition test failed in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test succeeded in ACL "check_message" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_message" +LOG: 10HmaX-0005vi-00 <= userx@exim.test.ex H=[V4NET.10.10.10] P=smtp S=sss +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> userx@exim.test.ex in "usery@exim.test.ex"? no (end of list) +>>> accept: condition test failed in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test failed in ACL "check_message" +LOG: 10HmbA-0005vi-00 H=[V4NET.10.10.10] F= rejected after DATA: Invalid character in header "Received" found +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> exim.test.ex in "exim.test.ex"? yes (matched "exim.test.ex") +>>> usery@exim.test.ex in "usery@exim.test.ex"? yes (matched "usery@exim.test.ex") +>>> check set acl_m_message = I do not like your message +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test failed in ACL "check_message" +LOG: 10HmbB-0005vi-00 H=[V4NET.10.10.10] F= rejected after DATA: Invalid character in header "Subjec⍅" found +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> userx@exim.test.ex in "usery@exim.test.ex"? no (end of list) +>>> accept: condition test failed in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test failed in ACL "check_message" +LOG: 10HmbC-0005vi-00 H=[V4NET.10.10.10] F= rejected after DATA: Invalid character in header "Subjec⍅" found +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> userx@exim.test.ex in "usery@exim.test.ex"? no (end of list) +>>> accept: condition test failed in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test succeeded in ACL "check_message" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_message" +LOG: 10HmaY-0005vi-00 <= userx@exim.test.ex H=[V4NET.10.10.10] P=smtp S=sss +>>> 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) +>>> using ACL "check_from" +>>> processing "accept" +>>> check senders = usery@exim.test.ex +>>> userx@exim.test.ex in "usery@exim.test.ex"? no (end of list) +>>> accept: condition test failed in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_from" +>>> processing "accept" +>>> accept: condition test succeeded in inline ACL +>>> host in ignore_fromline_hosts? no (option unset) +>>> using ACL "check_message" +>>> processing "require" +>>> check verify = header_names_ascii +>>> require: condition test succeeded in ACL "check_message" +>>> processing "accept" +>>> accept: condition test succeeded in ACL "check_message" +LOG: 10HmaZ-0005vi-00 <= userx@exim.test.ex H=[V4NET.10.10.10] P=smtp S=sss diff --git a/test/stdout/0569 b/test/stdout/0569 new file mode 100644 index 000000000..9d825581c --- /dev/null +++ b/test/stdout/0569 @@ -0,0 +1,75 @@ + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaX-0005vi-00 + +**** SMTP testing: that is not a real message id! + +221 myhost.test.ex closing connection + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +550 Administrative prohibition +221 myhost.test.ex closing connection + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +550 I do not like your message +221 myhost.test.ex closing connection + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +550 Administrative prohibition +221 myhost.test.ex closing connection + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaY-0005vi-00 + +**** SMTP testing: that is not a real message id! + +221 myhost.test.ex closing connection + +**** SMTP testing session as if from host V4NET.10.10.10 +**** but without any ident (RFC 1413) callback. +**** This is not for real! + +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaZ-0005vi-00 + +**** SMTP testing: that is not a real message id! + +221 myhost.test.ex closing connection -- cgit v1.2.3