[exim-cvs] Testsuite: bounce_message_file and warn_message_f…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Testsuite: bounce_message_file and warn_message_file
Gitweb: https://git.exim.org/exim.git/commitdiff/6f585046cf0b00509f0ff7c8f8a48b9cf7c2ab75
Commit:     6f585046cf0b00509f0ff7c8f8a48b9cf7c2ab75
Parent:     302e7912253bd1f1a88f04d9a8a71d8a3c9b93fc
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon May 4 12:25:23 2020 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon May 4 15:04:39 2020 +0100


    Testsuite: bounce_message_file and warn_message_file
---
 test/aux-fixed/0622.bounce.tmpl |  10 ++
 test/confs/0622                 |  49 ++++++
 test/log/0622                   |  38 +++++
 test/mail/0622.bounce_message   | 327 ++++++++++++++++++++++++++++++++++++++++
 test/paniclog/0622              |   2 +
 test/scripts/0000-Basic/0622    |  32 ++++
 test/stderr/0622                |   2 +
 7 files changed, 460 insertions(+)


diff --git a/test/aux-fixed/0622.bounce.tmpl b/test/aux-fixed/0622.bounce.tmpl
new file mode 100644
index 0000000..67f3ae5
--- /dev/null
+++ b/test/aux-fixed/0622.bounce.tmpl
@@ -0,0 +1,10 @@
+Subject: this is a customised bounce message
+****
+Second item.  Forms the start of the error message.
+Expansions:
+ \$sender_address <$sender_address>
+ \$bounce_recipient <$bounce_recipient>
+ \$warn_message_delay "$warn_message_delay"
+****
+Third item.
+****
diff --git a/test/confs/0622 b/test/confs/0622
new file mode 100644
index 0000000..486bac2
--- /dev/null
+++ b/test/confs/0622
@@ -0,0 +1,49 @@
+# Exim test configuration 0622
+# Bounces
+
+.include DIR/aux-var/std_conf_prefix
+
+primary_hostname = myhost.test.ex
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = accept
+log_selector = +received_recipients +millisec
+
+.ifdef OPT
+bounce_message_file = OPT
+warn_message_file = OPT
+.endif
+
+delay_warning =    1s
+
+# ----- Routers -----
+
+begin routers
+
+delay:
+  driver =    redirect
+  local_parts =    ^delay
+  allow_defer
+  data =    :defer: deliberate for test purposes
+
+bounces:
+  driver =    accept
+  condition =    ${if !def:sender_address}
+  transport =    savebounce
+
+begin transports
+
+savebounce:
+  driver =    appendfile
+  file =    DIR/test-mail/bounce_message
+  user =    CALLER
+
+# ----- Retry -----
+
+begin retry
+
+* * F,5d,100s
+
+
+# End
diff --git a/test/log/0622 b/test/log/0622
new file mode 100644
index 0000000..37a40dd
--- /dev/null
+++ b/test/log/0622
@@ -0,0 +1,38 @@
+2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for a@???
+2017-07-30 18:51:05.712 10HmaZ-0005vi-00 ** a@???: Unrouteable address
+2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbA-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbA-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmaZ-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmbB-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for b@???
+2017-07-30 18:51:05.712 10HmbB-0005vi-00 ** b@???: Unrouteable address
+2017-07-30 18:51:05.712 10HmbC-0005vi-00 <= <> R=10HmbB-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbC-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbC-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmbB-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for c@???
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 ** c@???: Unrouteable address
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for error message texts: No such file or directory
+2017-07-30 18:51:05.712 10HmbD-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbD-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbD-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmbE-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for delay_p@???
+2017-07-30 18:51:05.712 10HmbE-0005vi-00 == delay_p@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmbF-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for delay_q@???
+2017-07-30 18:51:05.712 10HmbF-0005vi-00 == delay_q@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss for delay_r@???
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 == delay_r@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmbE-0005vi-00 == delay_p@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmbG-0005vi-00 <= <> R=10HmbE-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbG-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbG-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmbF-0005vi-00 == delay_q@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmbH-0005vi-00 <= <> R=10HmbF-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbH-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbH-0005vi-00 Completed
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 == delay_r@??? R=delay defer (-1): deliberate for test purposes
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for warning message texts: No such file or directory
+2017-07-30 18:51:05.712 10HmbI-0005vi-00 <= <> R=10HmaY-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@???
+2017-07-30 18:51:05.712 10HmbI-0005vi-00 => CALLER <CALLER@???> R=bounces T=savebounce
+2017-07-30 18:51:05.712 10HmbI-0005vi-00 Completed
diff --git a/test/mail/0622.bounce_message b/test/mail/0622.bounce_message
new file mode 100644
index 0000000..9c1c5b3
--- /dev/null
+++ b/test/mail/0622.bounce_message
@@ -0,0 +1,327 @@
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbA-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+X-Failed-Recipients: a@???
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmaZ-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: Mail delivery failed: returning message to sender
+Message-Id: <E10HmbA-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+This message was created automatically by mail delivery software.
+
+A message that you sent could not be delivered to one or more of its
+recipients. This is a permanent error. The following address(es) failed:
+
+  a@???
+    Unrouteable address
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: failed
+Final-Recipient: rfc822;a@???
+Status: 5.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/rfc822
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaZ-0005vi-00
+    for a@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 1.1 - Default deny message
+Message-Id: <E10HmaZ-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbC-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+X-Failed-Recipients: b@???
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmbB-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: this is a customised bounce message
+Message-Id: <E10HmbC-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+Second item.  Forms the start of the error message.
+Expansions:
+ $sender_address <CALLER@???>
+ $bounce_recipient <CALLER@???>
+ $warn_message_delay ""
+
+  b@???
+    Unrouteable address
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: failed
+Final-Recipient: rfc822;b@???
+Status: 5.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/rfc822
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmbB-0005vi-00
+    for b@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 1.2 - Specified deny message file
+Message-Id: <E10HmbB-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbD-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+X-Failed-Recipients: c@???
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmaX-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: Mail delivery failed: returning message to sender
+Message-Id: <E10HmbD-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+This message was created automatically by mail delivery software.
+
+A message that you sent could not be delivered to one or more of its
+recipients. This is a permanent error. The following address(es) failed:
+
+  c@???
+    Unrouteable address
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: failed
+Final-Recipient: rfc822;c@???
+Status: 5.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/rfc822
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaX-0005vi-00
+    for c@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 1.3 - Specified, missing deny message file
+Message-Id: <E10HmaX-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbG-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmbE-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: Warning: message 10HmbE-0005vi-00 delayed 0 minutes
+Message-Id: <E10HmbG-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+This message was created automatically by mail delivery software.
+A message that you sent has not yet been delivered to one or more of its
+recipients after more than 0 minutes on the queue on myhost.test.ex.
+
+The message identifier is:     10HmbE-0005vi-00
+The subject of the message is: test 2.1 - Default delay message
+The date of the message is:    Tue, 2 Mar 1999 09:44:33 +0000
+
+The address to which the message has not yet been delivered is:
+
+  delay_p@???
+    Delay reason: deliberate for test purposes
+
+No action is required on your part. Delivery attempts will continue for
+some time, and this warning may be repeated at intervals if the message
+remains undelivered. Eventually the mail delivery software will give up,
+and when that happens, the message will be returned to you.
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: delayed
+Final-Recipient: rfc822;delay_p@???
+Status: 4.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/rfc822-headers
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmbE-0005vi-00
+    for delay_p@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 2.1 - Default delay message
+Message-Id: <E10HmbE-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbH-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmbF-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: this is a customised bounce message
+Message-Id: <E10HmbH-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+Second item.  Forms the start of the error message.
+Expansions:
+ $sender_address <CALLER@???>
+ $bounce_recipient <>
+ $warn_message_delay "0 minutes"
+
+  delay_q@???
+    Delay reason: deliberate for test purposes
+
+Third item.
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: delayed
+Final-Recipient: rfc822;delay_q@???
+Status: 4.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/rfc822-headers
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmbF-0005vi-00
+    for delay_q@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 2.2 - Specified delay message file
+Message-Id: <E10HmbF-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
+From MAILER-DAEMON Tue Mar 02 09:44:33 1999
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbI-0005vi-00
+    for CALLER@???; Tue, 2 Mar 1999 09:44:33 +0000
+Auto-Submitted: auto-replied
+From: Mail Delivery System <Mailer-Daemon@???>
+To: CALLER@???
+References: <E10HmaY-0005vi-00@???>
+Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
+MIME-Version: 1.0
+Subject: Warning: message 10HmaY-0005vi-00 delayed 0 minutes
+Message-Id: <E10HmbI-0005vi-00@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/plain; charset=us-ascii
+
+This message was created automatically by mail delivery software.
+A message that you sent has not yet been delivered to one or more of its
+recipients after more than 0 minutes on the queue on myhost.test.ex.
+
+The message identifier is:     10HmaY-0005vi-00
+The subject of the message is: test 2.3 - Specified, missing delay message file
+The date of the message is:    Tue, 2 Mar 1999 09:44:33 +0000
+
+The address to which the message has not yet been delivered is:
+
+  delay_r@???
+    Delay reason: deliberate for test purposes
+
+No action is required on your part. Delivery attempts will continue for
+some time, and this warning may be repeated at intervals if the message
+remains undelivered. Eventually the mail delivery software will give up,
+and when that happens, the message will be returned to you.
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: message/delivery-status
+
+Reporting-MTA: dns; myhost.test.ex
+
+Action: delayed
+Final-Recipient: rfc822;delay_r@???
+Status: 4.0.0
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM
+Content-type: text/rfc822-headers
+
+Return-path: <CALLER@???>
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaY-0005vi-00
+    for delay_r@???; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test 2.3 - Specified, missing delay message file
+Message-Id: <E10HmaY-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+
+--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+
diff --git a/test/paniclog/0622 b/test/paniclog/0622
new file mode 100644
index 0000000..88ae44a
--- /dev/null
+++ b/test/paniclog/0622
@@ -0,0 +1,2 @@
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for error message texts: No such file or directory
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for warning message texts: No such file or directory
diff --git a/test/scripts/0000-Basic/0622 b/test/scripts/0000-Basic/0622
new file mode 100644
index 0000000..a7c966d
--- /dev/null
+++ b/test/scripts/0000-Basic/0622
@@ -0,0 +1,32 @@
+# bounce_message_file and warn_message_file
+#
+exim -odf a@???
+Subject: test 1.1 - Default deny message
+****
+exim -odf -DOPT=DIR/aux-fixed/TESTNUM.bounce.tmpl b@???
+Subject: test 1.2 - Specified deny message file
+****
+exim -odf -DOPT=DIR/aux-fixed/TESTNUM.nonexist.tmpl c@???
+Subject: test 1.3 - Specified, missing deny message file
+****
+#
+exim -odf delay_p@???
+Subject: test 2.1 - Default delay message
+****
+exim -odf -DOPT=DIR/aux-fixed/TESTNUM.bounce.tmpl delay_q@???
+Subject: test 2.2 - Specified delay message file
+****
+exim -odf -DOPT=DIR/aux-fixed/TESTNUM.nonexist.tmpl delay_r@???
+Subject: test 2.3 - Specified, missing delay message file
+****
+sleep 1
+exim -M $msg1
+****
+exim -DOPT=DIR/aux-fixed/TESTNUM.bounce.tmpl -M $msg2
+****
+exim -DOPT=DIR/aux-fixed/TESTNUM.nonexist.tmpl -M $msg3
+****
+sleep 1
+#
+#
+no_msglog_check
diff --git a/test/stderr/0622 b/test/stderr/0622
new file mode 100644
index 0000000..88ae44a
--- /dev/null
+++ b/test/stderr/0622
@@ -0,0 +1,2 @@
+2017-07-30 18:51:05.712 10HmaX-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for error message texts: No such file or directory
+2017-07-30 18:51:05.712 10HmaY-0005vi-00 Failed to open TESTSUITE/aux-fixed/0622.nonexist.tmpl for warning message texts: No such file or directory