From 6f585046cf0b00509f0ff7c8f8a48b9cf7c2ab75 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Mon, 4 May 2020 12:25:23 +0100 Subject: [PATCH 1/1] 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(+) create mode 100644 test/aux-fixed/0622.bounce.tmpl create mode 100644 test/confs/0622 create mode 100644 test/log/0622 create mode 100644 test/mail/0622.bounce_message create mode 100644 test/paniclog/0622 create mode 100644 test/scripts/0000-Basic/0622 create mode 100644 test/stderr/0622 diff --git a/test/aux-fixed/0622.bounce.tmpl b/test/aux-fixed/0622.bounce.tmpl new file mode 100644 index 000000000..67f3ae555 --- /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 000000000..486bac27d --- /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 000000000..37a40dd49 --- /dev/null +++ b/test/log/0622 @@ -0,0 +1,38 @@ +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for a@test.ex +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 ** a@test.ex: Unrouteable address +2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@myhost.test.ex +2017-07-30 18:51:05.712 10HmbA-0005vi-00 => 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@myhost.test.ex U=CALLER P=local S=sss for b@test.ex +2017-07-30 18:51:05.712 10HmbB-0005vi-00 ** b@test.ex: Unrouteable address +2017-07-30 18:51:05.712 10HmbC-0005vi-00 <= <> R=10HmbB-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@myhost.test.ex +2017-07-30 18:51:05.712 10HmbC-0005vi-00 => 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@myhost.test.ex U=CALLER P=local S=sss for c@test.ex +2017-07-30 18:51:05.712 10HmaX-0005vi-00 ** c@test.ex: 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@myhost.test.ex +2017-07-30 18:51:05.712 10HmbD-0005vi-00 => 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@myhost.test.ex U=CALLER P=local S=sss for delay_p@test.ex +2017-07-30 18:51:05.712 10HmbE-0005vi-00 == delay_p@test.ex R=delay defer (-1): deliberate for test purposes +2017-07-30 18:51:05.712 10HmbF-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for delay_q@test.ex +2017-07-30 18:51:05.712 10HmbF-0005vi-00 == delay_q@test.ex R=delay defer (-1): deliberate for test purposes +2017-07-30 18:51:05.712 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for delay_r@test.ex +2017-07-30 18:51:05.712 10HmaY-0005vi-00 == delay_r@test.ex R=delay defer (-1): deliberate for test purposes +2017-07-30 18:51:05.712 10HmbE-0005vi-00 == delay_p@test.ex 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@myhost.test.ex +2017-07-30 18:51:05.712 10HmbG-0005vi-00 => 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@test.ex 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@myhost.test.ex +2017-07-30 18:51:05.712 10HmbH-0005vi-00 => 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@test.ex 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@myhost.test.ex +2017-07-30 18:51:05.712 10HmbI-0005vi-00 => 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 000000000..9c1c5b348 --- /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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +X-Failed-Recipients: a@test.ex +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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@test.ex + Unrouteable address + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/delivery-status + +Reporting-MTA: dns; myhost.test.ex + +Action: failed +Final-Recipient: rfc822;a@test.ex +Status: 5.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/rfc822 + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmaZ-0005vi-00 + for a@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 1.1 - Default deny message +Message-Id: +From: CALLER_NAME +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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +X-Failed-Recipients: b@test.ex +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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 + $bounce_recipient + $warn_message_delay "" + + b@test.ex + Unrouteable address + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/delivery-status + +Reporting-MTA: dns; myhost.test.ex + +Action: failed +Final-Recipient: rfc822;b@test.ex +Status: 5.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/rfc822 + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmbB-0005vi-00 + for b@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 1.2 - Specified deny message file +Message-Id: +From: CALLER_NAME +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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +X-Failed-Recipients: c@test.ex +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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@test.ex + Unrouteable address + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/delivery-status + +Reporting-MTA: dns; myhost.test.ex + +Action: failed +Final-Recipient: rfc822;c@test.ex +Status: 5.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: message/rfc822 + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmaX-0005vi-00 + for c@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 1.3 - Specified, missing deny message file +Message-Id: +From: CALLER_NAME +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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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@test.ex + 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@test.ex +Status: 4.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: text/rfc822-headers + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmbE-0005vi-00 + for delay_p@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 2.1 - Default delay message +Message-Id: +From: CALLER_NAME +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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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 + $bounce_recipient <> + $warn_message_delay "0 minutes" + + delay_q@test.ex + 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@test.ex +Status: 4.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: text/rfc822-headers + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmbF-0005vi-00 + for delay_q@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 2.2 - Specified delay message file +Message-Id: +From: CALLER_NAME +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@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Auto-Submitted: auto-replied +From: Mail Delivery System +To: CALLER@myhost.test.ex +References: +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: +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@test.ex + 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@test.ex +Status: 4.0.0 + +--NNNNNNNNNN-eximdsn-MMMMMMMMMM +Content-type: text/rfc822-headers + +Return-path: +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from ) + id 10HmaY-0005vi-00 + for delay_r@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Subject: test 2.3 - Specified, missing delay message file +Message-Id: +From: CALLER_NAME +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 000000000..88ae44a1b --- /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 000000000..a7c966de5 --- /dev/null +++ b/test/scripts/0000-Basic/0622 @@ -0,0 +1,32 @@ +# bounce_message_file and warn_message_file +# +exim -odf a@test.ex +Subject: test 1.1 - Default deny message +**** +exim -odf -DOPT=DIR/aux-fixed/TESTNUM.bounce.tmpl b@test.ex +Subject: test 1.2 - Specified deny message file +**** +exim -odf -DOPT=DIR/aux-fixed/TESTNUM.nonexist.tmpl c@test.ex +Subject: test 1.3 - Specified, missing deny message file +**** +# +exim -odf delay_p@test.ex +Subject: test 2.1 - Default delay message +**** +exim -odf -DOPT=DIR/aux-fixed/TESTNUM.bounce.tmpl delay_q@test.ex +Subject: test 2.2 - Specified delay message file +**** +exim -odf -DOPT=DIR/aux-fixed/TESTNUM.nonexist.tmpl delay_r@test.ex +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 000000000..88ae44a1b --- /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 -- 2.30.2