[exim-cvs] exim-filter dynamic module

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Asunto: [exim-cvs] exim-filter dynamic module
Gitweb: https://git.exim.org/exim.git/commitdiff/aff5e0c480dd4ac2ccd15906c250c18c93ac7f12
Commit:     aff5e0c480dd4ac2ccd15906c250c18c93ac7f12
Parent:     4f05f0f1dbdcfa60930e7a8182ae7756cede4314
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Sep 13 00:22:28 2024 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Sep 13 00:22:28 2024 +0100

    exim-filter dynamic module
---
 doc/doc-txt/NewStuff                               |   9 +-
 src/OS/Makefile-Base                               |   3 +-
 src/scripts/Configure-Makefile                     |   2 +-
 src/scripts/MakeLinks                              |   3 +-
 src/src/EDITME                                     |  11 +
 src/src/config.h.defaults                          |   2 +
 src/src/drtables.c                                 |   6 +
 src/src/exim.c                                     |   3 +
 src/src/exim.h                                     |   5 +-
 src/src/filtertest.c                               |  47 ++-
 src/src/functions.h                                |   4 -
 src/src/miscmods/Makefile                          |   1 +
 src/src/{filter.c => miscmods/exim_filter.c}       | 285 +++++++------
 src/src/miscmods/exim_filter_api.h                 |  15 +
 src/src/miscmods/sieve_filter.c                    |  14 +-
 src/src/rda.c                                      |  12 +-
 test/README                                        |   2 +-
 test/aux-fixed/{0037.f-1 => 4110.f-1}              |   0
 test/aux-fixed/{0037.f-2 => 4110.f-2}              |   0
 test/aux-fixed/{0037.f-3 => 4110.f-3}              |   0
 test/aux-fixed/{0037.f-4 => 4110.f-4}              |   0
 test/aux-fixed/{0037.f-5 => 4110.f-5}              |   0
 test/aux-fixed/{0037.f-6 => 4110.f-6}              |   0
 test/aux-fixed/{0037.f-7 => 4110.f-7}              |   0
 test/aux-fixed/{0037.f-8 => 4110.f-8}              |   0
 test/aux-fixed/{0037.f-9 => 4110.f-9}              |   0
 test/aux-fixed/{0037.msg => 4110.msg}              |   0
 .../{0015.filter.userx => 4111.filter.userx}       |   0
 test/aux-fixed/4111.realnames                      |   1 +
 .../{0016.filter.userx => 4112.filter.userx}       |   0
 .../{0046.filter.userx => 4113.filter.userx}       |   0
 test/aux-fixed/{0079.aliases => 4116.aliases}      |   0
 test/aux-fixed/{0093.f-3 => 4117.f-3}              |   0
 test/aux-fixed/{0093.lsearch => 4117.lsearch}      |   0
 test/aux-fixed/{0098.aliases => 4118.aliases}      |   0
 test/aux-fixed/{0098.forward => 4118.forward}      |   0
 test/aux-fixed/{0098.wmf => 4118.wmf}              |   0
 test/aux-fixed/{0122.filter => 4120.filter}        |   0
 test/aux-fixed/{0131.userx => 4121.userx}          |   0
 test/aux-fixed/{0136.filter => 4122.filter}        |   0
 test/aux-fixed/{0168.filter => 4125.filter}        |   0
 test/aux-fixed/{0170.filter => 4126.filter}        |   0
 test/aux-fixed/{0177.alias => 4128.alias}          |   0
 test/aux-fixed/{0182.filter => 4129.filter}        |   0
 test/aux-fixed/{0184.lsearch => 4130.lsearch}      |   0
 test/aux-fixed/{0185.alias => 4131.alias}          |   0
 test/aux-fixed/{0233.filter => 4133.filter}        |   0
 test/aux-fixed/{0241.filter => 4134.filter}        |   0
 test/aux-fixed/{0246.data => 4135.data}            |   0
 test/aux-fixed/{0246.file => 4135.file}            |   0
 test/aux-fixed/{0248.filter => 4136.filter}        |   0
 test/aux-fixed/{0266.filter => 4137.filter}        |   0
 test/aux-fixed/{0266.filter2 => 4137.filter2}      |   0
 test/aux-fixed/{0266.filter3 => 4137.filter3}      |   0
 test/aux-fixed/4137.list                           |   5 +
 test/aux-fixed/4137.list2                          |   2 +
 test/aux-fixed/4137.nmlist                         |   2 +
 test/aux-fixed/{0266.filter => 4138.filter}        |   0
 test/aux-fixed/{0266.filter2 => 4138.filter2}      |   0
 test/aux-fixed/4138.filter3                        |   6 +
 test/aux-fixed/4138.list                           |   5 +
 test/aux-fixed/4138.list2                          |   2 +
 test/aux-fixed/4138.nmlist                         |   2 +
 test/aux-fixed/{0296.Filter => 4139.Filter}        |   0
 test/aux-fixed/{0297.Filter => 4140.Filter}        |   0
 test/aux-fixed/{0298.Filter => 4141.Filter}        |   0
 test/aux-fixed/{0316.f-user => 4142.f-user}        |   0
 test/aux-fixed/{0328.F => 4145.F}                  |   0
 test/aux-fixed/{0329.F => 4146.F}                  |   0
 test/aux-fixed/{0351.F => 4149.F}                  |   0
 test/aux-fixed/{0352.F => 4150.F}                  |   0
 test/aux-fixed/{0382.F => 4153.F}                  |   0
 test/aux-fixed/{0406.f => 4156.f}                  |   0
 test/aux-fixed/{0412.F => 4158.F}                  |   0
 test/aux-fixed/{0421.F => 4159.F}                  |   0
 test/aux-fixed/{0444.sysfilter => 4160.sysfilter}  |   0
 test/aux-fixed/{0452.filter-1 => 4161.filter-1}    |   0
 test/aux-fixed/{0452.filter-2 => 4161.filter-2}    |   0
 test/aux-fixed/{0454.filter => 4162.filter}        |   0
 test/aux-fixed/{0472.F => 4163.F}                  |   0
 .../{0506.exim-filter => 4164.exim-filter}         |   0
 test/aux-fixed/{0510.sfilter => 4165.sfilter}      |   0
 test/aux-fixed/{0510.ufilter => 4165.ufilter}      |   0
 test/aux-fixed/{0616.filter => 4166.filter}        |   0
 test/aux-fixed/{0617.filter => 4167.filter}        |   0
 test/aux-fixed/{4160.message => 4190.message}      |   0
 test/aux-fixed/{4160.message2 => 4190.message2}    |   0
 test/aux-fixed/{4160.message3 => 4190.message3}    |   0
 .../{4162.sieve-filter => 4192.sieve-filter}       |   0
 test/aux-fixed/{4163.sieve => 4193.sieve}          |   0
 test/aux-fixed/{5201.filter => 5210.filter}        |   0
 test/aux-fixed/{5202.filter => 5211.filter}        |   0
 test/aux-fixed/5703.filter                         |   3 -
 test/aux-fixed/{5702.filter => 5705.filter}        |   0
 test/aux-fixed/5706.filter                         |   2 +-
 test/aux-fixed/{5704.filter => 5707.filter}        |   0
 test/aux-fixed/{5706.filter => 5708.filter}        |   0
 test/aux-var-src/0246.filter                       |   3 -
 test/aux-var-src/{0037.F => 4110.F}                |   0
 test/aux-var-src/{0037.f-7 => 4110.f-7}            |   0
 .../{0037.f-readfile => 4110.f-readfile}           |   0
 test/aux-var-src/{0037.f-user => 4110.f-user}      |   0
 test/aux-var-src/{0074.filter => 4115.filter}      |   0
 test/aux-var-src/{0079.filter => 4116.filter}      |   0
 test/aux-var-src/{0093.f-1 => 4117.f-1}            |   4 +-
 test/aux-var-src/{0093.f-2 => 4117.f-2}            |   0
 test/aux-var-src/{0114.filter => 4119.filter}      |   0
 test/aux-var-src/{0164.F => 4123.F}                |   0
 test/aux-var-src/{0165.F => 4124.F}                |   0
 test/aux-var-src/{0173.filter => 4127.filter}      |   0
 test/aux-var-src/{0177.filter => 4128.filter}      |   0
 test/aux-var-src/{0184.filter => 4130.filter}      |   4 +-
 test/aux-var-src/{0185.filter => 4131.filter}      |   0
 test/aux-var-src/4135.filter                       |   3 +
 test/aux-var-src/{0319.filter => 4143.filter}      |   0
 test/aux-var-src/{0326.filter => 4144.filter}      |   0
 test/aux-var-src/{0372.F => 4151.F}                |   0
 test/aux-var-src/{0383.F => 4154.F}                |   0
 test/aux-var-src/{0383.F2 => 4154.F2}              |   0
 test/aux-var-src/{0472.f => 4163.f}                |   0
 test/confs/0015                                    |   6 +-
 test/confs/0266                                    |  12 -
 test/confs/0270                                    |  12 -
 test/confs/0346                                    |   4 +-
 test/confs/0444                                    |  40 --
 test/confs/0452                                    |  43 --
 test/confs/0454                                    |  49 ---
 test/confs/0472                                    |  41 --
 test/confs/{0037 => 4110}                          |   2 +-
 test/confs/{0015 => 4111}                          |   8 +-
 test/confs/{0016 => 4112}                          |   4 +-
 test/confs/4113                                    |  45 ++
 test/confs/{0074 => 4114}                          |  35 +-
 test/confs/{0074 => 4115}                          |   2 +-
 test/confs/{0079 => 4116}                          |   2 +-
 test/confs/{0093 => 4117}                          |   2 +-
 test/confs/{0098 => 4118}                          |   2 +-
 test/confs/{0114 => 4119}                          |   2 +-
 test/confs/{0122 => 4120}                          |   2 +-
 test/confs/{0131 => 4121}                          |   2 +-
 test/confs/{0136 => 4122}                          |   2 +-
 test/confs/{0164 => 4123}                          |   2 +-
 test/confs/{0165 => 4124}                          |   4 +-
 test/confs/{0168 => 4125}                          |   2 +-
 test/confs/{0248 => 4126}                          |   2 +-
 test/confs/{0173 => 4127}                          |   2 +-
 test/confs/{0177 => 4128}                          |   2 +-
 test/confs/{0182 => 4129}                          |   2 +-
 test/confs/{0184 => 4130}                          |   2 +-
 test/confs/{0185 => 4131}                          |   2 +-
 test/confs/{0232 => 4132}                          |   2 +-
 test/confs/{0233 => 4133}                          |   2 +-
 test/confs/{0241 => 4134}                          |   2 +-
 test/confs/{0246 => 4135}                          |   2 +-
 test/confs/{0170 => 4136}                          |   2 +-
 test/confs/{0266 => 4137}                          |   2 +-
 test/confs/{0270 => 4138}                          |   2 +-
 test/confs/{0296 => 4139}                          |   2 +-
 test/confs/{0297 => 4140}                          |   2 +-
 test/confs/{0298 => 4141}                          |   2 +-
 test/confs/{0316 => 4142}                          |   2 +-
 test/confs/{0319 => 4143}                          |   2 +-
 test/confs/{0326 => 4144}                          |   2 +-
 test/confs/{0328 => 4145}                          |   2 +-
 test/confs/{0329 => 4146}                          |   2 +-
 test/confs/{0346 => 4147}                          |   2 +-
 test/confs/{0349 => 4148}                          |   2 +-
 test/confs/{0351 => 4149}                          |   2 +-
 test/confs/{0352 => 4150}                          |   2 +-
 test/confs/{0372 => 4151}                          |   2 +-
 test/confs/{0378 => 4152}                          |   2 +-
 test/confs/{0382 => 4153}                          |   2 +-
 test/confs/{0383 => 4154}                          |   2 +-
 test/confs/{0404 => 4155}                          |   2 +-
 test/confs/{0406 => 4156}                          |   2 +-
 test/confs/{0411 => 4157}                          |   2 +-
 test/confs/{0412 => 4158}                          |   2 +-
 test/confs/{0421 => 4159}                          |   2 +-
 test/confs/4160                                    |  21 +-
 test/confs/4161                                    | 162 +-------
 test/confs/4162                                    |  39 +-
 test/confs/4163                                    |  53 +--
 test/confs/{0506 => 4164}                          |   2 +-
 test/confs/{0510 => 4165}                          |   2 +-
 test/confs/{0616 => 4166}                          |   2 +-
 test/confs/{0617 => 4167}                          |   2 +-
 test/confs/{4160 => 4190}                          |   0
 test/confs/{4161 => 4191}                          |   0
 test/confs/{4162 => 4192}                          |   0
 test/confs/{4163 => 4193}                          |   0
 test/confs/5004                                    |   3 +-
 test/confs/{5201 => 5210}                          |   2 +-
 test/confs/{5202 => 5211}                          |   2 +-
 test/confs/5701                                    |  20 +-
 test/confs/5702                                    |  34 +-
 test/confs/5703                                    |  44 +-
 test/confs/5704                                    |  20 +-
 test/confs/5705                                    |  26 +-
 test/confs/5706                                    |  24 +-
 test/confs/5707                                    |  30 +-
 test/confs/5708                                    |  40 +-
 test/log/0015                                      |  37 +-
 test/log/0072                                      |   5 -
 test/log/0266                                      |  31 +-
 test/log/0270                                      |  31 +-
 test/log/0452                                      |  14 -
 test/log/0454                                      |   6 -
 test/log/0472                                      |   6 -
 test/log/{0037 => 4110}                            |   0
 test/log/{0015 => 4111}                            |   0
 test/log/{0016 => 4112}                            |   0
 test/log/4114                                      |   5 +
 test/log/{0074 => 4115}                            |   0
 test/log/{0079 => 4116}                            |   0
 test/log/{0098 => 4118}                            |   0
 test/log/{0114 => 4119}                            |   0
 test/log/{0122 => 4120}                            |   0
 test/log/{0131 => 4121}                            |   0
 test/log/{0136 => 4122}                            |   0
 test/log/{0164 => 4123}                            |   0
 test/log/{0165 => 4124}                            |   0
 test/log/{0168 => 4125}                            |   0
 test/log/{0170 => 4126}                            |   0
 test/log/{0173 => 4127}                            |   0
 test/log/{0177 => 4128}                            |   0
 test/log/{0182 => 4129}                            |   0
 test/log/{0184 => 4130}                            |   0
 test/log/{0185 => 4131}                            |   0
 test/log/{0233 => 4133}                            |   0
 test/log/{0241 => 4134}                            |   0
 test/log/{0246 => 4135}                            |   0
 test/log/{0248 => 4136}                            |   0
 test/log/{0266 => 4137}                            |   0
 test/log/{0270 => 4138}                            |   0
 test/log/{0296 => 4139}                            |   0
 test/log/{0297 => 4140}                            |   0
 test/log/{0298 => 4141}                            |   0
 test/log/{0319 => 4143}                            |   0
 test/log/{0326 => 4144}                            |   0
 test/log/{0328 => 4145}                            |   0
 test/log/{0329 => 4146}                            |   0
 test/log/{0382 => 4147}                            |   7 +-
 test/log/{0349 => 4148}                            |   0
 test/log/{0351 => 4149}                            |   0
 test/log/{0352 => 4150}                            |   0
 test/log/{0372 => 4151}                            |   0
 test/log/{0378 => 4152}                            |   0
 test/log/{0382 => 4153}                            |   0
 test/log/{0383 => 4154}                            |   0
 test/log/{0404 => 4155}                            |   0
 test/log/{0411 => 4157}                            |   0
 test/log/{0412 => 4158}                            |   0
 test/log/{0421 => 4159}                            |   0
 test/log/{0444 => 4160}                            |   0
 test/log/4161                                      |  62 +--
 test/log/4162                                      |  16 +-
 test/log/4163                                      |  23 +-
 test/log/{0506 => 4164}                            |   0
 test/log/{0616 => 4166}                            |   0
 test/log/{0617 => 4167}                            |   0
 test/log/{4161 => 4191}                            |   0
 test/log/{4162 => 4192}                            |   0
 test/log/{4163 => 4193}                            |   0
 test/log/{5201 => 5210}                            |   0
 test/log/{5202 => 5211}                            |   0
 test/log/5701                                      |  25 +-
 test/log/5702                                      |  25 +-
 test/log/5703                                      |  49 +--
 test/log/5704                                      |  25 +-
 test/log/5705                                      |  27 +-
 test/log/5706                                      |  33 +-
 test/log/5707                                      |  14 +-
 test/log/5708                                      |  24 +-
 test/mail/0015.userx                               | 120 +-----
 test/mail/0266.CALLER                              |  10 +-
 test/mail/0266.postmaster                          |  72 ----
 test/mail/0270.CALLER                              |  10 +-
 test/mail/0270.postmaster                          |  72 ----
 test/mail/0452.CALLER                              |  74 ----
 .../{0037..vacation.log => 4110..vacation.log}     |   0
 test/mail/{0037.CALLER => 4110.CALLER}             |   0
 test/mail/{0037.dff => 4110.dff}                   |   0
 test/mail/{0037.postmaster => 4110.postmaster}     |   0
 test/mail/{0037.userx => 4110.userx}               |   0
 test/mail/{0037.userz => 4110.userz}               |   0
 test/mail/{0015.CALLER => 4111.CALLER}             |   0
 test/mail/{0015.userx => 4111.userx}               |   0
 test/mail/{0016.userx => 4112.userx}               |   0
 test/mail/{0074.CALLER => 4115.CALLER}             |   0
 test/mail/{0074.userx => 4115.userx}               |   0
 test/mail/{0079.rbl => 4116.rbl}                   |   0
 test/mail/{0079.userx => 4116.userx}               |   0
 test/mail/{0098.CALLER => 4118.CALLER}             |   0
 test/mail/{0114.file => 4119.file}                 |   0
 test/mail/{0114.pipe => 4119.pipe}                 |   0
 test/mail/{0131.copy => 4121.copy}                 |   0
 test/mail/{0131.userx => 4121.userx}               |   0
 test/mail/{0136.forwarder => 4122.forwarder}       |   0
 test/mail/{0164.CALLER => 4123.CALLER}             |   0
 test/mail/{0165.CALLER => 4124.CALLER}             |   0
 test/mail/{0173.userx => 4127.userx}               |   0
 test/mail/{0173.usery => 4127.usery}               |   0
 test/mail/{0173.userz => 4127.userz}               |   0
 test/mail/{0177.CALLER => 4128.CALLER}             |   0
 test/mail/{0177.userx => 4128.userx}               |   0
 test/mail/{0177.usery => 4128.usery}               |   0
 test/mail/{0182.userx => 4129.userx}               |   0
 test/mail/{0233.me => 4133.me}                     |   0
 test/mail/{0233.postmaster => 4133.postmaster}     |   0
 test/mail/{0241.userx => 4134.userx}               |   0
 test/mail/{0246.CALLER => 4135.CALLER}             |   0
 test/mail/{0266.CALLER => 4137.CALLER}             |   0
 test/mail/{0266.filter => 4137.filter}             |   0
 test/mail/{0266.filter2 => 4137.filter2}           |   0
 test/mail/{0266.filter3 => 4137.filter3}           |   0
 test/mail/{0266.filter => 4137.list2}              |   9 +-
 test/mail/{0266.postmaster => 4137.postmaster}     |   0
 test/mail/{0452.userx => 4137.spqr}                |   6 +-
 test/mail/{0328.userx => 4137.userx}               |   5 +-
 test/mail/{0266.CALLER => 4138.CALLER}             |   0
 test/mail/{0270.filter => 4138.filter}             |   0
 test/mail/{0270.filter2 => 4138.filter2}           |   0
 test/mail/{0270.filter3 => 4138.filter3}           |   0
 test/mail/{0266.filter => 4138.list2}              |   9 +-
 test/mail/{0270.postmaster => 4138.postmaster}     |   0
 test/mail/{0328.userx => 4138.spqr}                |   5 +-
 test/mail/{0328.userx => 4138.userx}               |   5 +-
 test/mail/{0296.CALLER => 4139.CALLER}             |   0
 test/mail/{0298.CALLER => 4141.CALLER}             |   0
 test/mail/{0319.saved => 4143.saved}               |   0
 test/mail/{0326.userx => 4144.userx}               |   0
 test/mail/{0328.userx => 4145.userx}               |   0
 test/mail/{0329.userx => 4146.userx}               |   0
 test/mail/{0241.userx => 4147.x}                   |   5 +-
 test/mail/{0349.xxxx => 4148.xxxx}                 |   0
 test/mail/{0351.userx => 4149.userx}               |   0
 test/mail/{0352.userx => 4150.userx}               |   0
 test/mail/{0378.file => 4152.file}                 |   0
 test/mail/{0383.CALLER => 4154.CALLER}             |   0
 test/mail/{0404.sender => 4155.sender}             |   0
 test/mail/{0411.afolder => 4157.afolder}           |   0
 test/mail/{0412.CALLER => 4158.CALLER}             |   0
 test/mail/{0421.a => 4159.a}                       |   0
 test/mail/{0444.CALLER => 4160.CALLER}             |   0
 test/mail/{0444.userx => 4160.userx}               |   0
 test/mail/4161.CALLER                              |  94 ++---
 test/mail/4161.userx                               |  26 +-
 test/mail/{0472.userz99 => 4163.userz99}           |   0
 test/mail/{4161.CALLER => 4191.CALLER}             |   0
 test/mail/{4161.inbox.JUNK => 4191.inbox.JUNK}     |   0
 .../{4161.inbox.changed => 4191.inbox.changed}     |   0
 test/mail/{4161.redirected => 4191.redirected}     |   0
 test/mail/{4161.someone => 4191.someone}           |   0
 test/mail/{4161.userx => 4191.userx}               |   0
 test/mail/{4161.userx-extra => 4191.userx-extra}   |   0
 .../{4161.userx-sawsuffix => 4191.userx-sawsuffix} |   0
 test/mail/{4161.userx13 => 4191.userx13}           |   0
 test/mail/{4161.userx14 => 4191.userx14}           |   0
 test/mail/{4161.userx9 => 4191.userx9}             |   0
 test/mail/{4163.CALLER => 4193.CALLER}             |   0
 test/mail/{4163.myfolder => 4193.myfolder}         |   0
 test/maint/cp_testcase                             |  45 ++
 test/maint/mv_testcase                             |  39 ++
 ...0000005vi-0000 => 4120.10HmaX-000000005vi-0000} |   0
 ...0000005vi-0000 => 4120.10HmaY-000000005vi-0000} |   0
 ...0000005vi-0000 => 4120.10HmaZ-000000005vi-0000} |   0
 test/msglog/4133.10HmaX-000000005vi-0000           |   4 +
 test/msglog/4133.10HmbA-000000005vi-0000           |   2 +
 test/msglog/4133.10HmbB-000000005vi-0000           |   2 +
 test/msglog/4133.10HmbD-000000005vi-0000           |   2 +
 test/paniclog/{0170 => 4126}                       |   0
 test/paniclog/{0241 => 4134}                       |   0
 test/paniclog/{0372 => 4151}                       |   0
 test/rejectlog/{0079 => 4116}                      |   0
 test/rejectlog/{0098 => 4118}                      |   0
 test/rejectlog/{5708 => 5703}                      |   0
 test/runtest                                       |   9 +-
 test/scripts/0000-Basic/0015                       |  11 -
 test/scripts/0000-Basic/0046                       | Bin 4104 -> 1185 bytes
 test/scripts/0000-Basic/0072                       |   8 -
 test/scripts/0000-Basic/0266                       |   8 -
 test/scripts/0000-Basic/0270                       |   8 -
 test/scripts/3400-plaintext/REQUIRES               |   1 +
 test/scripts/3500-CRAM-MD5/REQUIRES                |   1 +
 test/scripts/4100-iconv/REQUIRES                   |   1 +
 .../{0000-Basic/0037 => 4110-exim-filter/4110}     |   0
 .../{0000-Basic/0015 => 4110-exim-filter/4111}     |   0
 .../{0000-Basic/0016 => 4110-exim-filter/4112}     |   0
 .../{0000-Basic/0046 => 4110-exim-filter/4113}     | Bin 4104 -> 2963 bytes
 test/scripts/4110-exim-filter/4114                 |   9 +
 .../{0000-Basic/0074 => 4110-exim-filter/4115}     |   0
 .../{0000-Basic/0079 => 4110-exim-filter/4116}     |   0
 .../{0000-Basic/0093 => 4110-exim-filter/4117}     |   0
 .../{0000-Basic/0098 => 4110-exim-filter/4118}     |   0
 .../{0000-Basic/0114 => 4110-exim-filter/4119}     |   0
 .../{0000-Basic/0122 => 4110-exim-filter/4120}     |   0
 .../{0000-Basic/0131 => 4110-exim-filter/4121}     |   0
 .../{0000-Basic/0136 => 4110-exim-filter/4122}     |   0
 .../{0000-Basic/0164 => 4110-exim-filter/4123}     |   0
 .../{0000-Basic/0165 => 4110-exim-filter/4124}     |   0
 .../{0000-Basic/0168 => 4110-exim-filter/4125}     |   0
 .../{0000-Basic/0170 => 4110-exim-filter/4126}     |   0
 .../{0000-Basic/0173 => 4110-exim-filter/4127}     |   0
 .../{0000-Basic/0177 => 4110-exim-filter/4128}     |   0
 .../{0000-Basic/0182 => 4110-exim-filter/4129}     |   0
 .../{0000-Basic/0184 => 4110-exim-filter/4130}     |   0
 .../{0000-Basic/0185 => 4110-exim-filter/4131}     |   0
 .../{0000-Basic/0232 => 4110-exim-filter/4132}     |   0
 .../{0000-Basic/0233 => 4110-exim-filter/4133}     |   0
 .../{0000-Basic/0241 => 4110-exim-filter/4134}     |   0
 .../{0000-Basic/0246 => 4110-exim-filter/4135}     |   0
 .../{0000-Basic/0248 => 4110-exim-filter/4136}     |   0
 .../{0000-Basic/0266 => 4110-exim-filter/4137}     |   0
 .../{0000-Basic/0270 => 4110-exim-filter/4138}     |   0
 .../{0000-Basic/0296 => 4110-exim-filter/4139}     |   0
 .../{0000-Basic/0297 => 4110-exim-filter/4140}     |   0
 .../{0000-Basic/0298 => 4110-exim-filter/4141}     |   0
 .../{0000-Basic/0316 => 4110-exim-filter/4142}     |   0
 .../{0000-Basic/0319 => 4110-exim-filter/4143}     |   0
 .../{0000-Basic/0326 => 4110-exim-filter/4144}     |   0
 .../{0000-Basic/0328 => 4110-exim-filter/4145}     |   0
 .../{0000-Basic/0329 => 4110-exim-filter/4146}     |   0
 test/scripts/4110-exim-filter/4147                 |   4 +
 .../{0000-Basic/0349 => 4110-exim-filter/4148}     |   0
 .../{0000-Basic/0351 => 4110-exim-filter/4149}     |   0
 .../{0000-Basic/0352 => 4110-exim-filter/4150}     |   0
 .../{0000-Basic/0372 => 4110-exim-filter/4151}     |   0
 .../{0000-Basic/0378 => 4110-exim-filter/4152}     |   0
 .../{0000-Basic/0382 => 4110-exim-filter/4153}     |   0
 .../{0000-Basic/0383 => 4110-exim-filter/4154}     |   0
 .../{0000-Basic/0404 => 4110-exim-filter/4155}     |   0
 .../{0000-Basic/0406 => 4110-exim-filter/4156}     |   0
 .../{0000-Basic/0411 => 4110-exim-filter/4157}     |   0
 .../{0000-Basic/0412 => 4110-exim-filter/4158}     |   0
 .../{0000-Basic/0421 => 4110-exim-filter/4159}     |   0
 .../{0000-Basic/0444 => 4110-exim-filter/4160}     |   0
 .../{0000-Basic/0452 => 4110-exim-filter/4161}     |   0
 .../{0000-Basic/0454 => 4110-exim-filter/4162}     |   0
 .../{0000-Basic/0472 => 4110-exim-filter/4163}     |   0
 .../{0000-Basic/0506 => 4110-exim-filter/4164}     |   0
 .../{0000-Basic/0510 => 4110-exim-filter/4165}     |   0
 .../{0000-Basic/0616 => 4110-exim-filter/4166}     |   0
 .../{0000-Basic/0617 => 4110-exim-filter/4167}     |   0
 test/scripts/4110-exim-filter/REQUIRES             |   1 +
 .../4160 => 4190-sieve-filter/4190}                |   0
 .../4161 => 4190-sieve-filter/4191}                |   0
 .../4162 => 4190-sieve-filter/4192}                |   0
 .../4163 => 4190-sieve-filter/4193}                |   0
 .../REQUIRES                                       |   0
 .../5201 => 5210-queryprogram-filter/5210}         |   0
 .../5202 => 5210-queryprogram-filter/5211}         |   0
 test/scripts/5210-queryprogram-filter/REQUIRES     |   2 +
 test/scripts/5700-events/5701                      |  20 +-
 test/scripts/5700-events/5702                      |  28 +-
 test/scripts/5700-events/5703                      |  72 +++-
 test/scripts/5700-events/5705                      |   5 -
 test/scripts/5700-events/5707                      |   6 -
 test/scripts/5700-events/5708                      |  62 ---
 .../{5700-events/5701 => 5704-events-filter/5704}  |   0
 .../{5700-events/5702 => 5704-events-filter/5705}  |   0
 .../{5700-events/5703 => 5704-events-filter/5706}  |   0
 .../{5700-events/5704 => 5704-events-filter/5707}  |   0
 .../{5700-events/5706 => 5704-events-filter/5708}  |   0
 test/scripts/5704-events-filter/REQUIRES           |   2 +
 test/stderr/{0037 => 4110}                         |  12 +-
 test/stderr/{0079 => 4116}                         |   0
 test/stderr/{0170 => 4126}                         |   0
 test/stderr/{0177 => 4128}                         |   0
 test/stderr/{0185 => 4131}                         |   0
 test/stderr/{0241 => 4134}                         |   0
 test/stderr/{0297 => 4140}                         |   0
 test/stderr/{0372 => 4151}                         |   0
 test/stderr/{0378 => 4152}                         |   0
 test/stderr/{0382 => 4153}                         |   0
 test/stderr/{0404 => 4155}                         |   0
 test/stderr/{0472 => 4163}                         |   0
 test/stderr/5004                                   |  22 +-
 test/stderr/5420                                   |  42 +-
 test/stderr/5820                                   |   2 +-
 test/stdout/0015                                   |  30 +-
 test/stdout/{0037 => 4110}                         |  50 +--
 test/stdout/{0015 => 4111}                         |   0
 test/stdout/{0046 => 4113}                         |  12 +-
 test/stdout/{0079 => 4116}                         |   0
 test/stdout/{0093 => 4117}                         |   6 +-
 test/stdout/{0098 => 4118}                         |   0
 test/stdout/{0136 => 4122}                         |   0
 test/stdout/4128                                   |  37 ++
 test/{scripts/0000-Basic/0184 => stdout/4130}      |  12 +-
 test/stdout/{5702 => 4131}                         |  27 +-
 test/stdout/4132                                   |   6 +
 test/stdout/4133                                   |  16 +
 test/stdout/4134                                   |   1 +
 test/stdout/4140                                   |   8 +
 test/stdout/4142                                   |  12 +
 test/stdout/4151                                   |  38 ++
 test/stdout/4152                                   |  29 ++
 test/stdout/4156                                   |  71 ++++
 test/stdout/4160                                   | 458 ---------------------
 test/stdout/4162                                   |  23 ++
 test/stdout/4163                                   |  80 ----
 test/stdout/4165                                   |  24 ++
 test/stdout/{5702 => 4166}                         |   5 +-
 test/stdout/{5702 => 4167}                         |   5 +-
 test/stdout/5703                                   |  86 +++-
 505 files changed, 1462 insertions(+), 2380 deletions(-)

diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff
index bca7d6f87..0a83c294a 100644
--- a/doc/doc-txt/NewStuff
+++ b/doc/doc-txt/NewStuff
@@ -14,11 +14,12 @@ Version 4.98
 
  3. Events smtp:fail:protocol and smtp:fail:syntax
 
- 4. Support for Sieve filters can be omitted at build time
+ 4. Support for Exim- and Sieve filters can be omitted at build time
 
- 5. JSON and LDAP lookup support, Sieve, PAM, RADIUS, perl, SPF, DKIM, DMARC and
-    ARC support, all the router and authenticator drivers, and all the transport
-    drivers except smtp, can now be built as loadable modules
+ 5. JSON and LDAP lookup support, both filter types, PAM, RADIUS, perl, SPF,
+    DKIM, DMARC and ARC support, all the router and authenticator drivers,
+    and all the transport drivers except smtp, can now be built as loadable
+    modules
 
 Version 4.98
 ------------
diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base
index 7793e5da2..c27b5eb5c 100644
--- a/src/OS/Makefile-Base
+++ b/src/OS/Makefile-Base
@@ -513,7 +513,7 @@ OBJ_AUTHS = call_pwcheck.o check_serv_cond.o \
     get_data.o get_no64_data.o pwcheck.o
 
 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
-        directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
+        directory.o dns.o drtables.o enq.o exim.o expand.o \
         filtertest.o globals.o dnsbl.o hash.o \
         header.o host.o host_address.o ip.o log.o lss.o match.o md5.o moan.o \
         os.o parse.o priv.o proxy.o queue.o \
@@ -839,7 +839,6 @@ enq.o:           $(HDRS) enq.c
 exim.o:          $(HDRS) exim.c
 expand.o:        $(HDRS) expand.c
 environment.o:   $(HDRS) environment.c
-filter.o:        $(HDRS) filter.c
 filtertest.o:    $(HDRS) filtertest.c
 globals.o:       $(HDRS) globals.c
 hash.o:          $(HDRS) hash.c
diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
index fd5afaf10..74f8dda47 100755
--- a/src/scripts/Configure-Makefile
+++ b/src/scripts/Configure-Makefile
@@ -315,7 +315,7 @@ done <<-END
  routers    ROUTER    ACCEPT DNSLOOKUP IPLITERAL IPLOOKUP MANUALROUTE QUERYPROGRAM REDIRECT
  transports TRANSPORT    APPENDFILE AUTOREPLY LMTP PIPE QUEUEFILE SMTP
  auths        AUTH    CRAM_MD5 CYRUS_SASL DOVECOT EXTERNAL GSASL HEIMDAL_GSSAPI PLAINTEXT SPA TLS
- miscmods   SUPPORT    ARC _DKIM DMARC PAM PERL RADIUS _SIEVE_FILTER SPF
+ miscmods   SUPPORT    ARC _DKIM DMARC _EXIM_FILTER PAM PERL RADIUS _SIEVE_FILTER SPF
 END
 
 # See if there is a definition of EXIM_PERL in what we have built so far.
diff --git a/src/scripts/MakeLinks b/src/scripts/MakeLinks
index 6327bc819..d07f81e98 100755
--- a/src/scripts/MakeLinks
+++ b/src/scripts/MakeLinks
@@ -102,6 +102,7 @@ for f in dummy.c \
     pdkim/crypt_ver.h pdkim/pdkim.c pdkim/pdkim.h \
     pdkim/pdkim_hash.h pdkim/signing.c pdkim/signing.h \
     dmarc.c dmarc.h dmarc_api.h \
+    exim_filter.c exim_filter_api.h \
     pam.c pam_api.h \
     perl.c perl_api.h \
     radius.c radius_api.h \
@@ -133,7 +134,7 @@ for f in blob.h dbfunctions.h exim.h functions.h globals.h \
   \
   acl.c buildconfig.c base64.c child.c crypt16.c daemon.c dbfn.c debug.c \
   deliver.c directory.c dns.c dnsbl.c drtables.c dummies.c enq.c exim.c \
-  exim_dbmbuild.c exim_dbutil.c exim_lock.c expand.c filter.c filtertest.c \
+  exim_dbmbuild.c exim_dbutil.c exim_lock.c expand.c filtertest.c \
   globals.c hash.c header.c host.c host_address.c ip.c log.c lss.c match.c md5.c moan.c \
   parse.c priv.c proxy.c queue.c rda.c readconf.c receive.c retry.c rewrite.c \
   regex_cache.c rfc2047.c route.c search.c setenv.c environment.c \
diff --git a/src/src/EDITME b/src/src/EDITME
index 85effd13f..2cf0b3da9 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -551,6 +551,17 @@ SUPPORT_DANE=yes
 # EXIM_MONITOR=eximon.bin
 
 
+#------------------------------------------------------------------------------
+# Compiling with support for Exim filters is the default. To disable this
+# uncomment the line below.
+
+# DISABLE_EXIM_FILTER=yes
+
+# Alternatively, to build the support as a dynamically-loaded module uncomment
+# this line.
+
+# SUPPORT_EXIM_FILTER=2
+
 #------------------------------------------------------------------------------
 # Compiling with support for Sieve filters is the default. To disable this
 # uncomment the line below.
diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults
index 404ac0c1c..7e8229650 100644
--- a/src/src/config.h.defaults
+++ b/src/src/config.h.defaults
@@ -53,6 +53,7 @@ Do not put spaces between # and the 'define'.
 #define DISABLE_DKIM
 #define DISABLE_ESMTP_LIMITS
 #define DISABLE_EVENT
+#define DISABLE_EXIM_FILTER
 #define DISABLE_OCSP
 #define DISABLE_PIPE_CONNECT
 #define DISABLE_PRDR
@@ -171,6 +172,7 @@ Do not put spaces between # and the 'define'.
 /* Required to support dynamic-module build */
 #define SUPPORT_ARC
 #define SUPPORT_DKIM
+#define SUPPORT_EXIM_FILTER
 #define SUPPORT_PERL
 #define SUPPORT_SIEVE_FILTER
 #define SUPPORT_RADIUS
diff --git a/src/src/drtables.c b/src/src/drtables.c
index 49d3ae129..28846320c 100644
--- a/src/src/drtables.c
+++ b/src/src/drtables.c
@@ -762,6 +762,9 @@ extern misc_module_info pam_module_info;
 #if defined(EXIM_PERL) && (!defined(SUPPORT_PERL) || SUPPORT_PERL!=2)
 extern misc_module_info perl_module_info;
 #endif
+#if !defined(DISABLE_EXIM_FILTER) && (!defined(SUPPORT_EXIM_FILTER) || SUPPORT_EXIM_FILTER!=2)
+extern misc_module_info exim_filter_module_info;
+#endif
 #if !defined(DISABLE_SIEVE_FILTER) && (!defined(SUPPORT_SIEVE_FILTER) || SUPPORT_SIEVE_FILTER!=2)
 extern misc_module_info sieve_filter_module_info;
 #endif
@@ -795,6 +798,9 @@ onetime = TRUE;
 #if defined(EXIM_PERL) && (!defined(SUPPORT_PERL) || SUPPORT_PERL!=2)
   misc_mod_add(&perl_module_info);
 #endif
+#if !defined(DISABLE_EXIM_FILTER) && (!defined(SUPPORT_EXIM_FILTER) || SUPPORT_EXIM_FILTER!=2)
+  misc_mod_add(&exim_filter_module_info);
+#endif
 #if !defined(DISABLE_SIEVE_FILTER) && (!defined(SUPPORT_SIEVE_FILTER) || SUPPORT_SIEVE_FILTER!=2)
   misc_mod_add(&sieve_filter_module_info);
 #endif
diff --git a/src/src/exim.c b/src/src/exim.c
index 274187cfc..0eb221d43 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1221,6 +1221,9 @@ g = string_cat(g, US"Support for:");
 #ifdef WITH_CONTENT_SCAN
   g = string_cat(g, US" Content_Scanning");
 #endif
+#ifndef DISABLE_EXIM_FILTER
+  g = string_cat(g, US" Exim_filter");
+#endif
 #ifndef DISABLE_SIEVE_FILTER
   g = string_cat(g, US" Sieve_filter");
 #endif
diff --git a/src/src/exim.h b/src/src/exim.h
index bae5ec390..4af0f0e08 100644
--- a/src/src/exim.h
+++ b/src/src/exim.h
@@ -567,9 +567,8 @@ config.h, mytypes.h, and store.h, so we don't need to mention them explicitly.
 #ifdef EXIM_PERL
 # include "miscmods/perl_api.h"
 #endif
-#ifndef DISABLE_SIEVE
-# include "miscmods/sieve_filter_api.h"
-#endif
+#include "miscmods/exim_filter_api.h"
+#include "miscmods/sieve_filter_api.h"
 
 /* The following stuff must follow the inclusion of config.h because it
 requires various things that are set therein. */
diff --git a/src/src/filtertest.c b/src/src/filtertest.c
index eb5f5e54b..35d939ee0 100644
--- a/src/src/filtertest.c
+++ b/src/src/filtertest.c
@@ -101,7 +101,6 @@ if (!dot_ended && !stdin_feof())
     }
   if (s == message_body_end || s[-1] != '\n') body_linecount++;
   }
-debug_printf("%s %d\n", __FUNCTION__, __LINE__);
 
 message_body[body_len] = 0;
 message_body_size = message_size - header_size;
@@ -144,6 +143,30 @@ while (body_end_len > 0)
 
 
 
+static int
+exim_filter_interpret(const uschar * filebuf, int options,
+  address_item ** addrp, uschar ** error)
+{
+#ifdef DISABLE_EXIM_FILTER
+  printf("exim: Exim-filtering not available\n");
+  return FF_ERROR;
+#else
+
+const misc_module_info * mi;
+uschar * errstr = NULL;
+typedef int (*fn_t)(const uschar *, int, address_item **, uschar **);
+if (!(mi = misc_mod_find(US"exim_filter", &errstr)))
+  {
+  printf("exim: Exim-filtering not available: %s\n", errstr ? errstr : US"?");
+  return FF_ERROR;
+  }
+return(((fn_t *) mi->functions)[EXIM_INTERPRET])
+                  (filebuf, options, addrp, error);
+#endif
+}
+
+
+
 /*************************************************
 *            Test a mail filter                  *
 *************************************************/
@@ -202,8 +225,8 @@ filter_type = rda_is_filter(filebuf);
 if (is_system && filter_type == FILTER_FORWARD) filter_type = FILTER_EXIM;
 
 printf("Testing %s file \"%s\"\n\n",
-  (filter_type == FILTER_EXIM)? "Exim filter" :
-  (filter_type == FILTER_SIEVE)? "Sieve filter" :
+  filter_type == FILTER_EXIM ? "Exim filter" :
+  filter_type == FILTER_SIEVE ? "Sieve filter" :
   "forward file",
   filename);
 
@@ -234,13 +257,13 @@ if (filter_type == FILTER_FORWARD)
     return FALSE;
     }
 
-  if (generated == NULL)
+  if (!generated)
     printf("exim: no addresses generated from forward file\n");
 
   else
     {
     printf("exim: forward file generated:\n");
-    while (generated != NULL)
+    while (generated)
       {
       printf("  %s\n", generated->address);
       generated = generated->next;
@@ -264,9 +287,8 @@ if (is_system)
   {
   f.system_filtering = TRUE;
   f.enable_dollar_recipients = TRUE; /* Permit $recipients in system filter */
-  yield = filter_interpret
-    (filebuf,
-    RDO_DEFER|RDO_FAIL|RDO_FILTER|RDO_FREEZE|RDO_REWRITE, &generated, &error);
+  yield = exim_filter_interpret(filebuf,
+      RDO_DEFER|RDO_FAIL|RDO_FILTER|RDO_FREEZE|RDO_REWRITE, &generated, &error);
   f.enable_dollar_recipients = FALSE;
   f.system_filtering = FALSE;
   }
@@ -279,13 +301,14 @@ else if (filter_type == FILTER_SIEVE)
   if (!(mi = misc_mod_find(US"sieve_filter", &errstr)))
     {
     printf("exim: Sieve filtering not available: %s\n", errstr ? errstr : US"?");
-    return FALSE;
+    yield = FF_ERROR;
     }
-  yield = (((fn_t *) mi->functions)[SIEVE_INTERPRET])
-                    (filebuf, RDO_REWRITE, NULL, &generated, &error);
+  else
+    yield = (((fn_t *) mi->functions)[SIEVE_INTERPRET])
+                  (filebuf, RDO_REWRITE, NULL, &generated, &error);
   }
 else
-  yield = filter_interpret(filebuf, RDO_REWRITE, &generated, &error);
+  yield = exim_filter_interpret(filebuf, RDO_REWRITE, &generated, &error);
 
 return yield != FF_ERROR;
 }
diff --git a/src/src/functions.h b/src/src/functions.h
index 60b07d2d7..875ce25a6 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -240,11 +240,7 @@ extern int_eximarith_t expand_string_integer(uschar *, BOOL);
 extern void    modify_variable(uschar *, void *);
 
 extern BOOL    fd_ready(int, time_t);
-
-extern int     filter_interpret(const uschar *, int, address_item **, uschar **);
-extern BOOL    filter_personal(string_item *, BOOL);
 extern BOOL    filter_runtest(int, const uschar *, BOOL, BOOL);
-extern BOOL    filter_system_interpret(address_item **, uschar **);
 
 extern uschar * fn_hdrs_added(void);
 extern void    force_fd(int, int);
diff --git a/src/src/miscmods/Makefile b/src/src/miscmods/Makefile
index 3c255dbb6..24eea2e28 100644
--- a/src/src/miscmods/Makefile
+++ b/src/src/miscmods/Makefile
@@ -37,6 +37,7 @@ dkim.o  dkim.so:        $(HDRS) dkim.h dkim.c dkim_transport.c \
                 signing.h signing.c
 dmarc.o dmarc.so:        $(HDRS) pdkim.h dmarc.h dmarc.c
 dummy.o:            dummy.c
+exim_filter.o exim_filter.so:    $(HDRS) exim_filter.c
 pam.o   pam.so:            $(HDRS) pam.c
 perl.o perl.so:             $(HDRS) perl.c
 radius.o radius.so:        $(HDRS) radius.c
diff --git a/src/src/filter.c b/src/src/miscmods/exim_filter.c
similarity index 99%
rename from src/src/filter.c
rename to src/src/miscmods/exim_filter.c
index 76749510a..a4c2f0898 100644
--- a/src/src/filter.c
+++ b/src/src/miscmods/exim_filter.c
@@ -10,7 +10,7 @@
 
 /* Code for mail filtering functions. */
 
-#include "exim.h"
+#include "../exim.h"
 
 
 /* Command arguments and left/right points in conditions can contain different
@@ -1118,7 +1118,7 @@ switch (command)
     cmd_bit = RDO_FREEZE;
 
   DEFER_FREEZE_FAIL:
-    if ((filter_options & cmd_bit) == 0)
+    if (!(filter_options & cmd_bit))
       {
       *error_pointer = string_sprintf("filtering command \"%s\" is disabled: "
     "near line %d of filter file", buffer, line_number);
@@ -1452,6 +1452,132 @@ return TRUE;
 
 
 
+/*************************************************
+*        Test for a personal message             *
+*************************************************/
+
+/* Module API: This function is also called from the code that
+implements Sieve filters.
+
+Arguments:
+  aliases    a chain of aliases
+  scan_cc    TRUE if Cc: and Bcc: are to be scanned (Exim filters do not)
+
+Returns:     TRUE if the message is deemed to be personal
+*/
+
+static BOOL
+filter_personal(string_item *aliases, BOOL scan_cc)
+{
+const uschar *self, *self_from, *self_to;
+uschar *psself = NULL;
+const uschar *psself_from = NULL, *psself_to = NULL;
+rmark reset_point = store_mark();
+BOOL yield;
+header_line *h;
+int to_count = 2;
+int from_count = 9;
+
+/* If any header line in the message is a defined "List-" header field, it is
+not a personal message. We used to check for any header line that started with
+"List-", but this was tightened up for release 4.54. The check is now for
+"List-Id", defined in RFC 2929, or "List-Help", "List-Subscribe", "List-
+Unsubscribe", "List-Post", "List-Owner" or "List-Archive", all of which are
+defined in RFC 2369. We also scan for "Auto-Submitted"; if it is found to
+contain any value other than "no", the message is not personal (RFC 3834).
+Previously the test was for "auto-". */
+
+for (h = header_list; h; h = h->next)
+  {
+  if (h->type == htype_old) continue;
+
+  if (strncmpic(h->text, US"List-", 5) == 0)
+    {
+    uschar * s = h->text + 5;
+    if (strncmpic(s, US"Id:", 3) == 0 ||
+        strncmpic(s, US"Help:", 5) == 0 ||
+        strncmpic(s, US"Subscribe:", 10) == 0 ||
+        strncmpic(s, US"Unsubscribe:", 12) == 0 ||
+        strncmpic(s, US"Post:", 5) == 0 ||
+        strncmpic(s, US"Owner:", 6) == 0 ||
+        strncmpic(s, US"Archive:", 8) == 0)
+      return FALSE;
+    }
+
+  else if (strncmpic(h->text, US"Auto-submitted:", 15) == 0)
+    {
+    uschar * s = h->text + 15;
+    Uskip_whitespace(&s);
+    if (strncmpic(s, US"no", 2) != 0) return FALSE;
+    s += 2;
+    Uskip_whitespace(&s);
+    if (*s) return FALSE;
+    }
+  }
+
+/* Set up "my" address */
+
+self = string_sprintf("%s@%s", deliver_localpart, deliver_domain);
+self_from = rewrite_one(self, rewrite_from, NULL, FALSE, US"",
+  global_rewrite_rules);
+self_to   = rewrite_one(self, rewrite_to, NULL, FALSE, US"",
+  global_rewrite_rules);
+
+
+if (!self_from) self_from = self;
+if (self_to) self_to = self;
+
+/* If there's a prefix or suffix set, we must include the prefixed/
+suffixed version of the local part in the tests. */
+
+if (deliver_localpart_prefix || deliver_localpart_suffix)
+  {
+  psself = string_sprintf("%s%s%s@%s",
+    deliver_localpart_prefix ? deliver_localpart_prefix : US"",
+    deliver_localpart,
+    deliver_localpart_suffix ? deliver_localpart_suffix : US"",
+    deliver_domain);
+  psself_from = rewrite_one(psself, rewrite_from, NULL, FALSE, US"",
+    global_rewrite_rules);
+  psself_to   = rewrite_one(psself, rewrite_to, NULL, FALSE, US"",
+    global_rewrite_rules);
+  if (psself_from == NULL) psself_from = psself;
+  if (psself_to == NULL) psself_to = psself;
+  to_count += 2;
+  from_count += 2;
+  }
+
+/* Do all the necessary tests; the counts are adjusted for {pre,suf}fix */
+
+yield =
+  (
+  header_match(US"to:", TRUE, TRUE, aliases, to_count, self, self_to, psself,
+               psself_to) ||
+    (scan_cc &&
+       (
+       header_match(US"cc:", TRUE, TRUE, aliases, to_count, self, self_to,
+                             psself, psself_to)
+       ||
+       header_match(US"bcc:", TRUE, TRUE, aliases, to_count, self, self_to,
+                              psself, psself_to)
+       )
+    )
+  ) &&
+
+  header_match(US"from:", TRUE, FALSE, aliases, from_count, "^server@",
+    "^daemon@", "^root@", "^listserv@", "^majordomo@", "^.*?-request@",
+    "^owner-[^@]+@", self, self_from, psself, psself_from) &&
+
+  header_match(US"precedence:", FALSE, FALSE, NULL, 3, "bulk","list","junk") &&
+
+  (sender_address == NULL || sender_address[0] != 0);
+
+store_reset(reset_point);
+return yield;
+}
+
+
+
 /*************************************************
 *             Test a condition                   *
 *************************************************/
@@ -1872,8 +1998,8 @@ while (commands)
 
       else
     {
-    if (s[0] != '/' && (filter_options & RDO_PREPEND_HOME) != 0 &&
-        deliver_home != NULL && deliver_home[0] != 0)
+    if (s[0] != '/' && filter_options & RDO_PREPEND_HOME &&
+        deliver_home && *deliver_home)
       s = string_sprintf("%s/%s", deliver_home, s);
     DEBUG(D_filter) debug_printf_indent("Filter: %ssave message to: %s%s\n",
       commands->seen ? "" : "unseen ",
@@ -2395,137 +2521,11 @@ return filter_delivered ? FF_DELIVERED : FF_NOTDELIVERED;
 
 
 
-/*************************************************
-*        Test for a personal message             *
-*************************************************/
-
-/* This function is global so that it can also be called from the code that
-implements Sieve filters.
-
-Arguments:
-  aliases    a chain of aliases
-  scan_cc    TRUE if Cc: and Bcc: are to be scanned (Exim filters do not)
-
-Returns:     TRUE if the message is deemed to be personal
-*/
-
-BOOL
-filter_personal(string_item *aliases, BOOL scan_cc)
-{
-const uschar *self, *self_from, *self_to;
-uschar *psself = NULL;
-const uschar *psself_from = NULL, *psself_to = NULL;
-rmark reset_point = store_mark();
-BOOL yield;
-header_line *h;
-int to_count = 2;
-int from_count = 9;
-
-/* If any header line in the message is a defined "List-" header field, it is
-not a personal message. We used to check for any header line that started with
-"List-", but this was tightened up for release 4.54. The check is now for
-"List-Id", defined in RFC 2929, or "List-Help", "List-Subscribe", "List-
-Unsubscribe", "List-Post", "List-Owner" or "List-Archive", all of which are
-defined in RFC 2369. We also scan for "Auto-Submitted"; if it is found to
-contain any value other than "no", the message is not personal (RFC 3834).
-Previously the test was for "auto-". */
-
-for (h = header_list; h; h = h->next)
-  {
-  if (h->type == htype_old) continue;
-
-  if (strncmpic(h->text, US"List-", 5) == 0)
-    {
-    uschar * s = h->text + 5;
-    if (strncmpic(s, US"Id:", 3) == 0 ||
-        strncmpic(s, US"Help:", 5) == 0 ||
-        strncmpic(s, US"Subscribe:", 10) == 0 ||
-        strncmpic(s, US"Unsubscribe:", 12) == 0 ||
-        strncmpic(s, US"Post:", 5) == 0 ||
-        strncmpic(s, US"Owner:", 6) == 0 ||
-        strncmpic(s, US"Archive:", 8) == 0)
-      return FALSE;
-    }
-
-  else if (strncmpic(h->text, US"Auto-submitted:", 15) == 0)
-    {
-    uschar * s = h->text + 15;
-    Uskip_whitespace(&s);
-    if (strncmpic(s, US"no", 2) != 0) return FALSE;
-    s += 2;
-    Uskip_whitespace(&s);
-    if (*s) return FALSE;
-    }
-  }
-
-/* Set up "my" address */
-
-self = string_sprintf("%s@%s", deliver_localpart, deliver_domain);
-self_from = rewrite_one(self, rewrite_from, NULL, FALSE, US"",
-  global_rewrite_rules);
-self_to   = rewrite_one(self, rewrite_to, NULL, FALSE, US"",
-  global_rewrite_rules);
-
-
-if (!self_from) self_from = self;
-if (self_to) self_to = self;
-
-/* If there's a prefix or suffix set, we must include the prefixed/
-suffixed version of the local part in the tests. */
-
-if (deliver_localpart_prefix || deliver_localpart_suffix)
-  {
-  psself = string_sprintf("%s%s%s@%s",
-    deliver_localpart_prefix ? deliver_localpart_prefix : US"",
-    deliver_localpart,
-    deliver_localpart_suffix ? deliver_localpart_suffix : US"",
-    deliver_domain);
-  psself_from = rewrite_one(psself, rewrite_from, NULL, FALSE, US"",
-    global_rewrite_rules);
-  psself_to   = rewrite_one(psself, rewrite_to, NULL, FALSE, US"",
-    global_rewrite_rules);
-  if (psself_from == NULL) psself_from = psself;
-  if (psself_to == NULL) psself_to = psself;
-  to_count += 2;
-  from_count += 2;
-  }
-
-/* Do all the necessary tests; the counts are adjusted for {pre,suf}fix */
-
-yield =
-  (
-  header_match(US"to:", TRUE, TRUE, aliases, to_count, self, self_to, psself,
-               psself_to) ||
-    (scan_cc &&
-       (
-       header_match(US"cc:", TRUE, TRUE, aliases, to_count, self, self_to,
-                             psself, psself_to)
-       ||
-       header_match(US"bcc:", TRUE, TRUE, aliases, to_count, self, self_to,
-                              psself, psself_to)
-       )
-    )
-  ) &&
-
-  header_match(US"from:", TRUE, FALSE, aliases, from_count, "^server@",
-    "^daemon@", "^root@", "^listserv@", "^majordomo@", "^.*?-request@",
-    "^owner-[^@]+@", self, self_from, psself, psself_from) &&
-
-  header_match(US"precedence:", FALSE, FALSE, NULL, 3, "bulk","list","junk") &&
-
-  (sender_address == NULL || sender_address[0] != 0);
-
-store_reset(reset_point);
-return yield;
-}
-
-
-
 /*************************************************
 *            Interpret a mail filter file        *
 *************************************************/
 
-/*
+/* Module API:
 Arguments:
   filter      points to the entire file, read into store as a single string
   options     controls whether various special things are allowed, and requests
@@ -2541,7 +2541,7 @@ Returns:      FF_DELIVERED     success, a significant action was taken
               FF_ERROR         there was a problem
 */
 
-int
+static int
 filter_interpret(const uschar *filter, int options, address_item **generated,
   uschar **error)
 {
@@ -2638,6 +2638,27 @@ return yield;
 }
 
 
+
+
+/******************************************************************************/
+/* Module API */
+
+static void * exim_functions[] = {
+  [EXIM_INTERPRET] =        filter_interpret,
+  [EXIM_FILTER_PERSONAL] =    filter_personal,
+};
+
+misc_module_info exim_filter_module_info =
+{
+  .name =        US"exim_filter",
+# ifdef DYNLOOKUP
+  .dyn_magic =        MISC_MODULE_MAGIC,
+# endif
+
+  .functions =        exim_functions,
+  .functions_count =    nelem(exim_functions),
+};
+
 /* End of filter.c */
 /* vi: aw ai sw=2
 */
diff --git a/src/src/miscmods/exim_filter_api.h b/src/src/miscmods/exim_filter_api.h
new file mode 100644
index 000000000..a65a7dd06
--- /dev/null
+++ b/src/src/miscmods/exim_filter_api.h
@@ -0,0 +1,15 @@
+/*************************************************
+*     Exim - an Internet mail transport agent    *
+*************************************************/
+
+/* Copyright (c) The Exim Maintainers 2024 */
+/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/* API definitions for the sieve_filter module */
+
+
+/* Function table entry numbers */
+
+#define    EXIM_INTERPRET        0
+#define EXIM_FILTER_PERSONAL    1
diff --git a/src/src/miscmods/sieve_filter.c b/src/src/miscmods/sieve_filter.c
index 56f20bfd5..f3935caf3 100644
--- a/src/src/miscmods/sieve_filter.c
+++ b/src/src/miscmods/sieve_filter.c
@@ -3220,13 +3220,19 @@ while (*filter->pc)
 
     if (exec)
       {
-      address_item *addr;
+      address_item * addr;
       md5 base;
-      uschar digest[16];
-      uschar hexdigest[33];
+      uschar digest[16], hexdigest[33];
       gstring * once;
+      misc_module_info * mi;
+      typedef BOOL (*fn_t)(string_item *, BOOL);
 
-      if (filter_personal(aliases, TRUE))
+      if (!(mi = misc_mod_find(US"exim_filter", NULL)))
+        {
+        filter->errmsg = CUS "test for 'personal': module not available";
+        return -1;
+        }
+      if ((((fn_t *) mi->functions)[EXIM_FILTER_PERSONAL])(aliases, TRUE))
         {
         if (filter_test == FTEST_NONE)
           {
diff --git a/src/src/rda.c b/src/src/rda.c
index 3e3a0cf83..405e4646a 100644
--- a/src/src/rda.c
+++ b/src/src/rda.c
@@ -383,13 +383,21 @@ if (*filtertype != FILTER_FORWARD)
 
   if (*filtertype == FILTER_EXIM)
     {
+    const misc_module_info * mi;
+    typedef int (*fn_t)(const uschar *, int, address_item **, uschar **);
+
     if (options & RDO_EXIM_FILTER)
       {
       *error = US"Exim filtering not enabled";
       return FF_ERROR;
       }
-/*XXX*/
-    frc = filter_interpret(data, options, generated, error);
+    if (!(mi = misc_mod_find(US"exim_filter", NULL)))
+      {
+      *error = US"Exim-filtering not available";
+      return FF_ERROR;
+      }
+    frc = (((fn_t *) mi->functions)[EXIM_INTERPRET])
+                      (data, options, generated, error);
     }
   else
     {
diff --git a/test/README b/test/README
index fe31bda43..3f8675545 100644
--- a/test/README
+++ b/test/README
@@ -1211,7 +1211,7 @@ whose content is fixed, and those whose content needs to be varied according to
 the current environment. The former are kept in the directory aux-fixed. The
 latter are distributed in the directory aux-var-src, and copied with the
 standard substitutions into the directory aux-var at the start of each test
-run.
+run (with TESTNUM from the numeric prefix of the filename is there is one).
 
 Most of the auxiliary files have names that start with a test number,
 indicating that they are specific to that one test. A few fixed files (for
diff --git a/test/aux-fixed/0037.f-1 b/test/aux-fixed/4110.f-1
similarity index 100%
rename from test/aux-fixed/0037.f-1
rename to test/aux-fixed/4110.f-1
diff --git a/test/aux-fixed/0037.f-2 b/test/aux-fixed/4110.f-2
similarity index 100%
rename from test/aux-fixed/0037.f-2
rename to test/aux-fixed/4110.f-2
diff --git a/test/aux-fixed/0037.f-3 b/test/aux-fixed/4110.f-3
similarity index 100%
rename from test/aux-fixed/0037.f-3
rename to test/aux-fixed/4110.f-3
diff --git a/test/aux-fixed/0037.f-4 b/test/aux-fixed/4110.f-4
similarity index 100%
rename from test/aux-fixed/0037.f-4
rename to test/aux-fixed/4110.f-4
diff --git a/test/aux-fixed/0037.f-5 b/test/aux-fixed/4110.f-5
similarity index 100%
rename from test/aux-fixed/0037.f-5
rename to test/aux-fixed/4110.f-5
diff --git a/test/aux-fixed/0037.f-6 b/test/aux-fixed/4110.f-6
similarity index 100%
rename from test/aux-fixed/0037.f-6
rename to test/aux-fixed/4110.f-6
diff --git a/test/aux-fixed/0037.f-7 b/test/aux-fixed/4110.f-7
similarity index 100%
rename from test/aux-fixed/0037.f-7
rename to test/aux-fixed/4110.f-7
diff --git a/test/aux-fixed/0037.f-8 b/test/aux-fixed/4110.f-8
similarity index 100%
rename from test/aux-fixed/0037.f-8
rename to test/aux-fixed/4110.f-8
diff --git a/test/aux-fixed/0037.f-9 b/test/aux-fixed/4110.f-9
similarity index 100%
rename from test/aux-fixed/0037.f-9
rename to test/aux-fixed/4110.f-9
diff --git a/test/aux-fixed/0037.msg b/test/aux-fixed/4110.msg
similarity index 100%
rename from test/aux-fixed/0037.msg
rename to test/aux-fixed/4110.msg
diff --git a/test/aux-fixed/0015.filter.userx b/test/aux-fixed/4111.filter.userx
similarity index 100%
rename from test/aux-fixed/0015.filter.userx
rename to test/aux-fixed/4111.filter.userx
diff --git a/test/aux-fixed/4111.realnames b/test/aux-fixed/4111.realnames
new file mode 100644
index 000000000..40a313834
--- /dev/null
+++ b/test/aux-fixed/4111.realnames
@@ -0,0 +1 @@
+ux: userx
diff --git a/test/aux-fixed/0016.filter.userx b/test/aux-fixed/4112.filter.userx
similarity index 100%
rename from test/aux-fixed/0016.filter.userx
rename to test/aux-fixed/4112.filter.userx
diff --git a/test/aux-fixed/0046.filter.userx b/test/aux-fixed/4113.filter.userx
similarity index 100%
rename from test/aux-fixed/0046.filter.userx
rename to test/aux-fixed/4113.filter.userx
diff --git a/test/aux-fixed/0079.aliases b/test/aux-fixed/4116.aliases
similarity index 100%
rename from test/aux-fixed/0079.aliases
rename to test/aux-fixed/4116.aliases
diff --git a/test/aux-fixed/0093.f-3 b/test/aux-fixed/4117.f-3
similarity index 100%
rename from test/aux-fixed/0093.f-3
rename to test/aux-fixed/4117.f-3
diff --git a/test/aux-fixed/0093.lsearch b/test/aux-fixed/4117.lsearch
similarity index 100%
rename from test/aux-fixed/0093.lsearch
rename to test/aux-fixed/4117.lsearch
diff --git a/test/aux-fixed/0098.aliases b/test/aux-fixed/4118.aliases
similarity index 100%
rename from test/aux-fixed/0098.aliases
rename to test/aux-fixed/4118.aliases
diff --git a/test/aux-fixed/0098.forward b/test/aux-fixed/4118.forward
similarity index 100%
rename from test/aux-fixed/0098.forward
rename to test/aux-fixed/4118.forward
diff --git a/test/aux-fixed/0098.wmf b/test/aux-fixed/4118.wmf
similarity index 100%
rename from test/aux-fixed/0098.wmf
rename to test/aux-fixed/4118.wmf
diff --git a/test/aux-fixed/0122.filter b/test/aux-fixed/4120.filter
similarity index 100%
rename from test/aux-fixed/0122.filter
rename to test/aux-fixed/4120.filter
diff --git a/test/aux-fixed/0131.userx b/test/aux-fixed/4121.userx
similarity index 100%
rename from test/aux-fixed/0131.userx
rename to test/aux-fixed/4121.userx
diff --git a/test/aux-fixed/0136.filter b/test/aux-fixed/4122.filter
similarity index 100%
rename from test/aux-fixed/0136.filter
rename to test/aux-fixed/4122.filter
diff --git a/test/aux-fixed/0168.filter b/test/aux-fixed/4125.filter
similarity index 100%
rename from test/aux-fixed/0168.filter
rename to test/aux-fixed/4125.filter
diff --git a/test/aux-fixed/0170.filter b/test/aux-fixed/4126.filter
similarity index 100%
rename from test/aux-fixed/0170.filter
rename to test/aux-fixed/4126.filter
diff --git a/test/aux-fixed/0177.alias b/test/aux-fixed/4128.alias
similarity index 100%
rename from test/aux-fixed/0177.alias
rename to test/aux-fixed/4128.alias
diff --git a/test/aux-fixed/0182.filter b/test/aux-fixed/4129.filter
similarity index 100%
rename from test/aux-fixed/0182.filter
rename to test/aux-fixed/4129.filter
diff --git a/test/aux-fixed/0184.lsearch b/test/aux-fixed/4130.lsearch
similarity index 100%
rename from test/aux-fixed/0184.lsearch
rename to test/aux-fixed/4130.lsearch
diff --git a/test/aux-fixed/0185.alias b/test/aux-fixed/4131.alias
similarity index 100%
rename from test/aux-fixed/0185.alias
rename to test/aux-fixed/4131.alias
diff --git a/test/aux-fixed/0233.filter b/test/aux-fixed/4133.filter
similarity index 100%
rename from test/aux-fixed/0233.filter
rename to test/aux-fixed/4133.filter
diff --git a/test/aux-fixed/0241.filter b/test/aux-fixed/4134.filter
similarity index 100%
rename from test/aux-fixed/0241.filter
rename to test/aux-fixed/4134.filter
diff --git a/test/aux-fixed/0246.data b/test/aux-fixed/4135.data
similarity index 100%
rename from test/aux-fixed/0246.data
rename to test/aux-fixed/4135.data
diff --git a/test/aux-fixed/0246.file b/test/aux-fixed/4135.file
similarity index 100%
rename from test/aux-fixed/0246.file
rename to test/aux-fixed/4135.file
diff --git a/test/aux-fixed/0248.filter b/test/aux-fixed/4136.filter
similarity index 100%
rename from test/aux-fixed/0248.filter
rename to test/aux-fixed/4136.filter
diff --git a/test/aux-fixed/0266.filter b/test/aux-fixed/4137.filter
similarity index 100%
copy from test/aux-fixed/0266.filter
copy to test/aux-fixed/4137.filter
diff --git a/test/aux-fixed/0266.filter2 b/test/aux-fixed/4137.filter2
similarity index 100%
copy from test/aux-fixed/0266.filter2
copy to test/aux-fixed/4137.filter2
diff --git a/test/aux-fixed/0266.filter3 b/test/aux-fixed/4137.filter3
similarity index 100%
rename from test/aux-fixed/0266.filter3
rename to test/aux-fixed/4137.filter3
diff --git a/test/aux-fixed/4137.list b/test/aux-fixed/4137.list
new file mode 100644
index 000000000..09c6cd8a4
--- /dev/null
+++ b/test/aux-fixed/4137.list
@@ -0,0 +1,5 @@
+(This is just a comment)
+userx@???
+@@test.ex (This has a syntax error)
+spqr@???
+userx@??? (again)
diff --git a/test/aux-fixed/4137.list2 b/test/aux-fixed/4137.list2
new file mode 100644
index 000000000..1a01840ae
--- /dev/null
+++ b/test/aux-fixed/4137.list2
@@ -0,0 +1,2 @@
+(This is just a comment)
+@@test.ex (This has a syntax error)
diff --git a/test/aux-fixed/4137.nmlist b/test/aux-fixed/4137.nmlist
new file mode 100644
index 000000000..1a01840ae
--- /dev/null
+++ b/test/aux-fixed/4137.nmlist
@@ -0,0 +1,2 @@
+(This is just a comment)
+@@test.ex (This has a syntax error)
diff --git a/test/aux-fixed/0266.filter b/test/aux-fixed/4138.filter
similarity index 100%
rename from test/aux-fixed/0266.filter
rename to test/aux-fixed/4138.filter
diff --git a/test/aux-fixed/0266.filter2 b/test/aux-fixed/4138.filter2
similarity index 100%
rename from test/aux-fixed/0266.filter2
rename to test/aux-fixed/4138.filter2
diff --git a/test/aux-fixed/4138.filter3 b/test/aux-fixed/4138.filter3
new file mode 100644
index 000000000..88cb68768
--- /dev/null
+++ b/test/aux-fixed/4138.filter3
@@ -0,0 +1,6 @@
+# Exim filter
+
+# router_home_directory = DIR/
+
+logfile ${home}test-private
+logwrite "Testing"
diff --git a/test/aux-fixed/4138.list b/test/aux-fixed/4138.list
new file mode 100644
index 000000000..09c6cd8a4
--- /dev/null
+++ b/test/aux-fixed/4138.list
@@ -0,0 +1,5 @@
+(This is just a comment)
+userx@???
+@@test.ex (This has a syntax error)
+spqr@???
+userx@??? (again)
diff --git a/test/aux-fixed/4138.list2 b/test/aux-fixed/4138.list2
new file mode 100644
index 000000000..1a01840ae
--- /dev/null
+++ b/test/aux-fixed/4138.list2
@@ -0,0 +1,2 @@
+(This is just a comment)
+@@test.ex (This has a syntax error)
diff --git a/test/aux-fixed/4138.nmlist b/test/aux-fixed/4138.nmlist
new file mode 100644
index 000000000..1a01840ae
--- /dev/null
+++ b/test/aux-fixed/4138.nmlist
@@ -0,0 +1,2 @@
+(This is just a comment)
+@@test.ex (This has a syntax error)
diff --git a/test/aux-fixed/0296.Filter b/test/aux-fixed/4139.Filter
similarity index 100%
rename from test/aux-fixed/0296.Filter
rename to test/aux-fixed/4139.Filter
diff --git a/test/aux-fixed/0297.Filter b/test/aux-fixed/4140.Filter
similarity index 100%
rename from test/aux-fixed/0297.Filter
rename to test/aux-fixed/4140.Filter
diff --git a/test/aux-fixed/0298.Filter b/test/aux-fixed/4141.Filter
similarity index 100%
rename from test/aux-fixed/0298.Filter
rename to test/aux-fixed/4141.Filter
diff --git a/test/aux-fixed/0316.f-user b/test/aux-fixed/4142.f-user
similarity index 100%
rename from test/aux-fixed/0316.f-user
rename to test/aux-fixed/4142.f-user
diff --git a/test/aux-fixed/0328.F b/test/aux-fixed/4145.F
similarity index 100%
rename from test/aux-fixed/0328.F
rename to test/aux-fixed/4145.F
diff --git a/test/aux-fixed/0329.F b/test/aux-fixed/4146.F
similarity index 100%
rename from test/aux-fixed/0329.F
rename to test/aux-fixed/4146.F
diff --git a/test/aux-fixed/0351.F b/test/aux-fixed/4149.F
similarity index 100%
rename from test/aux-fixed/0351.F
rename to test/aux-fixed/4149.F
diff --git a/test/aux-fixed/0352.F b/test/aux-fixed/4150.F
similarity index 100%
rename from test/aux-fixed/0352.F
rename to test/aux-fixed/4150.F
diff --git a/test/aux-fixed/0382.F b/test/aux-fixed/4153.F
similarity index 100%
rename from test/aux-fixed/0382.F
rename to test/aux-fixed/4153.F
diff --git a/test/aux-fixed/0406.f b/test/aux-fixed/4156.f
similarity index 100%
rename from test/aux-fixed/0406.f
rename to test/aux-fixed/4156.f
diff --git a/test/aux-fixed/0412.F b/test/aux-fixed/4158.F
similarity index 100%
rename from test/aux-fixed/0412.F
rename to test/aux-fixed/4158.F
diff --git a/test/aux-fixed/0421.F b/test/aux-fixed/4159.F
similarity index 100%
rename from test/aux-fixed/0421.F
rename to test/aux-fixed/4159.F
diff --git a/test/aux-fixed/0444.sysfilter b/test/aux-fixed/4160.sysfilter
similarity index 100%
rename from test/aux-fixed/0444.sysfilter
rename to test/aux-fixed/4160.sysfilter
diff --git a/test/aux-fixed/0452.filter-1 b/test/aux-fixed/4161.filter-1
similarity index 100%
rename from test/aux-fixed/0452.filter-1
rename to test/aux-fixed/4161.filter-1
diff --git a/test/aux-fixed/0452.filter-2 b/test/aux-fixed/4161.filter-2
similarity index 100%
rename from test/aux-fixed/0452.filter-2
rename to test/aux-fixed/4161.filter-2
diff --git a/test/aux-fixed/0454.filter b/test/aux-fixed/4162.filter
similarity index 100%
rename from test/aux-fixed/0454.filter
rename to test/aux-fixed/4162.filter
diff --git a/test/aux-fixed/0472.F b/test/aux-fixed/4163.F
similarity index 100%
rename from test/aux-fixed/0472.F
rename to test/aux-fixed/4163.F
diff --git a/test/aux-fixed/0506.exim-filter b/test/aux-fixed/4164.exim-filter
similarity index 100%
rename from test/aux-fixed/0506.exim-filter
rename to test/aux-fixed/4164.exim-filter
diff --git a/test/aux-fixed/0510.sfilter b/test/aux-fixed/4165.sfilter
similarity index 100%
rename from test/aux-fixed/0510.sfilter
rename to test/aux-fixed/4165.sfilter
diff --git a/test/aux-fixed/0510.ufilter b/test/aux-fixed/4165.ufilter
similarity index 100%
rename from test/aux-fixed/0510.ufilter
rename to test/aux-fixed/4165.ufilter
diff --git a/test/aux-fixed/0616.filter b/test/aux-fixed/4166.filter
similarity index 100%
rename from test/aux-fixed/0616.filter
rename to test/aux-fixed/4166.filter
diff --git a/test/aux-fixed/0617.filter b/test/aux-fixed/4167.filter
similarity index 100%
rename from test/aux-fixed/0617.filter
rename to test/aux-fixed/4167.filter
diff --git a/test/aux-fixed/4160.message b/test/aux-fixed/4190.message
similarity index 100%
rename from test/aux-fixed/4160.message
rename to test/aux-fixed/4190.message
diff --git a/test/aux-fixed/4160.message2 b/test/aux-fixed/4190.message2
similarity index 100%
rename from test/aux-fixed/4160.message2
rename to test/aux-fixed/4190.message2
diff --git a/test/aux-fixed/4160.message3 b/test/aux-fixed/4190.message3
similarity index 100%
rename from test/aux-fixed/4160.message3
rename to test/aux-fixed/4190.message3
diff --git a/test/aux-fixed/4162.sieve-filter b/test/aux-fixed/4192.sieve-filter
similarity index 100%
rename from test/aux-fixed/4162.sieve-filter
rename to test/aux-fixed/4192.sieve-filter
diff --git a/test/aux-fixed/4163.sieve b/test/aux-fixed/4193.sieve
similarity index 100%
rename from test/aux-fixed/4163.sieve
rename to test/aux-fixed/4193.sieve
diff --git a/test/aux-fixed/5201.filter b/test/aux-fixed/5210.filter
similarity index 100%
rename from test/aux-fixed/5201.filter
rename to test/aux-fixed/5210.filter
diff --git a/test/aux-fixed/5202.filter b/test/aux-fixed/5211.filter
similarity index 100%
rename from test/aux-fixed/5202.filter
rename to test/aux-fixed/5211.filter
diff --git a/test/aux-fixed/5703.filter b/test/aux-fixed/5703.filter
deleted file mode 100644
index 3083624a8..000000000
--- a/test/aux-fixed/5703.filter
+++ /dev/null
@@ -1,3 +0,0 @@
-# Exim filter
-
-deliver usery@domain1
diff --git a/test/aux-fixed/5702.filter b/test/aux-fixed/5705.filter
similarity index 100%
rename from test/aux-fixed/5702.filter
rename to test/aux-fixed/5705.filter
diff --git a/test/aux-fixed/5706.filter b/test/aux-fixed/5706.filter
index b434b77c2..3083624a8 100644
--- a/test/aux-fixed/5706.filter
+++ b/test/aux-fixed/5706.filter
@@ -1,3 +1,3 @@
 # Exim filter
 
-fail "failed in filter file"
+deliver usery@domain1
diff --git a/test/aux-fixed/5704.filter b/test/aux-fixed/5707.filter
similarity index 100%
rename from test/aux-fixed/5704.filter
rename to test/aux-fixed/5707.filter
diff --git a/test/aux-fixed/5706.filter b/test/aux-fixed/5708.filter
similarity index 100%
copy from test/aux-fixed/5706.filter
copy to test/aux-fixed/5708.filter
diff --git a/test/aux-var-src/0246.filter b/test/aux-var-src/0246.filter
deleted file mode 100644
index a851e3979..000000000
--- a/test/aux-var-src/0246.filter
+++ /dev/null
@@ -1,3 +0,0 @@
-# Exim filter
-
-seen mail expand file DIR/aux-fixed/0246.file
diff --git a/test/aux-var-src/0037.F b/test/aux-var-src/4110.F
similarity index 100%
rename from test/aux-var-src/0037.F
rename to test/aux-var-src/4110.F
diff --git a/test/aux-var-src/0037.f-7 b/test/aux-var-src/4110.f-7
similarity index 100%
rename from test/aux-var-src/0037.f-7
rename to test/aux-var-src/4110.f-7
diff --git a/test/aux-var-src/0037.f-readfile b/test/aux-var-src/4110.f-readfile
similarity index 100%
rename from test/aux-var-src/0037.f-readfile
rename to test/aux-var-src/4110.f-readfile
diff --git a/test/aux-var-src/0037.f-user b/test/aux-var-src/4110.f-user
similarity index 100%
rename from test/aux-var-src/0037.f-user
rename to test/aux-var-src/4110.f-user
diff --git a/test/aux-var-src/0074.filter b/test/aux-var-src/4115.filter
similarity index 100%
rename from test/aux-var-src/0074.filter
rename to test/aux-var-src/4115.filter
diff --git a/test/aux-var-src/0079.filter b/test/aux-var-src/4116.filter
similarity index 100%
rename from test/aux-var-src/0079.filter
rename to test/aux-var-src/4116.filter
diff --git a/test/aux-var-src/0093.f-1 b/test/aux-var-src/4117.f-1
similarity index 60%
rename from test/aux-var-src/0093.f-1
rename to test/aux-var-src/4117.f-1
index bc49c5701..adabd3eaa 100644
--- a/test/aux-var-src/0093.f-1
+++ b/test/aux-var-src/4117.f-1
@@ -8,9 +8,9 @@ testprint
 "${if eq {1}{1}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/junkjunk}{$value}{notfound}}}}"
 
 testprint 
-"${if eq {1}{1}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/0093.lsearch}{$value}{notfound}}}}"
+"${if eq {1}{1}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/TESTNUM.lsearch}{$value}{notfound}}}}"
 
 testprint 
-"${if eq {1}{0}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/0093.lsearch}{$value}{notfound}}}}"
+"${if eq {1}{0}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/TESTNUM.lsearch}{$value}{notfound}}}}"
 
 testprint "body_linecount=$body_linecount"
diff --git a/test/aux-var-src/0093.f-2 b/test/aux-var-src/4117.f-2
similarity index 100%
rename from test/aux-var-src/0093.f-2
rename to test/aux-var-src/4117.f-2
diff --git a/test/aux-var-src/0114.filter b/test/aux-var-src/4119.filter
similarity index 100%
rename from test/aux-var-src/0114.filter
rename to test/aux-var-src/4119.filter
diff --git a/test/aux-var-src/0164.F b/test/aux-var-src/4123.F
similarity index 100%
rename from test/aux-var-src/0164.F
rename to test/aux-var-src/4123.F
diff --git a/test/aux-var-src/0165.F b/test/aux-var-src/4124.F
similarity index 100%
rename from test/aux-var-src/0165.F
rename to test/aux-var-src/4124.F
diff --git a/test/aux-var-src/0173.filter b/test/aux-var-src/4127.filter
similarity index 100%
rename from test/aux-var-src/0173.filter
rename to test/aux-var-src/4127.filter
diff --git a/test/aux-var-src/0177.filter b/test/aux-var-src/4128.filter
similarity index 100%
rename from test/aux-var-src/0177.filter
rename to test/aux-var-src/4128.filter
diff --git a/test/aux-var-src/0184.filter b/test/aux-var-src/4130.filter
similarity index 62%
rename from test/aux-var-src/0184.filter
rename to test/aux-var-src/4130.filter
index 4766b628a..7f97584ea 100644
--- a/test/aux-var-src/0184.filter
+++ b/test/aux-var-src/4130.filter
@@ -8,8 +8,8 @@ logwrite "To: contains\n$h_to:\n"
 
 if 
   $header_to is $header_from or
-  "${lookup{$h_to:}lsearch{DIR/aux-fixed/0184.lsearch}{$value}}" is y or
-  "${lookup{${local_part:$h_to:}}lsearch{DIR/aux-fixed/0184.lsearch}{$value}}" is y
+  "${lookup{$h_to:}lsearch{DIR/aux-fixed/TESTNUM.lsearch}{$value}}" is y or
+  "${lookup{${local_part:$h_to:}}lsearch{DIR/aux-fixed/TESTNUM.lsearch}{$value}}" is y
 then
   logwrite "yyyyyy"
 else
diff --git a/test/aux-var-src/0185.filter b/test/aux-var-src/4131.filter
similarity index 100%
rename from test/aux-var-src/0185.filter
rename to test/aux-var-src/4131.filter
diff --git a/test/aux-var-src/4135.filter b/test/aux-var-src/4135.filter
new file mode 100644
index 000000000..6fbba113f
--- /dev/null
+++ b/test/aux-var-src/4135.filter
@@ -0,0 +1,3 @@
+# Exim filter
+
+seen mail expand file DIR/aux-fixed/TESTNUM.file
diff --git a/test/aux-var-src/0319.filter b/test/aux-var-src/4143.filter
similarity index 100%
rename from test/aux-var-src/0319.filter
rename to test/aux-var-src/4143.filter
diff --git a/test/aux-var-src/0326.filter b/test/aux-var-src/4144.filter
similarity index 100%
rename from test/aux-var-src/0326.filter
rename to test/aux-var-src/4144.filter
diff --git a/test/aux-var-src/0372.F b/test/aux-var-src/4151.F
similarity index 100%
rename from test/aux-var-src/0372.F
rename to test/aux-var-src/4151.F
diff --git a/test/aux-var-src/0383.F b/test/aux-var-src/4154.F
similarity index 100%
rename from test/aux-var-src/0383.F
rename to test/aux-var-src/4154.F
diff --git a/test/aux-var-src/0383.F2 b/test/aux-var-src/4154.F2
similarity index 100%
rename from test/aux-var-src/0383.F2
rename to test/aux-var-src/4154.F2
diff --git a/test/aux-var-src/0472.f b/test/aux-var-src/4163.f
similarity index 100%
rename from test/aux-var-src/0472.f
rename to test/aux-var-src/4163.f
diff --git a/test/confs/0015 b/test/confs/0015
index afd8144c5..1381d7cd7 100644
--- a/test/confs/0015
+++ b/test/confs/0015
@@ -17,7 +17,7 @@ convert_to_real_name:
   allow_defer
   data = "\
     $local_part_prefix${lookup{$local_part}\
-    lsearch{DIR/aux-fixed/0015.realnames}{$value}fail}@$domain"
+    lsearch{DIR/aux-fixed/TESTNUM.realnames}{$value}fail}@$domain"
   local_part_prefix = *+
   local_part_prefix_optional
   retry_use_local_part
@@ -25,7 +25,7 @@ convert_to_real_name:
 #system_aliases:
 #  driver = redirect
 #  allow_defer
-#  data = ${lookup{$local_part}lsearch{DIR/aux-fixed/0015.aliases}}
+#  data = ${lookup{$local_part}lsearch{DIR/aux-fixed/TESTNUM.aliases}}
 #  retry_use_local_part
 
 userforward:
@@ -33,7 +33,7 @@ userforward:
   allow_filter
   local_parts = userx
   user = CALLER
-  file = DIR/aux-fixed/0015.filter.userx
+  file = DIR/aux-fixed/TESTNUM.filter.userx
   local_part_prefix = *+
   local_part_prefix_optional
   pipe_transport = address_pipe
diff --git a/test/confs/0266 b/test/confs/0266
index 2f6cece91..9ebbeb475 100644
--- a/test/confs/0266
+++ b/test/confs/0266
@@ -40,18 +40,6 @@ r1a:
   file = ${lookup {TESTNUM.$local_part} dsearch,ret=full {DIR/aux-fixed} {$value}fail}
   no_more
 
-r2:
-  driver = redirect
-  skip_syntax_errors
-  local_parts = ^filter
-  syntax_errors_to = postmaster@???
-  syntax_errors_text = "There's an error in your filter file.\n\
-                        The file has been ignored."
-  file = ${lookup {TESTNUM.$local_part} dsearch,ret=full {DIR/aux-fixed} {$value}fail}
-  allow_filter
-  router_home_directory = DIR
-  user = CALLER
-
 r3:
   driver = accept
   transport = t1
diff --git a/test/confs/0270 b/test/confs/0270
index 7dae6d523..e267df056 100644
--- a/test/confs/0270
+++ b/test/confs/0270
@@ -40,18 +40,6 @@ r1a:
   file = ${lookup {TESTNUM.$local_part} dsearch,ret=full {DIR/aux-fixed} {$value}fail}
   no_more
 
-r2:
-  driver = redirect
-  skip_syntax_errors
-  local_parts = ^filter
-  syntax_errors_to = postmaster@???
-  syntax_errors_text = "There's an error in your filter file.\n\
-                        The file has been ignored."
-  file = ${lookup {TESTNUM.$local_part} dsearch,ret=full {DIR/aux-fixed} {$value}fail}
-  allow_filter
-  router_home_directory = DIR/
-  user = CALLER
-
 r3:
   driver = accept
   transport = t1
diff --git a/test/confs/0346 b/test/confs/0346
index 6e84faa2e..0d31b37ed 100644
--- a/test/confs/0346
+++ b/test/confs/0346
@@ -22,9 +22,9 @@ r1:
 r2:
   driver = redirect
   domains = dom1
-  allow_filter
   user = CALLER
-  data = "#Exim filter\n unseen deliver x@dom2"
+  data = x@dom2
+  unseen = true
 
 r3:
   driver = accept
diff --git a/test/confs/0444 b/test/confs/0444
deleted file mode 100644
index c89862a82..000000000
--- a/test/confs/0444
+++ /dev/null
@@ -1,40 +0,0 @@
-# Exim test configuration 0444
-
-.include DIR/aux-var/std_conf_prefix
-
-primary_hostname = myhost.test.ex
-
-
-# ----- Main settings -----
-
-qualify_domain = test.ex
-
-system_filter = DIR/aux-fixed/TESTNUM.sysfilter
-system_filter_reply_transport = t2
-system_filter_user = EXIMUSER
-
-# ----- Routers -----
-
-begin routers
-
-r1:
-  driver = accept
-  transport = t1
-
-
-# ----- Transports -----
-
-begin transports
-
-t1:
-  driver = appendfile
-  file = DIR/test-mail/$local_part
-  create_file = DIR/test-mail
-  user = CALLER
-
-t2:
-  driver = autoreply
-  user = CALLER
-
-
-# End
diff --git a/test/confs/0452 b/test/confs/0452
deleted file mode 100644
index 8ac3b923f..000000000
--- a/test/confs/0452
+++ /dev/null
@@ -1,43 +0,0 @@
-# Exim test configuration 0452
-
-.include DIR/aux-var/std_conf_prefix
-
-primary_hostname = myhost.test.ex
-
-
-# ----- Main settings -----
-
-qualify_domain = test.ex
-
-
-# ----- Routers -----
-
-begin routers
-
-r1:
-  driver = redirect
-  allow_filter
-  file = DIR/aux-fixed/TESTNUM.filter-FILTER
-  reply_transport = t2
-  user = CALLER
-
-r2:
-  driver = accept
-  transport = t1
-
-
-# ----- Transports -----
-
-begin transports
-
-t1:
-  driver = appendfile
-  file = DIR/test-mail/$local_part
-  create_file = DIR/test-mail
-  user = CALLER
-
-t2:
-  driver = autoreply
-
-
-# End
diff --git a/test/confs/0454 b/test/confs/0454
deleted file mode 100644
index 359d0d917..000000000
--- a/test/confs/0454
+++ /dev/null
@@ -1,49 +0,0 @@
-# Exim test configuration 0454
-
-.include DIR/aux-var/std_conf_prefix
-
-primary_hostname = myhost.test.ex
-
-
-# ----- Main settings -----
-
-qualify_domain = test.ex
-
-acl_smtp_rcpt = accept
-log_selector = +address_rewrite
-
-
-# ----- Routers -----
-
-begin routers
-
-r1:
-  driver = redirect
-  allow_filter
-  file = DIR/aux-fixed/TESTNUM.filter
-  redirect_router = r2
-  user = CALLER
-
-r2:
-  driver = accept
-  transport = t1
-
-
-# ----- Transports -----
-
-begin transports
-
-t1:
-  driver = appendfile
-  file = /dev/null
-  user = CALLER
-
-
-# ----- Rewrite -----
-
-begin rewrite
-
-*@cam   $local_part@???
-
-
-# End
diff --git a/test/confs/0472 b/test/confs/0472
deleted file mode 100644
index a0df6c971..000000000
--- a/test/confs/0472
+++ /dev/null
@@ -1,41 +0,0 @@
-# Exim test configuration 0472
-
-FUSER=
-
-.include DIR/aux-var/std_conf_prefix
-
-primary_hostname = myhost.test.ex
-
-# ----- Main settings -----
-
-system_filter = DIR/aux-fixed/TESTNUM.F
-FUSER
-
-
-# ----- Routers -----
-
-begin routers
-
-r1:
-  driver = redirect
-  allow_filter
-  file = DIR/aux-var/TESTNUM.f
-  user = CALLER
-
-r2:
-  driver = accept
-  transport = t1
-
-
-# ----- Transports -----
-
-begin transports
-
-t1:
-  driver = appendfile
-  file = DIR/test-mail/$local_part
-  create_file = DIR/test-mail
-  user = CALLER
-
-
-# End
diff --git a/test/confs/0037 b/test/confs/4110
similarity index 98%
rename from test/confs/0037
rename to test/confs/4110
index 4a7f5cade..2a6022048 100644
--- a/test/confs/0037
+++ b/test/confs/4110
@@ -1,4 +1,4 @@
-# Exim test configuration 0037
+# Exim test configuration 4110
 
 FILTER_PREPEND_HOME=
 
diff --git a/test/confs/0015 b/test/confs/4111
similarity index 90%
copy from test/confs/0015
copy to test/confs/4111
index afd8144c5..1ca5f1f0b 100644
--- a/test/confs/0015
+++ b/test/confs/4111
@@ -1,4 +1,4 @@
-# Exim test configuration 0015
+# Exim test configuration 4111
 
 .include DIR/aux-var/std_conf_prefix
 
@@ -17,7 +17,7 @@ convert_to_real_name:
   allow_defer
   data = "\
     $local_part_prefix${lookup{$local_part}\
-    lsearch{DIR/aux-fixed/0015.realnames}{$value}fail}@$domain"
+    lsearch{DIR/aux-fixed/TESTNUM.realnames}{$value}fail}@$domain"
   local_part_prefix = *+
   local_part_prefix_optional
   retry_use_local_part
@@ -25,7 +25,7 @@ convert_to_real_name:
 #system_aliases:
 #  driver = redirect
 #  allow_defer
-#  data = ${lookup{$local_part}lsearch{DIR/aux-fixed/0015.aliases}}
+#  data = ${lookup{$local_part}lsearch{DIR/aux-fixed/TESTNUM.aliases}}
 #  retry_use_local_part
 
 userforward:
@@ -33,7 +33,7 @@ userforward:
   allow_filter
   local_parts = userx
   user = CALLER
-  file = DIR/aux-fixed/0015.filter.userx
+  file = DIR/aux-fixed/TESTNUM.filter.userx
   local_part_prefix = *+
   local_part_prefix_optional
   pipe_transport = address_pipe
diff --git a/test/confs/0016 b/test/confs/4112
similarity index 90%
rename from test/confs/0016
rename to test/confs/4112
index f8cbb7cbb..affcb9bd3 100644
--- a/test/confs/0016
+++ b/test/confs/4112
@@ -1,4 +1,4 @@
-# Exim test configuration 0016
+# Exim test configuration 4112
 
 .include DIR/aux-var/std_conf_prefix
 
@@ -17,7 +17,7 @@ userforward:
   allow_filter
   user = CALLER
   local_parts = userx : CALLER
-  file = DIR/aux-fixed/0016.filter.$local_part_data
+  file = DIR/aux-fixed/TESTNUM.filter.$local_part_data
   local_part_suffix = +*
   local_part_suffix_optional
   reply_transport = address_reply
diff --git a/test/confs/4113 b/test/confs/4113
new file mode 100644
index 000000000..b60cb1eb6
--- /dev/null
+++ b/test/confs/4113
@@ -0,0 +1,45 @@
+# Exim test configuration 4113
+
+NL=FALSE
+
+.include DIR/aux-var/std_conf_prefix
+
+
+# ----- Main settings -----
+
+message_body_newlines = NL
+message_id_header_domain = test.ex
+qualify_domain = test.ex
+# Omit Received: so as to keep the header size fixed
+received_header_text =
+trusted_users = CALLER
+
+
+# ----- Routers -----
+
+begin routers
+
+localuser:
+  driver = accept
+  local_parts = userx
+  transport = local_delivery
+
+
+# ----- Transports -----
+
+begin transports
+
+local_delivery:
+  driver = appendfile
+  envelope_to_add
+  file = DIR/test-mail/$local_part
+  create_file = DIR/test-mail
+  headers_add = "X-size: $message_size\n\
+                 X-body-size: $message_body_size\n\
+                 X-body: $message_body\n\
+                 X-tail: $message_body_end\n\
+                 X-local-user: uid=$local_user_uid gid=$local_user_gid"
+  return_path_add
+  user = CALLER
+
+# End
diff --git a/test/confs/0074 b/test/confs/4114
similarity index 52%
copy from test/confs/0074
copy to test/confs/4114
index 4b3e4807c..6fc5c7259 100644
--- a/test/confs/0074
+++ b/test/confs/4114
@@ -1,4 +1,8 @@
-# Exim test configuration 0074
+# Exim test configuration 0072
+
+ONCE=once=DIR/spool/autolog
+ONLY=
+RETURN=
 
 .include DIR/aux-var/std_conf_prefix
 
@@ -12,21 +16,23 @@ qualify_domain = test.ex
 
 begin routers
 
-forwardfile:
+filter:
   driver = redirect
+  local_parts = userx-filter
   allow_filter
-  user = CALLER
-  file = DIR/aux-var/TESTNUM.filter
-  reply_transport = address_reply
+  data = #Exim filter\n seen mail text "This is an autoreply."
+  user = EXIMUSER
 
-abcd:
-  driver = redirect
-  local_parts = abcd
-  data = :blackhole:
+
+reply:
+  driver = accept
+  retry_use_local_part
+  senders = !
+  transport = reply
 
 localuser:
   driver = accept
-  local_parts = userx : CALLER
+  check_local_user
   transport = local_delivery
 
 
@@ -34,8 +40,14 @@ localuser:
 
 begin transports
 
-address_reply:
+reply:
   driver = autoreply
+  text = "Test auto reply to ${escape:$h_subject:}"
+  to = $reply_address
+  user = EXIMUSER
+  ONCE
+  RETURN
+  ONLY
 
 local_delivery:
   driver = appendfile
@@ -44,7 +56,6 @@ local_delivery:
   file = DIR/test-mail/$local_part
   create_file = DIR/test-mail
   return_path_add
-  user = CALLER
 
 
 # End
diff --git a/test/confs/0074 b/test/confs/4115
similarity index 95%
rename from test/confs/0074
rename to test/confs/4115
index 4b3e4807c..0dec96791 100644
--- a/test/confs/0074
+++ b/test/confs/4115
@@ -1,4 +1,4 @@
-# Exim test configuration 0074
+# Exim test configuration 4115
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0079 b/test/confs/4116
similarity index 98%
rename from test/confs/0079
rename to test/confs/4116
index 149290916..9a6623fa4 100644
--- a/test/confs/0079
+++ b/test/confs/4116
@@ -1,4 +1,4 @@
-# Exim test configuration 0079
+# Exim test configuration 4116
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0093 b/test/confs/4117
similarity index 76%
rename from test/confs/0093
rename to test/confs/4117
index 2ed0a5207..6db14db6e 100644
--- a/test/confs/0093
+++ b/test/confs/4117
@@ -1,4 +1,4 @@
-# Exim test configuration 0093
+# Exim test configuration 4117
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0098 b/test/confs/4118
similarity index 98%
rename from test/confs/0098
rename to test/confs/4118
index a1151378d..e39e82cec 100644
--- a/test/confs/0098
+++ b/test/confs/4118
@@ -1,4 +1,4 @@
-# Exim test configuration 0098
+# Exim test configuration 4118
 
 WMF=
 
diff --git a/test/confs/0114 b/test/confs/4119
similarity index 95%
rename from test/confs/0114
rename to test/confs/4119
index d5a60bb00..bc08cd363 100644
--- a/test/confs/0114
+++ b/test/confs/4119
@@ -1,4 +1,4 @@
-# Exim test configuration 0114
+# Exim test configuration 4119
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0122 b/test/confs/4120
similarity index 88%
rename from test/confs/0122
rename to test/confs/4120
index 3fec1235d..799de7614 100644
--- a/test/confs/0122
+++ b/test/confs/4120
@@ -1,4 +1,4 @@
-# Exim test configuration 0122
+# Exim test configuration 4120
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0131 b/test/confs/4121
similarity index 96%
rename from test/confs/0131
rename to test/confs/4121
index 552060cde..82f3dcdbd 100644
--- a/test/confs/0131
+++ b/test/confs/4121
@@ -1,4 +1,4 @@
-# Exim test configuration 0131
+# Exim test configuration 4121
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0136 b/test/confs/4122
similarity index 97%
rename from test/confs/0136
rename to test/confs/4122
index f2687b684..9720643de 100644
--- a/test/confs/0136
+++ b/test/confs/4122
@@ -1,4 +1,4 @@
-# Exim test configuration 0136
+# Exim test configuration 4122
 
 BRB=true
 
diff --git a/test/confs/0164 b/test/confs/4123
similarity index 94%
rename from test/confs/0164
rename to test/confs/4123
index dce05f28e..4b15a8a0f 100644
--- a/test/confs/0164
+++ b/test/confs/4123
@@ -1,4 +1,4 @@
-# Exim test configuration 0164
+# Exim test configuration 4123
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0165 b/test/confs/4124
similarity index 88%
rename from test/confs/0165
rename to test/confs/4124
index fb138bd2d..a4e522ea9 100644
--- a/test/confs/0165
+++ b/test/confs/4124
@@ -1,4 +1,4 @@
-# Exim test configuration 0165
+# Exim test configuration 4124
 
 .include DIR/aux-var/std_conf_prefix
 
@@ -8,7 +8,7 @@
 domainlist local_domains = test.ex
 qualify_domain = test.ex
 
-system_filter = DIR/aux-var/0165.F
+system_filter = DIR/aux-var/TESTNUM.F
 system_filter_pipe_transport = address_pipe
 system_filter_user = CALLER
 
diff --git a/test/confs/0168 b/test/confs/4125
similarity index 85%
rename from test/confs/0168
rename to test/confs/4125
index 196b8e60c..572d9a6a2 100644
--- a/test/confs/0168
+++ b/test/confs/4125
@@ -1,4 +1,4 @@
-# Exim test configuration 0168
+# Exim test configuration 4125
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0248 b/test/confs/4126
similarity index 86%
rename from test/confs/0248
rename to test/confs/4126
index 517a2f665..7cca3d512 100644
--- a/test/confs/0248
+++ b/test/confs/4126
@@ -1,4 +1,4 @@
-# Exim test configuration 0248
+# Exim test configuration 4126
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0173 b/test/confs/4127
similarity index 95%
rename from test/confs/0173
rename to test/confs/4127
index 9640ccf1c..b6fefc244 100644
--- a/test/confs/0173
+++ b/test/confs/4127
@@ -1,4 +1,4 @@
-# Exim test configuration 0173
+# Exim test configuration 4127
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0177 b/test/confs/4128
similarity index 97%
rename from test/confs/0177
rename to test/confs/4128
index eb15a515d..2e11db7e8 100644
--- a/test/confs/0177
+++ b/test/confs/4128
@@ -1,4 +1,4 @@
-# Exim test configuration 0177
+# Exim test configuration 4128
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0182 b/test/confs/4129
similarity index 95%
rename from test/confs/0182
rename to test/confs/4129
index cb0946615..8717077a4 100644
--- a/test/confs/0182
+++ b/test/confs/4129
@@ -1,4 +1,4 @@
-# Exim test configuration 0182
+# Exim test configuration 4129
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0184 b/test/confs/4130
similarity index 92%
rename from test/confs/0184
rename to test/confs/4130
index 9e15a4895..a550cf065 100644
--- a/test/confs/0184
+++ b/test/confs/4130
@@ -1,4 +1,4 @@
-# Exim test configuration 0184
+# Exim test configuration 4130
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0185 b/test/confs/4131
similarity index 97%
rename from test/confs/0185
rename to test/confs/4131
index 5062e08ff..e7d3d2227 100644
--- a/test/confs/0185
+++ b/test/confs/4131
@@ -1,4 +1,4 @@
-# Exim test configuration 0185
+# Exim test configuration 4131
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0232 b/test/confs/4132
similarity index 96%
rename from test/confs/0232
rename to test/confs/4132
index 22bb68edf..2345ee58e 100644
--- a/test/confs/0232
+++ b/test/confs/4132
@@ -1,4 +1,4 @@
-# Exim test configuration 0232
+# Exim test configuration 4132
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0233 b/test/confs/4133
similarity index 96%
rename from test/confs/0233
rename to test/confs/4133
index 36d60f642..bef27eccc 100644
--- a/test/confs/0233
+++ b/test/confs/4133
@@ -1,4 +1,4 @@
-# Exim test configuration 0233
+# Exim test configuration 4133
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0241 b/test/confs/4134
similarity index 96%
rename from test/confs/0241
rename to test/confs/4134
index 9e6ded492..777339dab 100644
--- a/test/confs/0241
+++ b/test/confs/4134
@@ -1,4 +1,4 @@
-# Exim test configuration 0241
+# Exim test configuration 4134
 
 exim_path = EXIM_PATH/junk
 keep_environment =
diff --git a/test/confs/0246 b/test/confs/4135
similarity index 95%
rename from test/confs/0246
rename to test/confs/4135
index 257475b87..b4e21e0bc 100644
--- a/test/confs/0246
+++ b/test/confs/4135
@@ -1,4 +1,4 @@
-# Exim test configuration 0246
+# Exim test configuration 4135
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0170 b/test/confs/4136
similarity index 86%
rename from test/confs/0170
rename to test/confs/4136
index 5e25e24d8..078ba20a9 100644
--- a/test/confs/0170
+++ b/test/confs/4136
@@ -1,4 +1,4 @@
-# Exim test configuration 0170
+# Exim test configuration 4136
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0266 b/test/confs/4137
similarity index 97%
copy from test/confs/0266
copy to test/confs/4137
index 2f6cece91..87f2c65cd 100644
--- a/test/confs/0266
+++ b/test/confs/4137
@@ -1,4 +1,4 @@
-# Exim test configuration 0266
+# Exim test configuration 4137
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0270 b/test/confs/4138
similarity index 97%
copy from test/confs/0270
copy to test/confs/4138
index 7dae6d523..3d783574a 100644
--- a/test/confs/0270
+++ b/test/confs/4138
@@ -1,4 +1,4 @@
-# Exim test configuration 0270
+# Exim test configuration 4138
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0296 b/test/confs/4139
similarity index 93%
rename from test/confs/0296
rename to test/confs/4139
index 4ee779f39..e09bc5bd9 100644
--- a/test/confs/0296
+++ b/test/confs/4139
@@ -1,4 +1,4 @@
-# Exim test configuration 0296
+# Exim test configuration 4139
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0297 b/test/confs/4140
similarity index 96%
rename from test/confs/0297
rename to test/confs/4140
index b07fc54cb..7d2fd5d0f 100644
--- a/test/confs/0297
+++ b/test/confs/4140
@@ -1,4 +1,4 @@
-# Exim test configuration 0297
+# Exim test configuration 4140
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0298 b/test/confs/4141
similarity index 93%
rename from test/confs/0298
rename to test/confs/4141
index 546a93bc8..f4a00da18 100644
--- a/test/confs/0298
+++ b/test/confs/4141
@@ -1,4 +1,4 @@
-# Exim test configuration 0298
+# Exim test configuration 4141
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0316 b/test/confs/4142
similarity index 76%
rename from test/confs/0316
rename to test/confs/4142
index 22fea04ca..59894af77 100644
--- a/test/confs/0316
+++ b/test/confs/4142
@@ -1,4 +1,4 @@
-# Exim test configuration 0316
+# Exim test configuration 4142
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0319 b/test/confs/4143
similarity index 95%
rename from test/confs/0319
rename to test/confs/4143
index 791fc9726..a29c6524e 100644
--- a/test/confs/0319
+++ b/test/confs/4143
@@ -1,4 +1,4 @@
-# Exim test configuration 0319
+# Exim test configuration 4143
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0326 b/test/confs/4144
similarity index 95%
rename from test/confs/0326
rename to test/confs/4144
index 107fe96c1..37c6a7221 100644
--- a/test/confs/0326
+++ b/test/confs/4144
@@ -1,4 +1,4 @@
-# Exim test configuration 0326
+# Exim test configuration 4144
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0328 b/test/confs/4145
similarity index 93%
rename from test/confs/0328
rename to test/confs/4145
index ee5ffaf06..bc7365d75 100644
--- a/test/confs/0328
+++ b/test/confs/4145
@@ -1,4 +1,4 @@
-# Exim test configuration 0328
+# Exim test configuration 4145
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0329 b/test/confs/4146
similarity index 93%
rename from test/confs/0329
rename to test/confs/4146
index ce43227f3..b940fceac 100644
--- a/test/confs/0329
+++ b/test/confs/4146
@@ -1,4 +1,4 @@
-# Exim test configuration 0329
+# Exim test configuration 4146
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0346 b/test/confs/4147
similarity index 95%
copy from test/confs/0346
copy to test/confs/4147
index 6e84faa2e..4903f2e03 100644
--- a/test/confs/0346
+++ b/test/confs/4147
@@ -1,4 +1,4 @@
-# Exim test configuration 0346
+# Exim test configuration 4147
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0349 b/test/confs/4148
similarity index 93%
rename from test/confs/0349
rename to test/confs/4148
index f11957d2e..b733e65bf 100644
--- a/test/confs/0349
+++ b/test/confs/4148
@@ -1,4 +1,4 @@
-# Exim test configuration 0349
+# Exim test configuration 4148
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0351 b/test/confs/4149
similarity index 96%
rename from test/confs/0351
rename to test/confs/4149
index b61f52973..a47f84e85 100644
--- a/test/confs/0351
+++ b/test/confs/4149
@@ -1,4 +1,4 @@
-# Exim test configuration 0351
+# Exim test configuration 4149
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0352 b/test/confs/4150
similarity index 92%
rename from test/confs/0352
rename to test/confs/4150
index 7d5d75a0d..00a7ff3b5 100644
--- a/test/confs/0352
+++ b/test/confs/4150
@@ -1,4 +1,4 @@
-# Exim test configuration 0352
+# Exim test configuration 4150
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0372 b/test/confs/4151
similarity index 98%
rename from test/confs/0372
rename to test/confs/4151
index 983d596a1..c5b095fbb 100644
--- a/test/confs/0372
+++ b/test/confs/4151
@@ -1,4 +1,4 @@
-# Exim test configuration 0372
+# Exim test configuration 4151
 
 STRICT=
 
diff --git a/test/confs/0378 b/test/confs/4152
similarity index 97%
rename from test/confs/0378
rename to test/confs/4152
index 3e4d85a81..c103bed4a 100644
--- a/test/confs/0378
+++ b/test/confs/4152
@@ -1,4 +1,4 @@
-# Exim test configuration 0378
+# Exim test configuration 4152
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0382 b/test/confs/4153
similarity index 92%
rename from test/confs/0382
rename to test/confs/4153
index d27b8e3f7..b61538b87 100644
--- a/test/confs/0382
+++ b/test/confs/4153
@@ -1,4 +1,4 @@
-# Exim test configuration 0382
+# Exim test configuration 4153
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0383 b/test/confs/4154
similarity index 95%
rename from test/confs/0383
rename to test/confs/4154
index 4c5bcfbf6..0fa67eae3 100644
--- a/test/confs/0383
+++ b/test/confs/4154
@@ -1,4 +1,4 @@
-# Exim test configuration 0383
+# Exim test configuration 4154
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0404 b/test/confs/4155
similarity index 95%
rename from test/confs/0404
rename to test/confs/4155
index 4093620c3..28126e988 100644
--- a/test/confs/0404
+++ b/test/confs/4155
@@ -1,4 +1,4 @@
-# Exim test configuration 0404
+# Exim test configuration 4155
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0406 b/test/confs/4156
similarity index 81%
rename from test/confs/0406
rename to test/confs/4156
index 1c1ec205f..bbe1175a2 100644
--- a/test/confs/0406
+++ b/test/confs/4156
@@ -1,4 +1,4 @@
-# Exim test configuration 0406
+# Exim test configuration 4156
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0411 b/test/confs/4157
similarity index 95%
rename from test/confs/0411
rename to test/confs/4157
index fa24e9fd0..4a735d7f3 100644
--- a/test/confs/0411
+++ b/test/confs/4157
@@ -1,4 +1,4 @@
-# Exim test configuration 0411
+# Exim test configuration 4157
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0412 b/test/confs/4158
similarity index 95%
rename from test/confs/0412
rename to test/confs/4158
index 5ed0c828f..412268620 100644
--- a/test/confs/0412
+++ b/test/confs/4158
@@ -1,4 +1,4 @@
-# Exim test configuration 0412
+# Exim test configuration 4158
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0421 b/test/confs/4159
similarity index 93%
rename from test/confs/0421
rename to test/confs/4159
index dab74a1af..31bb9b179 100644
--- a/test/confs/0421
+++ b/test/confs/4159
@@ -1,4 +1,4 @@
-# Exim test configuration 0421
+# Exim test configuration 4159
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/4160 b/test/confs/4160
index 019476a48..3d238647b 100644
--- a/test/confs/4160
+++ b/test/confs/4160
@@ -2,20 +2,39 @@
 
 .include DIR/aux-var/std_conf_prefix
 
+primary_hostname = myhost.test.ex
+
 
 # ----- Main settings -----
 
-primary_hostname = mail.test.ex
 qualify_domain = test.ex
 
+system_filter = DIR/aux-fixed/TESTNUM.sysfilter
+system_filter_reply_transport = t2
+system_filter_user = EXIMUSER
+
 # ----- Routers -----
 
 begin routers
 
+r1:
+  driver = accept
+  transport = t1
+
 
 # ----- Transports -----
 
 begin transports
 
+t1:
+  driver = appendfile
+  file = DIR/test-mail/$local_part
+  create_file = DIR/test-mail
+  user = CALLER
+
+t2:
+  driver = autoreply
+  user = CALLER
+
 
 # End
diff --git a/test/confs/4161 b/test/confs/4161
index f24502a83..c81f90bef 100644
--- a/test/confs/4161
+++ b/test/confs/4161
@@ -2,155 +2,28 @@
 
 .include DIR/aux-var/std_conf_prefix
 
+primary_hostname = myhost.test.ex
+
 
 # ----- Main settings -----
 
-primary_hostname = mail.test.ex
 qualify_domain = test.ex
-trusted_users = CALLER
+
 
 # ----- Routers -----
 
 begin routers
 
-rb:
-  driver = accept
-  senders = :
-  transport = t2
-
-r0:
-  driver = redirect
-  local_parts = redirected
-  allow_filter
-  user = CALLER
-  file_transport = t1
-  data = "#Sieve filter\n keep;"
-
 r1:
   driver = redirect
-  local_parts = ^restrict-
-  allow_filter
-  forbid_file
-  skip_syntax_errors
-  data = "#Sieve filter\n$h_filter:"
-  user = CALLER
-  file_transport = t1
-
-r2_8:
-  driver = redirect
-  local_parts = userx8
-  allow_filter
-  data = #Sieve filter\n \
-    require["fileinto","comparator-i;ascii-numeric"]; \
-        if header :comparator "i;ascii-numeric" "X-Sieve" "99" { \
-          fileinto "inbox.JUNK"; \
-          stop; \
-        }
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_9:
-  driver = redirect
-  local_parts = userx9
-  allow_filter
-  data = #Sieve filter\n \
-    require["fileinto","comparator-i;ascii-numeric"]; \
-        if header :comparator "i;ascii-numeric" "X-Sieve" "98" { \
-          fileinto "inbox.JUNK"; \
-          stop; \
-        }
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_10:
-  driver = redirect
-  local_parts = userx10
   allow_filter
-  data = #Sieve filter\n \
-     require["fileinto","comparator-i;ascii-numeric"]; \
-        if header :comparator "i;ascii-numeric" "X-Sieve" "99" { \
-          fileinto "inbox.JUNK"; \
-          stop; \
-        }
+  file = DIR/aux-fixed/TESTNUM.filter-FILTER
+  reply_transport = t2
   user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_11:
-  driver = redirect
-  local_parts = userx11
-  allow_filter
-  data = #Sieve filter\n \
-     require["fileinto","comparator-i;ascii-numeric"]; \
-        if header :comparator "i;ascii-numeric" "X-Sieve" "-99" { \
-          fileinto "inbox.JUNK"; \
-          stop; \
-        }
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_12:
-  driver = redirect
-  local_parts = userx12
-  allow_filter
-  data = #Sieve filter\n \
-     require["fileinto","comparator-i;ascii-numeric"]; \
-        if header :comparator "i;ascii-numeric" "X-Sieve" "-98" { \
-          fileinto "inbox.JUNK"; \
-          stop; \
-        }
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_13:
-  driver = redirect
-  local_parts = userx13 : someone13
-  allow_filter
-  data = #Sieve filter\n \
-     require ["vacation"];  \
-        vacation "I am gone.  Not here.";
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-  sieve_vacation_directory = DIR/test-vacation-directory
-
-r2_14:
-  driver = redirect
-  local_parts = userx14
-  local_part_suffix = -*
-  local_part_suffix_optional
-  allow_filter
-  data = #Sieve filter\n \
-     require ["envelope","fileinto"];  \
-        if envelope :matches :localpart "to" "*-suffix" { \
-          fileinto "userx-sawsuffix"; \
-          stop;  \
-        }   
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
-
-r2_15:
-  driver = redirect
-  local_parts = userx_inbox
-  allow_filter
-  data = "#Sieve filter\nkeep;\n"
-  user = CALLER
-  sieve_inbox = inbox.changed
-  file_transport = t1
 
 r2:
-  driver = redirect
-  allow_filter
-  skip_syntax_errors
-  data = "#Sieve filter\n$h_filter:"
-  user = CALLER
-  file_transport = t1
-  reply_transport = t3
+  driver = accept
+  transport = t1
 
 
 # ----- Transports -----
@@ -158,30 +31,13 @@ r2:
 begin transports
 
 t1:
-  driver = appendfile
-  file = ${if eq{$address_file}{inbox} \
-              {DIR/test-mail/$local_part} \
-              {${if eq{${substr_0_1:$address_file}}{/} \
-                    {$address_file} \
-                    {DIR/test-mail/$address_file} \
-              }} \
-         }
-  create_file = DIR/test-mail
-  delivery_date_add
-  envelope_to_add
-  return_path_add
-  user = CALLER
-
-t2:
   driver = appendfile
   file = DIR/test-mail/$local_part
   create_file = DIR/test-mail
-  delivery_date_add
-  envelope_to_add
-  return_path_add
   user = CALLER
 
-t3:
+t2:
   driver = autoreply
 
+
 # End
diff --git a/test/confs/4162 b/test/confs/4162
index 76045b7ca..9446f3329 100644
--- a/test/confs/4162
+++ b/test/confs/4162
@@ -1,15 +1,17 @@
 # Exim test configuration 4162
 
-ALLOW=allow_filter
-FORBID=
-
 .include DIR/aux-var/std_conf_prefix
 
 primary_hostname = myhost.test.ex
 
+
 # ----- Main settings -----
 
-log_selector = +queue_time_overall
+qualify_domain = test.ex
+
+acl_smtp_rcpt = accept
+log_selector = +address_rewrite
+
 
 # ----- Routers -----
 
@@ -17,16 +19,31 @@ begin routers
 
 r1:
   driver = redirect
-  user = EXIMUSER
-  ALLOW
-  FORBID
-  file = ${lookup {TESTNUM.$local_part} dsearch,ret=full {DIR/aux-fixed} {$value}fail}
+  allow_filter
+  file = DIR/aux-fixed/TESTNUM.filter
+  redirect_router = r2
+  user = CALLER
+
+r2:
+  driver = accept
+  transport = t1
+
+
+# ----- Transports -----
+
+begin transports
+
+t1:
+  driver = appendfile
+  file = /dev/null
+  user = CALLER
+
 
+# ----- Rewrite -----
 
-# ----- Retry -----
+begin rewrite
 
-begin retry
+*@cam   $local_part@???
 
-* *    F,1d,1h
 
 # End
diff --git a/test/confs/4163 b/test/confs/4163
index 3b4f6df79..94d1c9c4c 100644
--- a/test/confs/4163
+++ b/test/confs/4163
@@ -1,58 +1,41 @@
 # Exim test configuration 4163
 
-SERVER=
+FUSER=
 
 .include DIR/aux-var/std_conf_prefix
 
 primary_hostname = myhost.test.ex
-log_selector = +received_recipients +smtp_connection +millisec
-
 
 # ----- Main settings -----
 
-acl_smtp_rcpt = accept
+system_filter = DIR/aux-fixed/TESTNUM.F
+FUSER
+
 
 # ----- Routers -----
 
 begin routers
 
-discard:
-  driver =        redirect
-  domains =        !test.ex
-  data =        :blackhole:
-
-client:
-  driver =        redirect
-  file =        DIR/aux-fixed/TESTNUM.sieve
+r1:
+  driver = redirect
   allow_filter
-  user =        CALLER
-  file_transport =    local_file
-  errors_to =        ""
-
-# ----- Transports -----
+  file = DIR/aux-var/TESTNUM.f
+  user = CALLER
 
-begin transports
-
-local_file:
-  driver =        appendfile
-  file =        DIR/test-mail/${if eq{$address_file}{inbox} {$local_part} {$address_file}}
-  create_file =        DIR/test-mail
-  delivery_date_add
-  envelope_to_add
-  return_path_add
-
-send_to_server:
-  driver = smtp
-  allow_localhost
-  hosts = 127.0.0.1
-  port = PORT_D
+r2:
+  driver = accept
+  transport = t1
 
-# ----- Retry -----
 
+# ----- Transports -----
 
-begin retry
+begin transports
 
-* * F,5d,10s
+t1:
+  driver = appendfile
+  file = DIR/test-mail/$local_part
+  create_file = DIR/test-mail
+  user = CALLER
 
 
 # End
diff --git a/test/confs/0506 b/test/confs/4164
similarity index 92%
rename from test/confs/0506
rename to test/confs/4164
index 29c6a17d1..b29b4a545 100644
--- a/test/confs/0506
+++ b/test/confs/4164
@@ -1,4 +1,4 @@
-# Exim test configuration 0506
+# Exim test configuration 4164
 
 ALLOW=allow_filter
 FORBID=
diff --git a/test/confs/0510 b/test/confs/4165
similarity index 78%
rename from test/confs/0510
rename to test/confs/4165
index c73a1b402..a9e8d696e 100644
--- a/test/confs/0510
+++ b/test/confs/4165
@@ -1,4 +1,4 @@
-# Exim test configuration 0510
+# Exim test configuration 4155
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0616 b/test/confs/4166
similarity index 94%
rename from test/confs/0616
rename to test/confs/4166
index 6fb08b395..2af112f0a 100644
--- a/test/confs/0616
+++ b/test/confs/4166
@@ -1,4 +1,4 @@
-# Exim test configuration 0616
+# Exim test configuration 4166
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/0617 b/test/confs/4167
similarity index 94%
rename from test/confs/0617
rename to test/confs/4167
index 625c7e372..13eff1cdb 100644
--- a/test/confs/0617
+++ b/test/confs/4167
@@ -1,4 +1,4 @@
-# Exim test configuration 0617
+# Exim test configuration 4167
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/4160 b/test/confs/4190
similarity index 100%
copy from test/confs/4160
copy to test/confs/4190
diff --git a/test/confs/4161 b/test/confs/4191
similarity index 100%
copy from test/confs/4161
copy to test/confs/4191
diff --git a/test/confs/4162 b/test/confs/4192
similarity index 100%
copy from test/confs/4162
copy to test/confs/4192
diff --git a/test/confs/4163 b/test/confs/4193
similarity index 100%
copy from test/confs/4163
copy to test/confs/4193
diff --git a/test/confs/5004 b/test/confs/5004
index 75c4eaef9..071a89a28 100644
--- a/test/confs/5004
+++ b/test/confs/5004
@@ -15,8 +15,7 @@ begin routers
 
 r1:
   driver = redirect
-  data = "# Exim filter\nsave DIR/test-mail"
-  allow_filter
+  data = "DIR/test-mail"
   file_transport = t1
   user = CALLER
 
diff --git a/test/confs/5201 b/test/confs/5210
similarity index 95%
rename from test/confs/5201
rename to test/confs/5210
index a94c5b13a..1880a18a6 100644
--- a/test/confs/5201
+++ b/test/confs/5210
@@ -1,4 +1,4 @@
-# Exim test configuration 5201
+# Exim test configuration 5210
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/5202 b/test/confs/5211
similarity index 92%
rename from test/confs/5202
rename to test/confs/5211
index 19855fff3..398566e08 100644
--- a/test/confs/5202
+++ b/test/confs/5211
@@ -1,4 +1,4 @@
-# Exim test configuration 5202
+# Exim test configuration 5211
 
 .include DIR/aux-var/std_conf_prefix
 
diff --git a/test/confs/5701 b/test/confs/5701
index ff050ffb8..eb6239c00 100644
--- a/test/confs/5701
+++ b/test/confs/5701
@@ -16,25 +16,17 @@ begin acl
 
 begin routers
 
-router_filter:
+filter_fail:
   driver = redirect
-  reply_transport = reply
-  local_parts = userx-filter
+  local_parts = userx
   allow_filter
-  data = #Exim filter\n seen mail text "This is an autoreply."
+  allow_fail
   user = EXIMUSER
+  data = :fail: this filter failed
 
-others:
+dump_bounces:
   driver = redirect
+  senders = :
   data = :blackhole:
 
-# ----- Transports -----
-
-begin transports
-
-reply:
-  driver = autoreply
-  to = $reply_address
-  event_action = ${acl {logger}}
-
 # End
diff --git a/test/confs/5702 b/test/confs/5702
index e796406c8..442c42b6f 100644
--- a/test/confs/5702
+++ b/test/confs/5702
@@ -2,43 +2,55 @@
 
 .include DIR/aux-var/std_conf_prefix
 
+
 # ----- Main settings -----
 
+acl_smtp_rcpt = accept
+acl_smtp_data = accept
+
 event_action = ${acl {logger}}
 
+
 # ----- ACL -----
 
 begin acl
 
 .include DIR/aux-fixed/event-logger-acl
 
+conn_deny:
+  accept    !condition =    ${if eq {tcp:connect}{$event_name}}
+  deny        logwrite =    Denying tcp connection
+        message =    deny
+
 # ----- Routers -----
 
 begin routers
 
-route_userx:
+dump_bounces:
   driver = redirect
-  local_parts = userx
-  allow_filter
-  file = DIR/aux-fixed/TESTNUM.filter
-  user = EXIMUSER
-  no_more
+  senders = :
+  data = :blackhole:
 
-route_smtp:
+others:
   driver = manualroute
   route_list = * 127.0.0.1 byname
   self = send
   transport = smtp
+  errors_to = ""
   no_more
 
+
 # ----- Transports -----
 
 begin transports
 
 smtp:
-  driver = smtp
-  port = PORT_S
-  hosts_try_fastopen =    :
-  event_action = ${acl {logger}}
+  driver =    smtp
+  port =    PORT_S
+  event_action = ${acl {conn_deny}}
+
+# ----- Retry -----
+begin retry
+* * F,5d,10s
 
 # End
diff --git a/test/confs/5703 b/test/confs/5703
index becd0050c..8c23baca7 100644
--- a/test/confs/5703
+++ b/test/confs/5703
@@ -1,44 +1,32 @@
 # Exim test configuration 5703
+# Check for event on dns lookup fail
 
 .include DIR/aux-var/std_conf_prefix
 
-# ----- Main settings -----
-
-event_action = ${acl {logger}}
+primary_hostname = myhost.test.ex
 
-# ----- ACL -----
+# ----- Main settings -----
 
-begin acl
+acl_smtp_rcpt = accept verify = helo
 
-.include DIR/aux-fixed/event-logger-acl
+event_action = ${acl {accept logwrite = M <$event_name> <$event_data>}}
 
 # ----- Routers -----
-
 begin routers
-
-route_userx:
-  driver = redirect
-  local_parts = userx
-  allow_filter
-  file = DIR/aux-fixed/TESTNUM.filter
-  user = EXIMUSER
-  no_more
-
-route_smtp:
-  driver = manualroute
-  route_list = * 127.0.0.1 byname
-  self = send
-  transport = smtp
-  no_more
+all:
+  driver = accept
+  transport = all
+  errors_to = ""
 
 # ----- Transports -----
-
 begin transports
-
-smtp:
+all:
   driver = smtp
-  port = PORT_S
-  hosts_try_fastopen =    :
-  event_action = ${acl {logger}}
+  hosts = ${if inlist {$domain} {nonexistent.test.ex} {$value}}
+  event_action = ${acl {accept logwrite = T <$event_name> <$event_data>}}
+
+# ------ Retries ----
+begin retry
+* * F,10m,2d
 
 # End
diff --git a/test/confs/5704 b/test/confs/5704
index a1749442b..17b2bceb7 100644
--- a/test/confs/5704
+++ b/test/confs/5704
@@ -4,8 +4,6 @@
 
 # ----- Main settings -----
 
-system_filter = DIR/aux-fixed/TESTNUM.filter
-
 event_action = ${acl {logger}}
 
 # ----- ACL -----
@@ -18,11 +16,25 @@ begin acl
 
 begin routers
 
-dump_bounces:
+router_filter:
+  driver = redirect
+  reply_transport = reply
+  local_parts = userx-filter
+  allow_filter
+  data = #Exim filter\n seen mail text "This is an autoreply."
+  user = EXIMUSER
+
+others:
   driver = redirect
-  senders = :
   data = :blackhole:
 
 # ----- Transports -----
 
+begin transports
+
+reply:
+  driver = autoreply
+  to = $reply_address
+  event_action = ${acl {logger}}
+
 # End
diff --git a/test/confs/5705 b/test/confs/5705
index 9e9bbadb9..bf2892532 100644
--- a/test/confs/5705
+++ b/test/confs/5705
@@ -16,17 +16,29 @@ begin acl
 
 begin routers
 
-filter_fail:
+route_userx:
   driver = redirect
   local_parts = userx
   allow_filter
-  allow_fail
+  file = DIR/aux-fixed/TESTNUM.filter
   user = EXIMUSER
-  data = :fail: this filter failed
+  no_more
 
-dump_bounces:
-  driver = redirect
-  senders = :
-  data = :blackhole:
+route_smtp:
+  driver = manualroute
+  route_list = * 127.0.0.1 byname
+  self = send
+  transport = smtp
+  no_more
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+  driver = smtp
+  port = PORT_S
+  hosts_try_fastopen =    :
+  event_action = ${acl {logger}}
 
 # End
diff --git a/test/confs/5706 b/test/confs/5706
index e9275314e..3aed33e79 100644
--- a/test/confs/5706
+++ b/test/confs/5706
@@ -16,17 +16,29 @@ begin acl
 
 begin routers
 
-filter_file_fail:
+route_userx:
   driver = redirect
   local_parts = userx
   allow_filter
-  allow_fail
   file = DIR/aux-fixed/TESTNUM.filter
   user = EXIMUSER
+  no_more
 
-dump_bounces:
-  driver = redirect
-  senders = :
-  data = :blackhole:
+route_smtp:
+  driver = manualroute
+  route_list = * 127.0.0.1 byname
+  self = send
+  transport = smtp
+  no_more
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+  driver = smtp
+  port = PORT_S
+  hosts_try_fastopen =    :
+  event_action = ${acl {logger}}
 
 # End
diff --git a/test/confs/5707 b/test/confs/5707
index 35d5eff47..d25a59f8b 100644
--- a/test/confs/5707
+++ b/test/confs/5707
@@ -2,26 +2,18 @@
 
 .include DIR/aux-var/std_conf_prefix
 
-
 # ----- Main settings -----
 
-acl_smtp_rcpt = accept
-acl_smtp_data = accept
+system_filter = DIR/aux-fixed/TESTNUM.filter
 
 event_action = ${acl {logger}}
 
-
 # ----- ACL -----
 
 begin acl
 
 .include DIR/aux-fixed/event-logger-acl
 
-conn_deny:
-  accept    !condition =    ${if eq {tcp:connect}{$event_name}}
-  deny        logwrite =    Denying tcp connection
-        message =    deny
-
 # ----- Routers -----
 
 begin routers
@@ -31,26 +23,6 @@ dump_bounces:
   senders = :
   data = :blackhole:
 
-others:
-  driver = manualroute
-  route_list = * 127.0.0.1 byname
-  self = send
-  transport = smtp
-  errors_to = ""
-  no_more
-
-
 # ----- Transports -----
 
-begin transports
-
-smtp:
-  driver =    smtp
-  port =    PORT_S
-  event_action = ${acl {conn_deny}}
-
-# ----- Retry -----
-begin retry
-* * F,5d,10s
-
 # End
diff --git a/test/confs/5708 b/test/confs/5708
index 4fc0e9b27..029476a8b 100644
--- a/test/confs/5708
+++ b/test/confs/5708
@@ -1,32 +1,32 @@
 # Exim test configuration 5708
-# Check for event on dns lookup fail
 
 .include DIR/aux-var/std_conf_prefix
 
-primary_hostname = myhost.test.ex
-
 # ----- Main settings -----
 
-acl_smtp_rcpt = accept verify = helo
+event_action = ${acl {logger}}
+
+# ----- ACL -----
+
+begin acl
 
-event_action = ${acl {accept logwrite = M <$event_name> <$event_data>}}
+.include DIR/aux-fixed/event-logger-acl
 
 # ----- Routers -----
+
 begin routers
-all:
-  driver = accept
-  transport = all
-  errors_to = ""
-
-# ----- Transports -----
-begin transports
-all:
-  driver = smtp
-  hosts = ${if inlist {$domain} {nonexistent.test.ex} {$value}}
-  event_action = ${acl {accept logwrite = T <$event_name> <$event_data>}}
-
-# ------ Retries ----
-begin retry
-* * F,10m,2d
+
+filter_file_fail:
+  driver = redirect
+  local_parts = userx
+  allow_filter
+  allow_fail
+  file = DIR/aux-fixed/TESTNUM.filter
+  user = EXIMUSER
+
+dump_bounces:
+  driver = redirect
+  senders = :
+  data = :blackhole:
 
 # End
diff --git a/test/log/0015 b/test/log/0015
index df24d5375..d4803f7ad 100644
--- a/test/log/0015
+++ b/test/log/0015
@@ -1,35 +1,6 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx <page+userx@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** |callpager <page+userx@???> R=userforward T=address_pipe: "callpager" command not found for address_pipe transport
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => userx <userx@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => >userx <page+userx@???> R=userforward T=address_reply
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => CALLER <CALLER@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx <page+ux@???> R=localuser T=local_delivery
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 => userx <page+ux@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 ** |callpager (page+userx@???) <page+ux@???> R=userforward T=address_pipe: "callpager" command not found for address_pipe transport
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 <= <> R=10HmbA-000000005vi-0000 U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 => userx <userx@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 => >userx (page+userx@???) <page+ux@???> R=userforward T=address_reply
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 <= <> R=10HmbA-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 => CALLER <CALLER@???> R=localuser T=local_delivery
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 => userx <B+userx@???> R=localuser_b T=local_delivery_b
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 => userx@??? <S+userx@???> R=localuser_s T=delivery_s H=127.0.0.1 [127.0.0.1] C="250 OK"
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 => userx <userx-B@???> R=localuser_sb T=local_delivery_b
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 => userx <X+userx-B@???> R=localuser_sb T=local_delivery_b
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 => userx@??? <Userx-S@???> R=localuser_ss T=delivery_s H=127.0.0.1 [127.0.0.1] C="250 OK"
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => userx@??? <Userx-S@???> R=localuser_ss T=delivery_s H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
diff --git a/test/log/0072 b/test/log/0072
index 89789a459..6f538e53a 100644
--- a/test/log/0072
+++ b/test/log/0072
@@ -31,8 +31,3 @@
 1999-03-02 09:44:33 10HmbH-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmbG-000000005vi-0000 => userx <userx@???> R=reply T=reply
 1999-03-02 09:44:33 10HmbG-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 qualify/rewrite: missing or malformed local part (expected word or "<")
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 ** >**bad-reply** <userx-filter@???> R=filter: filter autoreply generated syntactically invalid recipient
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 >**bad-reply** <userx-filter@???>: error ignored
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 Completed
diff --git a/test/log/0266 b/test/log/0266
index c7f5a44f0..d950f0fee 100644
--- a/test/log/0266
+++ b/test/log/0266
@@ -14,33 +14,12 @@
 1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => list2 <list2@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmbB-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 r2 router: skipped error: unknown filtering command "syntax" near line 3 of filter file
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 r1a router: skipped error: domain missing or malformed in "@@test.ex (This has a syntax error)"
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 <= <> R=10HmbB-000000005vi-0000 U=root P=local S=sss
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 => filter <filter@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 r1a router: skipped error: domain missing or malformed in "@@test.ex (This has a syntax error)"
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 <= <> R=10HmbD-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 ** nmlist@???: syntax error in redirection data
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 <= <> R=10HmbD-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 => CALLER <CALLER@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 ** nmlist@???: syntax error in redirection data
+1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= <> R=10HmbB-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmbD-000000005vi-0000 => CALLER <CALLER@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmbD-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 r2 router: skipped error: malformed address "@@in.valid" in filter file: domain missing or malformed
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 <= <> R=10HmbG-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 => filter2 <filter2@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 r2 router: skipped error: failed to open filter log file "test-private": Permission denied (euid=CALLER_UID egid=CALLER_GID)
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 <= <> R=10HmbI-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 => filter3 <filter3@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
diff --git a/test/log/0270 b/test/log/0270
index c6a6632ec..d950f0fee 100644
--- a/test/log/0270
+++ b/test/log/0270
@@ -14,33 +14,12 @@
 1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => list2 <list2@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmbB-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 r2 router: skipped error: unknown filtering command "syntax" near line 3 of filter file
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 r1a router: skipped error: domain missing or malformed in "@@test.ex (This has a syntax error)"
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 <= <> R=10HmbB-000000005vi-0000 U=root P=local S=sss
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmbC-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 => filter <filter@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 r1a router: skipped error: domain missing or malformed in "@@test.ex (This has a syntax error)"
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 <= <> R=10HmbD-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 ** nmlist@???: syntax error in redirection data
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 <= <> R=10HmbD-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 => CALLER <CALLER@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 ** nmlist@???: syntax error in redirection data
+1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= <> R=10HmbB-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmbD-000000005vi-0000 => CALLER <CALLER@???> R=r3 T=t1
 1999-03-02 09:44:33 10HmbD-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 r2 router: skipped error: malformed address "@@in.valid" in filter file: domain missing or malformed
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 <= <> R=10HmbG-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 => filter2 <filter2@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 r2 router: skipped error: failed to open filter log file "TESTSUITE/test-private": Permission denied (euid=CALLER_UID egid=CALLER_GID)
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 <= <> R=10HmbI-000000005vi-0000 U=root P=local S=sss
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 => postmaster <postmaster@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 => filter3 <filter3@???> R=r3 T=t1
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
diff --git a/test/log/0452 b/test/log/0452
deleted file mode 100644
index 51babde49..000000000
--- a/test/log/0452
+++ /dev/null
@@ -1,14 +0,0 @@
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx <userx@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => CALLER <CALLER@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => >CALLER@??? <userx@???> R=r1 T=t2
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 == userx@??? R=r1 defer (-17): error in filter file: \n not followed by space or valid header name in "h1: the first added header\nh2: the second added header\n continued on another line\nh3 the third added header is missing a colon" in mail command
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 ** userx@???: retry timeout exceeded
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 <= <> R=10HmaZ-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 => CALLER <CALLER@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
diff --git a/test/log/0454 b/test/log/0454
deleted file mode 100644
index af4adcfb6..000000000
--- a/test/log/0454
+++ /dev/null
@@ -1,6 +0,0 @@
-
-******** SERVER ********
-1999-03-02 09:44:33 exim x.yz daemon started: pid=p1234, no queue runs, listening for SMTP on port PORT_D
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= userx@??? H=(rhu.barb) [127.0.0.1] P=smtp S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => xx <userx@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
diff --git a/test/log/0472 b/test/log/0472
deleted file mode 100644
index ccdf3fab0..000000000
--- a/test/log/0472
+++ /dev/null
@@ -1,6 +0,0 @@
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userz99 <userz@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => userz99 <userz@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
diff --git a/test/log/0037 b/test/log/4110
similarity index 100%
rename from test/log/0037
rename to test/log/4110
diff --git a/test/log/0015 b/test/log/4111
similarity index 100%
copy from test/log/0015
copy to test/log/4111
diff --git a/test/log/0016 b/test/log/4112
similarity index 100%
rename from test/log/0016
rename to test/log/4112
diff --git a/test/log/4114 b/test/log/4114
new file mode 100644
index 000000000..bef87b0a6
--- /dev/null
+++ b/test/log/4114
@@ -0,0 +1,5 @@
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 qualify/rewrite: missing or malformed local part (expected word or "<")
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** >**bad-reply** <userx-filter@???> R=filter: filter autoreply generated syntactically invalid recipient
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 >**bad-reply** <userx-filter@???>: error ignored
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
diff --git a/test/log/0074 b/test/log/4115
similarity index 100%
rename from test/log/0074
rename to test/log/4115
diff --git a/test/log/0079 b/test/log/4116
similarity index 100%
rename from test/log/0079
rename to test/log/4116
diff --git a/test/log/0098 b/test/log/4118
similarity index 100%
rename from test/log/0098
rename to test/log/4118
diff --git a/test/log/0114 b/test/log/4119
similarity index 100%
rename from test/log/0114
rename to test/log/4119
diff --git a/test/log/0122 b/test/log/4120
similarity index 100%
rename from test/log/0122
rename to test/log/4120
diff --git a/test/log/0131 b/test/log/4121
similarity index 100%
rename from test/log/0131
rename to test/log/4121
diff --git a/test/log/0136 b/test/log/4122
similarity index 100%
rename from test/log/0136
rename to test/log/4122
diff --git a/test/log/0164 b/test/log/4123
similarity index 100%
rename from test/log/0164
rename to test/log/4123
diff --git a/test/log/0165 b/test/log/4124
similarity index 100%
rename from test/log/0165
rename to test/log/4124
diff --git a/test/log/0168 b/test/log/4125
similarity index 100%
rename from test/log/0168
rename to test/log/4125
diff --git a/test/log/0170 b/test/log/4126
similarity index 100%
rename from test/log/0170
rename to test/log/4126
diff --git a/test/log/0173 b/test/log/4127
similarity index 100%
rename from test/log/0173
rename to test/log/4127
diff --git a/test/log/0177 b/test/log/4128
similarity index 100%
rename from test/log/0177
rename to test/log/4128
diff --git a/test/log/0182 b/test/log/4129
similarity index 100%
rename from test/log/0182
rename to test/log/4129
diff --git a/test/log/0184 b/test/log/4130
similarity index 100%
rename from test/log/0184
rename to test/log/4130
diff --git a/test/log/0185 b/test/log/4131
similarity index 100%
rename from test/log/0185
rename to test/log/4131
diff --git a/test/log/0233 b/test/log/4133
similarity index 100%
rename from test/log/0233
rename to test/log/4133
diff --git a/test/log/0241 b/test/log/4134
similarity index 100%
rename from test/log/0241
rename to test/log/4134
diff --git a/test/log/0246 b/test/log/4135
similarity index 100%
rename from test/log/0246
rename to test/log/4135
diff --git a/test/log/0248 b/test/log/4136
similarity index 100%
rename from test/log/0248
rename to test/log/4136
diff --git a/test/log/0266 b/test/log/4137
similarity index 100%
copy from test/log/0266
copy to test/log/4137
diff --git a/test/log/0270 b/test/log/4138
similarity index 100%
copy from test/log/0270
copy to test/log/4138
diff --git a/test/log/0296 b/test/log/4139
similarity index 100%
rename from test/log/0296
rename to test/log/4139
diff --git a/test/log/0297 b/test/log/4140
similarity index 100%
rename from test/log/0297
rename to test/log/4140
diff --git a/test/log/0298 b/test/log/4141
similarity index 100%
rename from test/log/0298
rename to test/log/4141
diff --git a/test/log/0319 b/test/log/4143
similarity index 100%
rename from test/log/0319
rename to test/log/4143
diff --git a/test/log/0326 b/test/log/4144
similarity index 100%
rename from test/log/0326
rename to test/log/4144
diff --git a/test/log/0328 b/test/log/4145
similarity index 100%
rename from test/log/0328
rename to test/log/4145
diff --git a/test/log/0329 b/test/log/4146
similarity index 100%
rename from test/log/0329
rename to test/log/4146
diff --git a/test/log/0382 b/test/log/4147
similarity index 56%
copy from test/log/0382
copy to test/log/4147
index 218108382..2c39f2d18 100644
--- a/test/log/0382
+++ b/test/log/4147
@@ -1,10 +1,7 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** userx@??? R=r1: forced fail
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** x@dom2: Unrouteable address
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => x <x@dom1> R=r3 T=local_delivery
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 ** CALLER@???: Unrouteable address
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 Frozen (delivery error message)
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 Start queue run: pid=p1234 -qf
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 cancelled by timeout_frozen_after
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 End queue run: pid=p1234 -qf
diff --git a/test/log/0349 b/test/log/4148
similarity index 100%
rename from test/log/0349
rename to test/log/4148
diff --git a/test/log/0351 b/test/log/4149
similarity index 100%
rename from test/log/0351
rename to test/log/4149
diff --git a/test/log/0352 b/test/log/4150
similarity index 100%
rename from test/log/0352
rename to test/log/4150
diff --git a/test/log/0372 b/test/log/4151
similarity index 100%
rename from test/log/0372
rename to test/log/4151
diff --git a/test/log/0378 b/test/log/4152
similarity index 100%
rename from test/log/0378
rename to test/log/4152
diff --git a/test/log/0382 b/test/log/4153
similarity index 100%
rename from test/log/0382
rename to test/log/4153
diff --git a/test/log/0383 b/test/log/4154
similarity index 100%
rename from test/log/0383
rename to test/log/4154
diff --git a/test/log/0404 b/test/log/4155
similarity index 100%
rename from test/log/0404
rename to test/log/4155
diff --git a/test/log/0411 b/test/log/4157
similarity index 100%
rename from test/log/0411
rename to test/log/4157
diff --git a/test/log/0412 b/test/log/4158
similarity index 100%
rename from test/log/0412
rename to test/log/4158
diff --git a/test/log/0421 b/test/log/4159
similarity index 100%
rename from test/log/0421
rename to test/log/4159
diff --git a/test/log/0444 b/test/log/4160
similarity index 100%
rename from test/log/0444
rename to test/log/4160
diff --git a/test/log/4161 b/test/log/4161
index 7d20a6927..51babde49 100644
--- a/test/log/4161
+++ b/test/log/4161
@@ -1,56 +1,14 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => TESTSUITE/test-mail/userx <userx@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => discarded <userx@???> R=r2
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx <userx@???> R=r2 T=t1
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => CALLER <CALLER@???> R=r2 T=t1
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => >CALLER@??? <userx@???> R=r1 T=t2
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => TESTSUITE/test-mail/userx-extra <userx@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 => TESTSUITE/test-mail/redirected (redirected@???) <userx@???> R=r0 T=t1
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 == userx@??? R=r1 defer (-17): error in filter file: \n not followed by space or valid header name in "h1: the first added header\nh2: the second added header\n continued on another line\nh3 the third added header is missing a colon" in mail command
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 ** userx@???: retry timeout exceeded
+1999-03-02 09:44:33 10HmbA-000000005vi-0000 <= <> R=10HmaZ-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmbA-000000005vi-0000 => CALLER <CALLER@???> R=r2 T=t1
 1999-03-02 09:44:33 10HmbA-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 ** save userx-extra <restrict-userx@???> R=r1 T=t1: delivery to file forbidden
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 <= <> R=10HmbB-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 => CALLER <CALLER@???> R=rb T=t2
-1999-03-02 09:44:33 10HmbC-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbB-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 ** save inbox <restrict-userx@???> R=r1 T=t1: delivery to file forbidden
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 <= <> R=10HmbD-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 => CALLER <CALLER@???> R=rb T=t2
-1999-03-02 09:44:33 10HmbE-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbD-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 => TESTSUITE/test-mail/userx <userx@???> R=r2 T=t1
-1999-03-02 09:44:33 10HmbF-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 => TESTSUITE/test-mail/inbox.JUNK <userx8@???> R=r2_8 T=t1
-1999-03-02 09:44:33 10HmbG-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 => TESTSUITE/test-mail/userx9 <userx9@???> R=r2_9 T=t1
-1999-03-02 09:44:33 10HmbH-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 => TESTSUITE/test-mail/inbox.JUNK <userx10@???> R=r2_10 T=t1
-1999-03-02 09:44:33 10HmbI-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 => TESTSUITE/test-mail/inbox.JUNK <userx11@???> R=r2_11 T=t1
-1999-03-02 09:44:33 10HmbJ-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbK-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbK-000000005vi-0000 => TESTSUITE/test-mail/inbox.JUNK <userx12@???> R=r2_12 T=t1
-1999-03-02 09:44:33 10HmbK-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbL-000000005vi-0000 <= someone@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbL-000000005vi-0000 => TESTSUITE/test-mail/userx13 <userx13@???> R=r2_13 T=t1
-1999-03-02 09:44:33 10HmbM-000000005vi-0000 <= <> R=10HmbL-000000005vi-0000 U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbM-000000005vi-0000 => someone <someone@???> R=rb T=t2
-1999-03-02 09:44:33 10HmbM-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbL-000000005vi-0000 => >someone@??? <userx13@???> R=r2_13 T=t3
-1999-03-02 09:44:33 10HmbL-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbN-000000005vi-0000 <= someone@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbN-000000005vi-0000 => TESTSUITE/test-mail/userx14 <userx14-suffix2@???> R=r2_14 T=t1
-1999-03-02 09:44:33 10HmbN-000000005vi-0000 => TESTSUITE/test-mail/userx-sawsuffix <userx14-suffix@???> R=r2_14 T=t1
-1999-03-02 09:44:33 10HmbN-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmbO-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbO-000000005vi-0000 => TESTSUITE/test-mail/inbox.changed <userx_inbox@???> R=r2_15 T=t1
-1999-03-02 09:44:33 10HmbO-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
diff --git a/test/log/4162 b/test/log/4162
index 5d11b2a8d..af4adcfb6 100644
--- a/test/log/4162
+++ b/test/log/4162
@@ -1,10 +1,6 @@
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => discarded <sieve-filter@???> R=r1
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed QT=qqs
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 == sieve-filter@??? R=r1 defer (-17): error in filter file: Sieve filtering not enabled
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => discarded <sieve-filter@???> R=r1
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed QT=qqs
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbA-000000005vi-0000 == sieve-filter@??? R=r1 defer (-17): error in filter file: filtering not enabled
+
+******** SERVER ********
+1999-03-02 09:44:33 exim x.yz daemon started: pid=p1234, no queue runs, listening for SMTP on port PORT_D
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= userx@??? H=(rhu.barb) [127.0.0.1] P=smtp S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => xx <userx@???> R=r2 T=t1
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
diff --git a/test/log/4163 b/test/log/4163
index 0914c99bb..ccdf3fab0 100644
--- a/test/log/4163
+++ b/test/log/4163
@@ -1,17 +1,6 @@
-
-******** SERVER ********
-2017-07-30 18:51:05.712 exim x.yz daemon started: pid=p1234, no queue runs, listening for SMTP on port PORT_D
-2017-07-30 18:51:05.712 SMTP connection from [127.0.0.1] (TCP/IP connection count = 1)
-2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 <= implcit@??? H=(tester) [127.0.0.1] P=smtp S=sss for CALLER@???
-2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 => TESTSUITE/test-mail/CALLER <CALLER@???> R=client T=local_file
-2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 <= discard@??? H=(tester) [127.0.0.1] P=smtp S=sss for CALLER@???
-2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 => discarded <CALLER@???> R=client
-2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 <= identified@??? H=(tester) [127.0.0.1] P=smtp S=sss for CALLER@???
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 => TESTSUITE/test-mail/myfolder <CALLER@???> R=client T=local_file
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 <= redirect@??? H=(tester) [127.0.0.1] P=smtp S=sss for CALLER@???
-2017-07-30 18:51:05.712 SMTP connection from (tester) [127.0.0.1] D=q.qqqs closed by QUIT
-2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 => :blackhole: <fred@some_other_dom.ain> R=discard
-2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userz99 <userz@???> R=r2 T=t1
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => userz99 <userz@???> R=r2 T=t1
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
diff --git a/test/log/0506 b/test/log/4164
similarity index 100%
rename from test/log/0506
rename to test/log/4164
diff --git a/test/log/0616 b/test/log/4166
similarity index 100%
rename from test/log/0616
rename to test/log/4166
diff --git a/test/log/0617 b/test/log/4167
similarity index 100%
rename from test/log/0617
rename to test/log/4167
diff --git a/test/log/4161 b/test/log/4191
similarity index 100%
copy from test/log/4161
copy to test/log/4191
diff --git a/test/log/4162 b/test/log/4192
similarity index 100%
copy from test/log/4162
copy to test/log/4192
diff --git a/test/log/4163 b/test/log/4193
similarity index 100%
copy from test/log/4163
copy to test/log/4193
diff --git a/test/log/5201 b/test/log/5210
similarity index 100%
rename from test/log/5201
rename to test/log/5210
diff --git a/test/log/5202 b/test/log/5211
similarity index 100%
rename from test/log/5202
rename to test/log/5211
diff --git a/test/log/5701 b/test/log/5701
index 657f2f807..bc9939db1 100644
--- a/test/log/5701
+++ b/test/log/5701
@@ -1,21 +1,12 @@
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 qualify/rewrite: missing or malformed local part (expected word or "<")
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** >**bad-reply** <userx-filter@domain1> R=router_filter T=reply: filter autoreply generated syntactically invalid recipient
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <> local_part <>**bad-reply**> domain <> errstr <filter autoreply generated syntactically invalid recipient>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 >**bad-reply** <userx-filter@domain1>: error ignored
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= <> R=10HmaY-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => :blackhole: <userx@domain1> R=others
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaZ-000000005vi-0000 . finished: 10HmaZ-000000005vi-0000
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => >userx@domain1 <userx-filter@domain1> R=router_filter T=reply
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:delivery
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . delivery ip <> port <0> fqdn <> local_part <>userx@domain1> domain <domain1> confirmation <> router <router_filter> transport <reply>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <this filter failed>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** userx@domain1 R=filter_fail: this filter failed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
diff --git a/test/log/5702 b/test/log/5702
index 345083af2..51f3012dd 100644
--- a/test/log/5702
+++ b/test/log/5702
@@ -1,23 +1,4 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 Start queue run: pid=p1234 -qqf
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:connect
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1]:1111
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:connect
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . banner <220 ESMTP>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:ehlo
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . ehlo-resp <250-OK\n250 HELP>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:close
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx@domain1 R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:delivery
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . delivery ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <userx> domain <domain1> confirmation <250 OK> router <route_smtp> transport <smtp>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 usery@domain1 <userx@domain1>: error ignored
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
-1999-03-02 09:44:33 End queue run: pid=p1234 -qqf
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Denying tcp connection
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 H=127.0.0.1 [127.0.0.1] Event requests alternate response
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 == userx@domain1 R=others T=smtp defer (-58)
diff --git a/test/log/5703 b/test/log/5703
index 400c5a02c..def9f94e4 100644
--- a/test/log/5703
+++ b/test/log/5703
@@ -1,37 +1,12 @@
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 Start queue run: pid=p1234 -qqf
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:connect
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1]:1111
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:connect
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . banner <220 ESMTP>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:ehlo
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . ehlo-resp <250-OK\n250 HELP>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:close
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event tcp:connect
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . [127.0.0.1]:1111
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event tcp:close
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:host:defer
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . host deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errno <-18> errstr <Remote host closed connection in response to initial connection> router <route_smtp> transport <smtp>
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:defer
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . message deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errno <-18> errstr <Remote host closed connection in response to initial connection> router <route_smtp> transport <smtp>
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 == CALLER@??? R=route_smtp T=smtp defer (-18) H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 ** CALLER@???: retry timeout exceeded
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:fail:delivery
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errstr <Remote host closed connection in response to initial connection: retry timeout exceeded>
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 CALLER@???: error ignored
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
-1999-03-02 09:44:33 End queue run: pid=p1234 -qqf
+
+******** SERVER ********
+1999-03-02 09:44:33 exim x.yz daemon started: pid=p1234, no queue runs, listening for SMTP on port PORT_D
+1999-03-02 09:44:33 M <dns:fail> <DNS_NOMATCH:nonexistent.test.ex:A>
+1999-03-02 09:44:33 H=(nonexistent.test.ex) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
+1999-03-02 09:44:33 M <dns:fail> <DNS_NOMATCH:rhubarb.test.ex:A>
+1999-03-02 09:44:33 H=(badcname.test.ex) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
+1999-03-02 09:44:33 M <dns:fail> <DNS_AGAIN:test.again.dns:A>
+1999-03-02 09:44:33 H=(test.again.dns) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= a@b H=(localhost) [127.0.0.1] P=smtp S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 T <dns:fail> <DNS_NOMATCH:nonexistent.test.ex:A>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 == bad_a@??? <bad_A@???> R=all T=all defer (-32): failed to lookup IP address for nonexistent.test.ex
diff --git a/test/log/5704 b/test/log/5704
index 4f1aeb870..657f2f807 100644
--- a/test/log/5704
+++ b/test/log/5704
@@ -1,12 +1,21 @@
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 qualify/rewrite: missing or malformed local part (expected word or "<")
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 cancelled by system filter: failed in system filter file
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <failed in system filter file>
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** >**bad-reply** <userx-filter@domain1> R=router_filter T=reply: filter autoreply generated syntactically invalid recipient
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <> local_part <>**bad-reply**> domain <> errstr <filter autoreply generated syntactically invalid recipient>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 >**bad-reply** <userx-filter@domain1>: error ignored
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 <= <> R=10HmaY-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 => :blackhole: <userx@domain1> R=others
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaZ-000000005vi-0000 . finished: 10HmaZ-000000005vi-0000
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => >userx@domain1 <userx-filter@domain1> R=router_filter T=reply
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:delivery
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . delivery ip <> port <0> fqdn <> local_part <>userx@domain1> domain <domain1> confirmation <> router <router_filter> transport <reply>
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
diff --git a/test/log/5705 b/test/log/5705
index bc9939db1..345083af2 100644
--- a/test/log/5705
+++ b/test/log/5705
@@ -1,12 +1,23 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <this filter failed>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** userx@domain1 R=filter_fail: this filter failed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
+1999-03-02 09:44:33 Start queue run: pid=p1234 -qqf
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:connect
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:connect
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . banner <220 ESMTP>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:ehlo
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . ehlo-resp <250-OK\n250 HELP>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:close
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 => userx@domain1 R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:delivery
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . delivery ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <userx> domain <domain1> confirmation <250 OK> router <route_smtp> transport <smtp>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 usery@domain1 <userx@domain1>: error ignored
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
+1999-03-02 09:44:33 End queue run: pid=p1234 -qqf
diff --git a/test/log/5706 b/test/log/5706
index f9d4de14d..400c5a02c 100644
--- a/test/log/5706
+++ b/test/log/5706
@@ -1,12 +1,37 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <failed in filter file>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** userx@domain1 R=filter_file_fail: failed in filter file
+1999-03-02 09:44:33 Start queue run: pid=p1234 -qqf
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:connect
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:connect
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . banner <220 ESMTP>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event smtp:ehlo
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . ehlo-resp <250-OK\n250 HELP>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event tcp:close
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
-1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event tcp:connect
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event tcp:close
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . [127.0.0.1] -> [127.0.0.1]:PORT_S
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:host:defer
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . host deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errno <-18> errstr <Remote host closed connection in response to initial connection> router <route_smtp> transport <smtp>
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:defer
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . message deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errno <-18> errstr <Remote host closed connection in response to initial connection> router <route_smtp> transport <smtp>
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 == CALLER@??? R=route_smtp T=smtp defer (-18) H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 ** CALLER@???: retry timeout exceeded
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . refused by fdqn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errstr <Remote host closed connection in response to initial connection: retry timeout exceeded>
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 CALLER@???: error ignored
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
 1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
+1999-03-02 09:44:33 End queue run: pid=p1234 -qqf
diff --git a/test/log/5707 b/test/log/5707
index 51f3012dd..4f1aeb870 100644
--- a/test/log/5707
+++ b/test/log/5707
@@ -1,4 +1,12 @@
 1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 Denying tcp connection
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 H=127.0.0.1 [127.0.0.1] Event requests alternate response
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 == userx@domain1 R=others T=smtp defer (-58)
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 cancelled by system filter: failed in system filter file
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <failed in system filter file>
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
diff --git a/test/log/5708 b/test/log/5708
index def9f94e4..f9d4de14d 100644
--- a/test/log/5708
+++ b/test/log/5708
@@ -1,12 +1,12 @@
-
-******** SERVER ********
-1999-03-02 09:44:33 exim x.yz daemon started: pid=p1234, no queue runs, listening for SMTP on port PORT_D
-1999-03-02 09:44:33 M <dns:fail> <DNS_NOMATCH:nonexistent.test.ex:A>
-1999-03-02 09:44:33 H=(nonexistent.test.ex) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
-1999-03-02 09:44:33 M <dns:fail> <DNS_NOMATCH:rhubarb.test.ex:A>
-1999-03-02 09:44:33 H=(badcname.test.ex) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
-1999-03-02 09:44:33 M <dns:fail> <DNS_AGAIN:test.again.dns:A>
-1999-03-02 09:44:33 H=(test.again.dns) [127.0.0.1] F=<a@b> rejected RCPT <c@d>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= a@b H=(localhost) [127.0.0.1] P=smtp S=sss
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 T <dns:fail> <DNS_NOMATCH:nonexistent.test.ex:A>
-1999-03-02 09:44:33 10HmaX-000000005vi-0000 == bad_a@??? <bad_A@???> R=all T=all defer (-32): failed to lookup IP address for nonexistent.test.ex
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:fail:internal
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . local_part <userx> domain <domain1> reason <failed in filter file>
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** userx@domain1 R=filter_file_fail: failed in filter file
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@???> R=dump_bounces
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 . finished: 10HmaY-000000005vi-0000
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 event msg:complete
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 . finished: 10HmaX-000000005vi-0000
diff --git a/test/mail/0015.userx b/test/mail/0015.userx
index 00f7ba102..da666841f 100644
--- a/test/mail/0015.userx
+++ b/test/mail/0015.userx
@@ -1,52 +1,13 @@
-From CALLER@??? Tue Mar 02 09:44:33 1999
-Return-path: <CALLER@???>
-Envelope-to: page+userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmaX-000000005vi-0000
-    for page+userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmaX-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: page+
-X-local_part_prefix_v: page
-
-Some message text.
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    id 10HmaY-000000005vi-0000
-    for userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-To: userx@???
-In-Reply-To: <E10HmaX-000000005vi-0000@???>
-References: <E10HmaX-000000005vi-0000@???>
-Auto-Submitted: auto-replied
-Message-Id: <E10HmaY-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: 
-X-local_part_prefix_v: 
-
-callpager -r 108 PAGE:Some message text. 
-
 From CALLER@??? Tue Mar 02 09:44:33 1999
 Return-path: <CALLER@???>
 Envelope-to: page+ux@???
 Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
 Received: from CALLER by the.local.host.name with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbA-000000005vi-0000
+    id 10HmaX-000000005vi-0000
     for page+ux@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbA-000000005vi-0000@???>
+Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 X-local_part: userx
@@ -55,80 +16,3 @@ X-local_part_prefix_v: page
 
 Some more message text.
 
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    id 10HmbB-000000005vi-0000
-    for userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-To: userx@???
-In-Reply-To: <E10HmbA-000000005vi-0000@???>
-References: <E10HmbA-000000005vi-0000@???>
-Auto-Submitted: auto-replied
-Message-Id: <E10HmbB-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: 
-X-local_part_prefix_v: 
-
-callpager -r 108 PAGE:Some more message text. 
-
-MAIL FROM:<CALLER@???>
-RCPT TO:<userx@???>
-DATA
-Return-path: <CALLER@???>
-Envelope-to: B+userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbD-000000005vi-0000
-    for B+userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbD-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: b+
-X-local_part_prefix_v: 
-
-Text.
-.
-MAIL FROM:<CALLER@???>
-RCPT TO:<userx@???>
-DATA
-Return-path: <CALLER@???>
-Envelope-to: userx-B@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbF-000000005vi-0000;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbF-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: 
-X-local_part_prefix_v: 
-
-.
-MAIL FROM:<CALLER@???>
-RCPT TO:<userx@???>
-DATA
-Return-path: <CALLER@???>
-Envelope-to: X+userx-B@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbF-000000005vi-0000;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbF-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-local_part: userx
-X-local_part_prefix: x+
-X-local_part_prefix_v: x
-
-.
diff --git a/test/mail/0266.CALLER b/test/mail/0266.CALLER
index 4b2f83dfb..7ef62da14 100644
--- a/test/mail/0266.CALLER
+++ b/test/mail/0266.CALLER
@@ -2,18 +2,18 @@ From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 Return-path: <>
 Envelope-to: CALLER@???
 Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
-    id 10HmbF-000000005vi-0000
+    id 10HmbD-000000005vi-0000
     for CALLER@???;
     Tue, 2 Mar 1999 09:44:33 +0000
 X-Failed-Recipients: nmlist@???
 Auto-Submitted: auto-replied
 From: Mail Delivery System <Mailer-Daemon@???>
 To: CALLER@???
-References: <E10HmbD-000000005vi-0000@???>
+References: <E10HmbB-000000005vi-0000@???>
 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: <E10HmbF-000000005vi-0000@???>
+Message-Id: <E10HmbD-000000005vi-0000@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
@@ -41,10 +41,10 @@ Content-type: message/rfc822
 Return-path: <CALLER@???>
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbD-000000005vi-0000
+    id 10HmbB-000000005vi-0000
     for nmlist@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbD-000000005vi-0000@???>
+Message-Id: <E10HmbB-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
diff --git a/test/mail/0266.postmaster b/test/mail/0266.postmaster
index 384878557..52addaebe 100644
--- a/test/mail/0266.postmaster
+++ b/test/mail/0266.postmaster
@@ -57,30 +57,6 @@ Message-Id: <E10HmbC-000000005vi-0000@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
 References: <E10HmbB-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  unknown filtering command "syntax" near line 3 of filter file
-
-No valid addresses were generated.
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbE-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbE-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbD-000000005vi-0000@???>
 The r1a router encountered the following error(s):
 
   domain missing or malformed in the address
@@ -88,51 +64,3 @@ The r1a router encountered the following error(s):
 
 No valid addresses were generated.
 
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbH-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbH-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbG-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  malformed address "@@in.valid" in filter file: domain missing or malformed
-
-No valid addresses were generated.
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbJ-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbJ-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbI-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  failed to open filter log file "test-private": Permission denied (euid=CALLER_UID egid=CALLER_GID)
-
-No valid addresses were generated.
-
diff --git a/test/mail/0270.CALLER b/test/mail/0270.CALLER
index 4b2f83dfb..7ef62da14 100644
--- a/test/mail/0270.CALLER
+++ b/test/mail/0270.CALLER
@@ -2,18 +2,18 @@ From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 Return-path: <>
 Envelope-to: CALLER@???
 Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
-    id 10HmbF-000000005vi-0000
+    id 10HmbD-000000005vi-0000
     for CALLER@???;
     Tue, 2 Mar 1999 09:44:33 +0000
 X-Failed-Recipients: nmlist@???
 Auto-Submitted: auto-replied
 From: Mail Delivery System <Mailer-Daemon@???>
 To: CALLER@???
-References: <E10HmbD-000000005vi-0000@???>
+References: <E10HmbB-000000005vi-0000@???>
 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: <E10HmbF-000000005vi-0000@???>
+Message-Id: <E10HmbD-000000005vi-0000@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
@@ -41,10 +41,10 @@ Content-type: message/rfc822
 Return-path: <CALLER@???>
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbD-000000005vi-0000
+    id 10HmbB-000000005vi-0000
     for nmlist@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbD-000000005vi-0000@???>
+Message-Id: <E10HmbB-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
diff --git a/test/mail/0270.postmaster b/test/mail/0270.postmaster
index d50a9971e..52addaebe 100644
--- a/test/mail/0270.postmaster
+++ b/test/mail/0270.postmaster
@@ -57,30 +57,6 @@ Message-Id: <E10HmbC-000000005vi-0000@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
 References: <E10HmbB-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  unknown filtering command "syntax" near line 3 of filter file
-
-No valid addresses were generated.
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbE-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbE-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbD-000000005vi-0000@???>
 The r1a router encountered the following error(s):
 
   domain missing or malformed in the address
@@ -88,51 +64,3 @@ The r1a router encountered the following error(s):
 
 No valid addresses were generated.
 
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbH-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbH-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbG-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  malformed address "@@in.valid" in filter file: domain missing or malformed
-
-No valid addresses were generated.
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: postmaster@???
-Received: from root by myhost.test.ex with local (Exim x.yz)
-    id 10HmbJ-000000005vi-0000
-    for postmaster@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: postmaster@???
-Subject: error(s) in forwarding or filtering
-Message-Id: <E10HmbJ-000000005vi-0000@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-References: <E10HmbI-000000005vi-0000@???>
-There's an error in your filter file.
-The file has been ignored.
-
-The r2 router encountered the following error(s):
-
-  failed to open filter log file "TESTSUITE/test-private": Permission denied (euid=CALLER_UID egid=CALLER_GID)
-
-No valid addresses were generated.
-
diff --git a/test/mail/0452.CALLER b/test/mail/0452.CALLER
deleted file mode 100644
index 0a5899bfb..000000000
--- a/test/mail/0452.CALLER
+++ /dev/null
@@ -1,74 +0,0 @@
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Received: from CALLER by myhost.test.ex with local (Exim x.yz)
-    id 10HmaY-000000005vi-0000
-    for CALLER@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-To: CALLER@???
-Subject: Auto generated
-In-Reply-To: <E10HmaX-000000005vi-0000@???>
-References: <E10HmaX-000000005vi-0000@???>
-Auto-Submitted: auto-replied
-h1: the first added header
-h2: the second added header
- continued on another line
-h3: the third added header
-Message-Id: <E10HmaY-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-This is some body text
-
-From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
-    id 10HmbA-000000005vi-0000
-    for CALLER@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-X-Failed-Recipients: userx@???
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
-To: CALLER@???
-References: <E10HmaZ-000000005vi-0000@???>
-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-000000005vi-0000@???>
-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:
-
-  userx@???
-    retry timeout exceeded
-
---NNNNNNNNNN-eximdsn-MMMMMMMMMM
-Content-type: message/delivery-status
-
-Reporting-MTA: dns; myhost.test.ex
-
-Action: failed
-Final-Recipient: rfc822;userx@???
-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-000000005vi-0000
-    for userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-fno: 2
-Message-Id: <E10HmaZ-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-Another message 
-
---NNNNNNNNNN-eximdsn-MMMMMMMMMM--
-
diff --git a/test/mail/0037..vacation.log b/test/mail/4110..vacation.log
similarity index 100%
rename from test/mail/0037..vacation.log
rename to test/mail/4110..vacation.log
diff --git a/test/mail/0037.CALLER b/test/mail/4110.CALLER
similarity index 100%
rename from test/mail/0037.CALLER
rename to test/mail/4110.CALLER
diff --git a/test/mail/0037.dff b/test/mail/4110.dff
similarity index 100%
rename from test/mail/0037.dff
rename to test/mail/4110.dff
diff --git a/test/mail/0037.postmaster b/test/mail/4110.postmaster
similarity index 100%
rename from test/mail/0037.postmaster
rename to test/mail/4110.postmaster
diff --git a/test/mail/0037.userx b/test/mail/4110.userx
similarity index 100%
rename from test/mail/0037.userx
rename to test/mail/4110.userx
diff --git a/test/mail/0037.userz b/test/mail/4110.userz
similarity index 100%
rename from test/mail/0037.userz
rename to test/mail/4110.userz
diff --git a/test/mail/0015.CALLER b/test/mail/4111.CALLER
similarity index 100%
rename from test/mail/0015.CALLER
rename to test/mail/4111.CALLER
diff --git a/test/mail/0015.userx b/test/mail/4111.userx
similarity index 100%
copy from test/mail/0015.userx
copy to test/mail/4111.userx
diff --git a/test/mail/0016.userx b/test/mail/4112.userx
similarity index 100%
rename from test/mail/0016.userx
rename to test/mail/4112.userx
diff --git a/test/mail/0074.CALLER b/test/mail/4115.CALLER
similarity index 100%
rename from test/mail/0074.CALLER
rename to test/mail/4115.CALLER
diff --git a/test/mail/0074.userx b/test/mail/4115.userx
similarity index 100%
rename from test/mail/0074.userx
rename to test/mail/4115.userx
diff --git a/test/mail/0079.rbl b/test/mail/4116.rbl
similarity index 100%
rename from test/mail/0079.rbl
rename to test/mail/4116.rbl
diff --git a/test/mail/0079.userx b/test/mail/4116.userx
similarity index 100%
rename from test/mail/0079.userx
rename to test/mail/4116.userx
diff --git a/test/mail/0098.CALLER b/test/mail/4118.CALLER
similarity index 100%
rename from test/mail/0098.CALLER
rename to test/mail/4118.CALLER
diff --git a/test/mail/0114.file b/test/mail/4119.file
similarity index 100%
rename from test/mail/0114.file
rename to test/mail/4119.file
diff --git a/test/mail/0114.pipe b/test/mail/4119.pipe
similarity index 100%
rename from test/mail/0114.pipe
rename to test/mail/4119.pipe
diff --git a/test/mail/0131.copy b/test/mail/4121.copy
similarity index 100%
rename from test/mail/0131.copy
rename to test/mail/4121.copy
diff --git a/test/mail/0131.userx b/test/mail/4121.userx
similarity index 100%
rename from test/mail/0131.userx
rename to test/mail/4121.userx
diff --git a/test/mail/0136.forwarder b/test/mail/4122.forwarder
similarity index 100%
rename from test/mail/0136.forwarder
rename to test/mail/4122.forwarder
diff --git a/test/mail/0164.CALLER b/test/mail/4123.CALLER
similarity index 100%
rename from test/mail/0164.CALLER
rename to test/mail/4123.CALLER
diff --git a/test/mail/0165.CALLER b/test/mail/4124.CALLER
similarity index 100%
rename from test/mail/0165.CALLER
rename to test/mail/4124.CALLER
diff --git a/test/mail/0173.userx b/test/mail/4127.userx
similarity index 100%
rename from test/mail/0173.userx
rename to test/mail/4127.userx
diff --git a/test/mail/0173.usery b/test/mail/4127.usery
similarity index 100%
rename from test/mail/0173.usery
rename to test/mail/4127.usery
diff --git a/test/mail/0173.userz b/test/mail/4127.userz
similarity index 100%
rename from test/mail/0173.userz
rename to test/mail/4127.userz
diff --git a/test/mail/0177.CALLER b/test/mail/4128.CALLER
similarity index 100%
rename from test/mail/0177.CALLER
rename to test/mail/4128.CALLER
diff --git a/test/mail/0177.userx b/test/mail/4128.userx
similarity index 100%
rename from test/mail/0177.userx
rename to test/mail/4128.userx
diff --git a/test/mail/0177.usery b/test/mail/4128.usery
similarity index 100%
rename from test/mail/0177.usery
rename to test/mail/4128.usery
diff --git a/test/mail/0182.userx b/test/mail/4129.userx
similarity index 100%
rename from test/mail/0182.userx
rename to test/mail/4129.userx
diff --git a/test/mail/0233.me b/test/mail/4133.me
similarity index 100%
rename from test/mail/0233.me
rename to test/mail/4133.me
diff --git a/test/mail/0233.postmaster b/test/mail/4133.postmaster
similarity index 100%
rename from test/mail/0233.postmaster
rename to test/mail/4133.postmaster
diff --git a/test/mail/0241.userx b/test/mail/4134.userx
similarity index 100%
copy from test/mail/0241.userx
copy to test/mail/4134.userx
diff --git a/test/mail/0246.CALLER b/test/mail/4135.CALLER
similarity index 100%
rename from test/mail/0246.CALLER
rename to test/mail/4135.CALLER
diff --git a/test/mail/0266.CALLER b/test/mail/4137.CALLER
similarity index 100%
copy from test/mail/0266.CALLER
copy to test/mail/4137.CALLER
diff --git a/test/mail/0266.filter b/test/mail/4137.filter
similarity index 100%
copy from test/mail/0266.filter
copy to test/mail/4137.filter
diff --git a/test/mail/0266.filter2 b/test/mail/4137.filter2
similarity index 100%
rename from test/mail/0266.filter2
rename to test/mail/4137.filter2
diff --git a/test/mail/0266.filter3 b/test/mail/4137.filter3
similarity index 100%
rename from test/mail/0266.filter3
rename to test/mail/4137.filter3
diff --git a/test/mail/0266.filter b/test/mail/4137.list2
similarity index 65%
copy from test/mail/0266.filter
copy to test/mail/4137.list2
index 8d687edaf..efc5b1148 100644
--- a/test/mail/0266.filter
+++ b/test/mail/4137.list2
@@ -1,13 +1,14 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
 Return-path: <CALLER@???>
-Envelope-to: filter@???
+Envelope-to: list2@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbB-000000005vi-0000
-    for filter@???;
+    id 10HmaZ-000000005vi-0000
+    for list2@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbB-000000005vi-0000@???>
+Message-Id: <E10HmaZ-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
+Message to list2.
 
diff --git a/test/mail/0266.postmaster b/test/mail/4137.postmaster
similarity index 100%
copy from test/mail/0266.postmaster
copy to test/mail/4137.postmaster
diff --git a/test/mail/0452.userx b/test/mail/4137.spqr
similarity index 81%
rename from test/mail/0452.userx
rename to test/mail/4137.spqr
index bc2d894ed..d399b86a5 100644
--- a/test/mail/0452.userx
+++ b/test/mail/4137.spqr
@@ -1,13 +1,13 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
+Return-path: <CALLER@???>
+Envelope-to: list@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
-    for userx@???;
+    for list@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-fno: 1
 Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-This is a message.
 
diff --git a/test/mail/0328.userx b/test/mail/4137.userx
similarity index 81%
copy from test/mail/0328.userx
copy to test/mail/4137.userx
index 08659d500..d399b86a5 100644
--- a/test/mail/0328.userx
+++ b/test/mail/4137.userx
@@ -1,12 +1,13 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
+Return-path: <CALLER@???>
+Envelope-to: list@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
-    for userx@???;
+    for list@???;
     Tue, 2 Mar 1999 09:44:33 +0000
 Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
-added: this header is added
 
 
diff --git a/test/mail/0266.CALLER b/test/mail/4138.CALLER
similarity index 100%
copy from test/mail/0266.CALLER
copy to test/mail/4138.CALLER
diff --git a/test/mail/0270.filter b/test/mail/4138.filter
similarity index 100%
rename from test/mail/0270.filter
rename to test/mail/4138.filter
diff --git a/test/mail/0270.filter2 b/test/mail/4138.filter2
similarity index 100%
rename from test/mail/0270.filter2
rename to test/mail/4138.filter2
diff --git a/test/mail/0270.filter3 b/test/mail/4138.filter3
similarity index 100%
rename from test/mail/0270.filter3
rename to test/mail/4138.filter3
diff --git a/test/mail/0266.filter b/test/mail/4138.list2
similarity index 65%
rename from test/mail/0266.filter
rename to test/mail/4138.list2
index 8d687edaf..efc5b1148 100644
--- a/test/mail/0266.filter
+++ b/test/mail/4138.list2
@@ -1,13 +1,14 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
 Return-path: <CALLER@???>
-Envelope-to: filter@???
+Envelope-to: list2@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbB-000000005vi-0000
-    for filter@???;
+    id 10HmaZ-000000005vi-0000
+    for list2@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbB-000000005vi-0000@???>
+Message-Id: <E10HmaZ-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
+Message to list2.
 
diff --git a/test/mail/0270.postmaster b/test/mail/4138.postmaster
similarity index 100%
copy from test/mail/0270.postmaster
copy to test/mail/4138.postmaster
diff --git a/test/mail/0328.userx b/test/mail/4138.spqr
similarity index 81%
copy from test/mail/0328.userx
copy to test/mail/4138.spqr
index 08659d500..d399b86a5 100644
--- a/test/mail/0328.userx
+++ b/test/mail/4138.spqr
@@ -1,12 +1,13 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
+Return-path: <CALLER@???>
+Envelope-to: list@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
-    for userx@???;
+    for list@???;
     Tue, 2 Mar 1999 09:44:33 +0000
 Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
-added: this header is added
 
 
diff --git a/test/mail/0328.userx b/test/mail/4138.userx
similarity index 81%
copy from test/mail/0328.userx
copy to test/mail/4138.userx
index 08659d500..d399b86a5 100644
--- a/test/mail/0328.userx
+++ b/test/mail/4138.userx
@@ -1,12 +1,13 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
+Return-path: <CALLER@???>
+Envelope-to: list@???
 Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
-    for userx@???;
+    for list@???;
     Tue, 2 Mar 1999 09:44:33 +0000
 Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
-added: this header is added
 
 
diff --git a/test/mail/0296.CALLER b/test/mail/4139.CALLER
similarity index 100%
rename from test/mail/0296.CALLER
rename to test/mail/4139.CALLER
diff --git a/test/mail/0298.CALLER b/test/mail/4141.CALLER
similarity index 100%
rename from test/mail/0298.CALLER
rename to test/mail/4141.CALLER
diff --git a/test/mail/0319.saved b/test/mail/4143.saved
similarity index 100%
rename from test/mail/0319.saved
rename to test/mail/4143.saved
diff --git a/test/mail/0326.userx b/test/mail/4144.userx
similarity index 100%
rename from test/mail/0326.userx
rename to test/mail/4144.userx
diff --git a/test/mail/0328.userx b/test/mail/4145.userx
similarity index 100%
rename from test/mail/0328.userx
rename to test/mail/4145.userx
diff --git a/test/mail/0329.userx b/test/mail/4146.userx
similarity index 100%
rename from test/mail/0329.userx
rename to test/mail/4146.userx
diff --git a/test/mail/0241.userx b/test/mail/4147.x
similarity index 84%
rename from test/mail/0241.userx
rename to test/mail/4147.x
index f396a20c8..0b5c2f9b4 100644
--- a/test/mail/0241.userx
+++ b/test/mail/4147.x
@@ -1,8 +1,9 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
+Envelope-to: x@dom1,
+ x@dom2
 Received: from CALLER by the.local.host.name with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmaX-000000005vi-0000
-    for userx@???;
+    id 10HmaX-000000005vi-0000;
     Tue, 2 Mar 1999 09:44:33 +0000
 Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
diff --git a/test/mail/0349.xxxx b/test/mail/4148.xxxx
similarity index 100%
rename from test/mail/0349.xxxx
rename to test/mail/4148.xxxx
diff --git a/test/mail/0351.userx b/test/mail/4149.userx
similarity index 100%
rename from test/mail/0351.userx
rename to test/mail/4149.userx
diff --git a/test/mail/0352.userx b/test/mail/4150.userx
similarity index 100%
rename from test/mail/0352.userx
rename to test/mail/4150.userx
diff --git a/test/mail/0378.file b/test/mail/4152.file
similarity index 100%
rename from test/mail/0378.file
rename to test/mail/4152.file
diff --git a/test/mail/0383.CALLER b/test/mail/4154.CALLER
similarity index 100%
rename from test/mail/0383.CALLER
rename to test/mail/4154.CALLER
diff --git a/test/mail/0404.sender b/test/mail/4155.sender
similarity index 100%
rename from test/mail/0404.sender
rename to test/mail/4155.sender
diff --git a/test/mail/0411.afolder b/test/mail/4157.afolder
similarity index 100%
rename from test/mail/0411.afolder
rename to test/mail/4157.afolder
diff --git a/test/mail/0412.CALLER b/test/mail/4158.CALLER
similarity index 100%
rename from test/mail/0412.CALLER
rename to test/mail/4158.CALLER
diff --git a/test/mail/0421.a b/test/mail/4159.a
similarity index 100%
rename from test/mail/0421.a
rename to test/mail/4159.a
diff --git a/test/mail/0444.CALLER b/test/mail/4160.CALLER
similarity index 100%
rename from test/mail/0444.CALLER
rename to test/mail/4160.CALLER
diff --git a/test/mail/0444.userx b/test/mail/4160.userx
similarity index 100%
rename from test/mail/0444.userx
rename to test/mail/4160.userx
diff --git a/test/mail/4161.CALLER b/test/mail/4161.CALLER
index 50d4a66cd..0a5899bfb 100644
--- a/test/mail/4161.CALLER
+++ b/test/mail/4161.CALLER
@@ -1,77 +1,37 @@
 From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: CALLER@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from EXIMUSER by mail.test.ex with local (Exim x.yz)
-    id 10HmbC-000000005vi-0000
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    id 10HmaY-000000005vi-0000
     for CALLER@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-X-Failed-Recipients: restrict-userx@???
-Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
 To: CALLER@???
-References: <E10HmbB-000000005vi-0000@???>
-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: <E10HmbC-000000005vi-0000@???>
-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:
-
-  save to userx-extra
-    generated by restrict-userx@???
-
---NNNNNNNNNN-eximdsn-MMMMMMMMMM
-Content-type: message/delivery-status
-
-Reporting-MTA: dns; mail.test.ex
-
-Action: failed
-Final-Recipient: rfc822;restrict-userx@???
-Status: 5.0.0
-
---NNNNNNNNNN-eximdsn-MMMMMMMMMM
-Content-type: message/rfc822
-
-Return-path: <CALLER@???>
-Received: from CALLER by mail.test.ex with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbB-000000005vi-0000
-    for restrict-userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Filter: require "fileinto"; fileinto "userx-extra";
-Message-Id: <E10HmbB-000000005vi-0000@???>
+Subject: Auto generated
+In-Reply-To: <E10HmaX-000000005vi-0000@???>
+References: <E10HmaX-000000005vi-0000@???>
+Auto-Submitted: auto-replied
+h1: the first added header
+h2: the second added header
+ continued on another line
+h3: the third added header
+Message-Id: <E10HmaY-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Test 5
-
---NNNNNNNNNN-eximdsn-MMMMMMMMMM--
+This is some body text
 
 From MAILER-DAEMON Tue Mar 02 09:44:33 1999
-Return-path: <>
-Envelope-to: CALLER@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from EXIMUSER by mail.test.ex with local (Exim x.yz)
-    id 10HmbE-000000005vi-0000
+Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz)
+    id 10HmbA-000000005vi-0000
     for CALLER@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-X-Failed-Recipients: restrict-userx@???
+X-Failed-Recipients: userx@???
 Auto-Submitted: auto-replied
 From: Mail Delivery System <Mailer-Daemon@???>
 To: CALLER@???
-References: <E10HmbD-000000005vi-0000@???>
+References: <E10HmaZ-000000005vi-0000@???>
 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: <E10HmbE-000000005vi-0000@???>
+Message-Id: <E10HmbA-000000005vi-0000@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
@@ -82,33 +42,33 @@ 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:
 
-  save to inbox
-    generated by restrict-userx@???
+  userx@???
+    retry timeout exceeded
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
 Content-type: message/delivery-status
 
-Reporting-MTA: dns; mail.test.ex
+Reporting-MTA: dns; myhost.test.ex
 
 Action: failed
-Final-Recipient: rfc822;restrict-userx@???
+Final-Recipient: rfc822;userx@???
 Status: 5.0.0
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
 Content-type: message/rfc822
 
 Return-path: <CALLER@???>
-Received: from CALLER by mail.test.ex with local (Exim x.yz)
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbD-000000005vi-0000
-    for restrict-userx@???;
+    id 10HmaZ-000000005vi-0000
+    for userx@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Filter: fileinto "userx-extra";
-Message-Id: <E10HmbD-000000005vi-0000@???>
+fno: 2
+Message-Id: <E10HmaZ-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Test 6
+Another message 
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM--
 
diff --git a/test/mail/4161.userx b/test/mail/4161.userx
index c6882cd56..bc2d894ed 100644
--- a/test/mail/4161.userx
+++ b/test/mail/4161.userx
@@ -1,31 +1,13 @@
 From CALLER@??? Tue Mar 02 09:44:33 1999
-Return-path: <CALLER@???>
-Envelope-to: userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by mail.test.ex with local (Exim x.yz)
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
     for userx@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmaX-000000005vi-0000@???>
+fno: 1
+Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Test 1
-
-From CALLER@??? Tue Mar 02 09:44:33 1999
-Return-path: <CALLER@???>
-Envelope-to: userx@???
-Delivery-date: Tue, 2 Mar 1999 09:44:33 +0000
-Received: from CALLER by mail.test.ex with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbF-000000005vi-0000
-    for userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Filter: if true { stop; fileinto "inbox.never"; }
-Message-Id: <E10HmbF-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-Test 7
+This is a message.
 
diff --git a/test/mail/0472.userz99 b/test/mail/4163.userz99
similarity index 100%
rename from test/mail/0472.userz99
rename to test/mail/4163.userz99
diff --git a/test/mail/4161.CALLER b/test/mail/4191.CALLER
similarity index 100%
copy from test/mail/4161.CALLER
copy to test/mail/4191.CALLER
diff --git a/test/mail/4161.inbox.JUNK b/test/mail/4191.inbox.JUNK
similarity index 100%
rename from test/mail/4161.inbox.JUNK
rename to test/mail/4191.inbox.JUNK
diff --git a/test/mail/4161.inbox.changed b/test/mail/4191.inbox.changed
similarity index 100%
rename from test/mail/4161.inbox.changed
rename to test/mail/4191.inbox.changed
diff --git a/test/mail/4161.redirected b/test/mail/4191.redirected
similarity index 100%
rename from test/mail/4161.redirected
rename to test/mail/4191.redirected
diff --git a/test/mail/4161.someone b/test/mail/4191.someone
similarity index 100%
rename from test/mail/4161.someone
rename to test/mail/4191.someone
diff --git a/test/mail/4161.userx b/test/mail/4191.userx
similarity index 100%
copy from test/mail/4161.userx
copy to test/mail/4191.userx
diff --git a/test/mail/4161.userx-extra b/test/mail/4191.userx-extra
similarity index 100%
rename from test/mail/4161.userx-extra
rename to test/mail/4191.userx-extra
diff --git a/test/mail/4161.userx-sawsuffix b/test/mail/4191.userx-sawsuffix
similarity index 100%
rename from test/mail/4161.userx-sawsuffix
rename to test/mail/4191.userx-sawsuffix
diff --git a/test/mail/4161.userx13 b/test/mail/4191.userx13
similarity index 100%
rename from test/mail/4161.userx13
rename to test/mail/4191.userx13
diff --git a/test/mail/4161.userx14 b/test/mail/4191.userx14
similarity index 100%
rename from test/mail/4161.userx14
rename to test/mail/4191.userx14
diff --git a/test/mail/4161.userx9 b/test/mail/4191.userx9
similarity index 100%
rename from test/mail/4161.userx9
rename to test/mail/4191.userx9
diff --git a/test/mail/4163.CALLER b/test/mail/4193.CALLER
similarity index 100%
rename from test/mail/4163.CALLER
rename to test/mail/4193.CALLER
diff --git a/test/mail/4163.myfolder b/test/mail/4193.myfolder
similarity index 100%
rename from test/mail/4163.myfolder
rename to test/mail/4193.myfolder
diff --git a/test/maint/cp_testcase b/test/maint/cp_testcase
new file mode 100755
index 000000000..e2d90f8a0
--- /dev/null
+++ b/test/maint/cp_testcase
@@ -0,0 +1,45 @@
+#! /bin/sh
+#
+# cp_testcase <src_num> <dest_scripts_dir> <dest_num>
+# Run using the test/ dir as current-working-directory.
+# Include leading zeroes in the testcase numbers.
+
+srcnum="${1:?missing src testcase number}"
+dstdir="${2:?missing dest scripts dir}"
+dstnum="${3:? missing dest testcase number}"
+
+if [ -f confs/$dstnum -o -f scripts/*/$dstnum ]
+then
+  echo "testcase $dstnun already exists?" >&2
+  exit 1
+fi
+
+set -x
+cp scripts/*/$srcnum $dstdir/$dstnum
+git add $dstdir/$dstnum
+
+for d in confs log rejectlog paniclog stdin stderr
+do
+  if [ -f "$d/$srcnum" ]
+  then
+    cp "$d/$srcnum" "$d/$dstnum"
+    git add "$d/$dstnum"
+  fi
+done
+
+for d in mail aux-fixed aux-var-src
+do
+  cd $d
+  for f in $srcnum*
+  do
+    if [ -f "$f" ]
+      then
+      suff=${f#$srcnum}
+      cp $f ${dstnum}${suff}
+      git add ${dstnum}${suff}
+      fi
+  done
+  cd ..
+done
+
+rm -f aux-var/$srcnum*
diff --git a/test/maint/mv_testcase b/test/maint/mv_testcase
new file mode 100755
index 000000000..e7b0dc3fe
--- /dev/null
+++ b/test/maint/mv_testcase
@@ -0,0 +1,39 @@
+#! /bin/sh
+#
+# mv_testcase <src_num> <dest_scripts_dir> <dest_num>
+# Run using the test/ dir as current-working-directory.
+# Include leading zeroes in the testcase numbers.
+
+srcnum="${1:?missing src testcase number}"
+dstdir="${2:?missing dest scripts dir}"
+dstnum="${3:? missing dest testcase number}"
+
+if [ -f confs/$dstnum -o -f scripts/*/$dstnum ]
+then
+  echo "testcase $dstnun already exists?" >&2
+  exit 1
+fi
+
+set -x
+git mv scripts/*/$srcnum $dstdir/$dstnum
+
+for d in confs log rejectlog paniclog stdin stderr
+do
+  [ -f "$d/$srcnum" ] && git mv "$d/$srcnum" "$d/$dstnum"
+done
+
+for d in mail aux-fixed aux-var-src
+do
+  cd $d
+  for f in $srcnum*
+  do
+    if [ -f "$f" ]
+      then
+      suff=${f#$srcnum}
+      git mv $f ${dstnum}${suff}
+      fi
+  done
+  cd ..
+done
+
+rm -f aux-var/$srcnum*
diff --git a/test/msglog/0122.10HmaX-000000005vi-0000 b/test/msglog/4120.10HmaX-000000005vi-0000
similarity index 100%
rename from test/msglog/0122.10HmaX-000000005vi-0000
rename to test/msglog/4120.10HmaX-000000005vi-0000
diff --git a/test/msglog/0122.10HmaY-000000005vi-0000 b/test/msglog/4120.10HmaY-000000005vi-0000
similarity index 100%
rename from test/msglog/0122.10HmaY-000000005vi-0000
rename to test/msglog/4120.10HmaY-000000005vi-0000
diff --git a/test/msglog/0122.10HmaZ-000000005vi-0000 b/test/msglog/4120.10HmaZ-000000005vi-0000
similarity index 100%
rename from test/msglog/0122.10HmaZ-000000005vi-0000
rename to test/msglog/4120.10HmaZ-000000005vi-0000
diff --git a/test/msglog/4133.10HmaX-000000005vi-0000 b/test/msglog/4133.10HmaX-000000005vi-0000
new file mode 100644
index 000000000..669647fce
--- /dev/null
+++ b/test/msglog/4133.10HmaX-000000005vi-0000
@@ -0,0 +1,4 @@
+1999-03-02 09:44:33 Received from CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 >postmaster <system-filter>: address_reply transport succeeded
+1999-03-02 09:44:33 system-filter: children all complete
+*** Frozen by the system filter: system filter freezes
diff --git a/test/msglog/4133.10HmbA-000000005vi-0000 b/test/msglog/4133.10HmbA-000000005vi-0000
new file mode 100644
index 000000000..0840c1df2
--- /dev/null
+++ b/test/msglog/4133.10HmbA-000000005vi-0000
@@ -0,0 +1,2 @@
+1999-03-02 09:44:33 Received from CALLER@??? U=CALLER P=local-smtp S=sss
+1999-03-02 09:44:33 frozen by ACL
diff --git a/test/msglog/4133.10HmbB-000000005vi-0000 b/test/msglog/4133.10HmbB-000000005vi-0000
new file mode 100644
index 000000000..0840c1df2
--- /dev/null
+++ b/test/msglog/4133.10HmbB-000000005vi-0000
@@ -0,0 +1,2 @@
+1999-03-02 09:44:33 Received from CALLER@??? U=CALLER P=local-smtp S=sss
+1999-03-02 09:44:33 frozen by ACL
diff --git a/test/msglog/4133.10HmbD-000000005vi-0000 b/test/msglog/4133.10HmbD-000000005vi-0000
new file mode 100644
index 000000000..0840c1df2
--- /dev/null
+++ b/test/msglog/4133.10HmbD-000000005vi-0000
@@ -0,0 +1,2 @@
+1999-03-02 09:44:33 Received from CALLER@??? U=CALLER P=local-smtp S=sss
+1999-03-02 09:44:33 frozen by ACL
diff --git a/test/paniclog/0170 b/test/paniclog/4126
similarity index 100%
rename from test/paniclog/0170
rename to test/paniclog/4126
diff --git a/test/paniclog/0241 b/test/paniclog/4134
similarity index 100%
rename from test/paniclog/0241
rename to test/paniclog/4134
diff --git a/test/paniclog/0372 b/test/paniclog/4151
similarity index 100%
rename from test/paniclog/0372
rename to test/paniclog/4151
diff --git a/test/rejectlog/0079 b/test/rejectlog/4116
similarity index 100%
rename from test/rejectlog/0079
rename to test/rejectlog/4116
diff --git a/test/rejectlog/0098 b/test/rejectlog/4118
similarity index 100%
rename from test/rejectlog/0098
rename to test/rejectlog/4118
diff --git a/test/rejectlog/5708 b/test/rejectlog/5703
similarity index 100%
rename from test/rejectlog/5708
rename to test/rejectlog/5703
diff --git a/test/runtest b/test/runtest
index 7226c4b0c..bb9b1ceee 100755
--- a/test/runtest
+++ b/test/runtest
@@ -1555,7 +1555,7 @@ RESET_AFTER_EXTRA_LINE_READ:
       }
 
     # various features can be built as dynamic-load modules
-    next if /loading module '(?:arc|dkim|dmarc|pam|perl|radius|spf)'$/;
+    next if /loading module '(?:arc|exim_filter|dkim|dmarc|pam|perl|radius|sieve_filter|spf)'$/;
 
     # Not all platforms build with DKIM enabled
     next if /^DKIM >> Body data for hash, canonicalized/;
@@ -1563,7 +1563,7 @@ RESET_AFTER_EXTRA_LINE_READ:
     # Not all platforms build with SPF enabled
     next if /(^$time_pid?spf_conn_init|spf_compile\.c)/;
     next if /try option spf_smtp_comment_template$/;
-    next if /^$time_pid?Loaded "(?:dkim|dmarc|spf)"$/;
+    next if /^$time_pid?Loaded "(?:dkim|dmarc|exim_filter|spf)"$/;
 
     # Not all platforms have sendfile support
     next if /^cannot use sendfile for body: no support$/;
@@ -4430,6 +4430,9 @@ foreach $basedir ("aux-var", "dnszones")
       $" = ' ';
       }
 
+    my $testnum = 0;
+    if ($file =~ /^(\d+)/) { $testnum = $1; }
+
     print ">>Copying $basedir-src/$file to $basedir/$outfile\n" if $debug;
     open(IN, "$parm_cwd/$basedir-src/$file") ||
       tests_exit(-1, "Failed to open $parm_cwd/$basedir-src/$file: $!");
@@ -4437,7 +4440,7 @@ foreach $basedir ("aux-var", "dnszones")
       tests_exit(-1, "Failed to open $parm_cwd/$basedir/$outfile: $!");
     while (<IN>)
       {
-      do_substitute(0);
+      do_substitute($testnum);
       print OUT;
       }
     close(IN);
diff --git a/test/scripts/0000-Basic/0015 b/test/scripts/0000-Basic/0015
index 4c8c5e7e4..9539b98bf 100644
--- a/test/scripts/0000-Basic/0015
+++ b/test/scripts/0000-Basic/0015
@@ -1,15 +1,9 @@
 # local part prefix
 need_ipv4
 #
-exim -odi page+userx
-Some message text.
-****
 exim -odi page+ux
 Some more message text.
 ****
-exim -odi B+userx@???
-Text.
-****
 server PORT_S
 220 Server ready
 EHLO
@@ -25,11 +19,6 @@ DATA
 QUIT
 250 OK
 ****
-exim -odi S+userx@???
-More text.
-****
-exim -odi userx-B@??? X+userx-B@???
-****
 server PORT_S
 220 Server ready
 EHLO
diff --git a/test/scripts/0000-Basic/0046 b/test/scripts/0000-Basic/0046
index 6dfae1d48..4c5c467e3 100644
Binary files a/test/scripts/0000-Basic/0046 and b/test/scripts/0000-Basic/0046 differ
diff --git a/test/scripts/0000-Basic/0072 b/test/scripts/0000-Basic/0072
index 14bc9f4a8..34c24bf31 100644
--- a/test/scripts/0000-Basic/0072
+++ b/test/scripts/0000-Basic/0072
@@ -28,11 +28,3 @@ From: =?ISO-8859-1?Q?CALLER=40test=2Eex?= <CALLER@???>
 
 This is a test for encoded headers ane $reply_address.
 ****
-# This message has a From: line that is syntactically bad, and we process it
-# with a filter.
-exim -DONCE= -odi userx-filter@???
-Subject: Bad from
-From: "something" x@y
-
-This is a test for a bad From: line.
-****
diff --git a/test/scripts/0000-Basic/0266 b/test/scripts/0000-Basic/0266
index 5c6ffa7e3..f1a089231 100644
--- a/test/scripts/0000-Basic/0266
+++ b/test/scripts/0000-Basic/0266
@@ -4,15 +4,7 @@ exim -odi list@???
 exim -odi list2@???
 Message to list2.
 ****
-exim -odi filter@???
-****
 exim -odi nmlist@???
 Message to nmlist.
 ****
-exim -odi filter2@???
-Message to filter2.
-****
-exim -odi filter3@???
-Message to filter3.
-****
 no_msglog_check
diff --git a/test/scripts/0000-Basic/0270 b/test/scripts/0000-Basic/0270
index bf29b941e..2693707d7 100644
--- a/test/scripts/0000-Basic/0270
+++ b/test/scripts/0000-Basic/0270
@@ -8,15 +8,7 @@ exim -odi list@???
 exim -odi list2@???
 Message to list2.
 ****
-exim -odi filter@???
-****
 exim -odi nmlist@???
 Message to nmlist.
 ****
-exim -odi filter2@???
-Message to filter2.
-****
-exim -odi filter3@???
-Message to filter3.
-****
 no_msglog_check
diff --git a/test/scripts/3400-plaintext/REQUIRES b/test/scripts/3400-plaintext/REQUIRES
index 9690eb334..da3a0c5ec 100644
--- a/test/scripts/3400-plaintext/REQUIRES
+++ b/test/scripts/3400-plaintext/REQUIRES
@@ -1 +1,2 @@
 authenticator plaintext
+support Exim_filter
diff --git a/test/scripts/3500-CRAM-MD5/REQUIRES b/test/scripts/3500-CRAM-MD5/REQUIRES
index 93ec9fe82..e5f8e4f56 100644
--- a/test/scripts/3500-CRAM-MD5/REQUIRES
+++ b/test/scripts/3500-CRAM-MD5/REQUIRES
@@ -1 +1,2 @@
 authenticator cram_md5
+support Exim-filter
diff --git a/test/scripts/4100-iconv/REQUIRES b/test/scripts/4100-iconv/REQUIRES
index 84e013f1d..df37c0b61 100644
--- a/test/scripts/4100-iconv/REQUIRES
+++ b/test/scripts/4100-iconv/REQUIRES
@@ -1 +1,2 @@
 support iconv()
+support Exim-filter
diff --git a/test/scripts/0000-Basic/0037 b/test/scripts/4110-exim-filter/4110
similarity index 100%
rename from test/scripts/0000-Basic/0037
rename to test/scripts/4110-exim-filter/4110
diff --git a/test/scripts/0000-Basic/0015 b/test/scripts/4110-exim-filter/4111
similarity index 100%
copy from test/scripts/0000-Basic/0015
copy to test/scripts/4110-exim-filter/4111
diff --git a/test/scripts/0000-Basic/0016 b/test/scripts/4110-exim-filter/4112
similarity index 100%
rename from test/scripts/0000-Basic/0016
rename to test/scripts/4110-exim-filter/4112
diff --git a/test/scripts/0000-Basic/0046 b/test/scripts/4110-exim-filter/4113
similarity index 70%
copy from test/scripts/0000-Basic/0046
copy to test/scripts/4110-exim-filter/4113
index 6dfae1d48..b4fe40860 100644
Binary files a/test/scripts/0000-Basic/0046 and b/test/scripts/4110-exim-filter/4113 differ
diff --git a/test/scripts/4110-exim-filter/4114 b/test/scripts/4110-exim-filter/4114
new file mode 100644
index 000000000..0ad4a2bf7
--- /dev/null
+++ b/test/scripts/4110-exim-filter/4114
@@ -0,0 +1,9 @@
+# autoreply
+# This message has a From: line that is syntactically bad, and we process it
+# with a filter.
+exim -DONCE= -odi userx-filter@???
+Subject: Bad from
+From: "something" x@y
+
+This is a test for a bad From: line.
+****
diff --git a/test/scripts/0000-Basic/0074 b/test/scripts/4110-exim-filter/4115
similarity index 100%
rename from test/scripts/0000-Basic/0074
rename to test/scripts/4110-exim-filter/4115
diff --git a/test/scripts/0000-Basic/0079 b/test/scripts/4110-exim-filter/4116
similarity index 100%
rename from test/scripts/0000-Basic/0079
rename to test/scripts/4110-exim-filter/4116
diff --git a/test/scripts/0000-Basic/0093 b/test/scripts/4110-exim-filter/4117
similarity index 100%
rename from test/scripts/0000-Basic/0093
rename to test/scripts/4110-exim-filter/4117
diff --git a/test/scripts/0000-Basic/0098 b/test/scripts/4110-exim-filter/4118
similarity index 100%
rename from test/scripts/0000-Basic/0098
rename to test/scripts/4110-exim-filter/4118
diff --git a/test/scripts/0000-Basic/0114 b/test/scripts/4110-exim-filter/4119
similarity index 100%
rename from test/scripts/0000-Basic/0114
rename to test/scripts/4110-exim-filter/4119
diff --git a/test/scripts/0000-Basic/0122 b/test/scripts/4110-exim-filter/4120
similarity index 100%
rename from test/scripts/0000-Basic/0122
rename to test/scripts/4110-exim-filter/4120
diff --git a/test/scripts/0000-Basic/0131 b/test/scripts/4110-exim-filter/4121
similarity index 100%
rename from test/scripts/0000-Basic/0131
rename to test/scripts/4110-exim-filter/4121
diff --git a/test/scripts/0000-Basic/0136 b/test/scripts/4110-exim-filter/4122
similarity index 100%
rename from test/scripts/0000-Basic/0136
rename to test/scripts/4110-exim-filter/4122
diff --git a/test/scripts/0000-Basic/0164 b/test/scripts/4110-exim-filter/4123
similarity index 100%
rename from test/scripts/0000-Basic/0164
rename to test/scripts/4110-exim-filter/4123
diff --git a/test/scripts/0000-Basic/0165 b/test/scripts/4110-exim-filter/4124
similarity index 100%
rename from test/scripts/0000-Basic/0165
rename to test/scripts/4110-exim-filter/4124
diff --git a/test/scripts/0000-Basic/0168 b/test/scripts/4110-exim-filter/4125
similarity index 100%
rename from test/scripts/0000-Basic/0168
rename to test/scripts/4110-exim-filter/4125
diff --git a/test/scripts/0000-Basic/0170 b/test/scripts/4110-exim-filter/4126
similarity index 100%
rename from test/scripts/0000-Basic/0170
rename to test/scripts/4110-exim-filter/4126
diff --git a/test/scripts/0000-Basic/0173 b/test/scripts/4110-exim-filter/4127
similarity index 100%
rename from test/scripts/0000-Basic/0173
rename to test/scripts/4110-exim-filter/4127
diff --git a/test/scripts/0000-Basic/0177 b/test/scripts/4110-exim-filter/4128
similarity index 100%
rename from test/scripts/0000-Basic/0177
rename to test/scripts/4110-exim-filter/4128
diff --git a/test/scripts/0000-Basic/0182 b/test/scripts/4110-exim-filter/4129
similarity index 100%
rename from test/scripts/0000-Basic/0182
rename to test/scripts/4110-exim-filter/4129
diff --git a/test/scripts/0000-Basic/0184 b/test/scripts/4110-exim-filter/4130
similarity index 100%
copy from test/scripts/0000-Basic/0184
copy to test/scripts/4110-exim-filter/4130
diff --git a/test/scripts/0000-Basic/0185 b/test/scripts/4110-exim-filter/4131
similarity index 100%
rename from test/scripts/0000-Basic/0185
rename to test/scripts/4110-exim-filter/4131
diff --git a/test/scripts/0000-Basic/0232 b/test/scripts/4110-exim-filter/4132
similarity index 100%
rename from test/scripts/0000-Basic/0232
rename to test/scripts/4110-exim-filter/4132
diff --git a/test/scripts/0000-Basic/0233 b/test/scripts/4110-exim-filter/4133
similarity index 100%
rename from test/scripts/0000-Basic/0233
rename to test/scripts/4110-exim-filter/4133
diff --git a/test/scripts/0000-Basic/0241 b/test/scripts/4110-exim-filter/4134
similarity index 100%
rename from test/scripts/0000-Basic/0241
rename to test/scripts/4110-exim-filter/4134
diff --git a/test/scripts/0000-Basic/0246 b/test/scripts/4110-exim-filter/4135
similarity index 100%
rename from test/scripts/0000-Basic/0246
rename to test/scripts/4110-exim-filter/4135
diff --git a/test/scripts/0000-Basic/0248 b/test/scripts/4110-exim-filter/4136
similarity index 100%
rename from test/scripts/0000-Basic/0248
rename to test/scripts/4110-exim-filter/4136
diff --git a/test/scripts/0000-Basic/0266 b/test/scripts/4110-exim-filter/4137
similarity index 100%
copy from test/scripts/0000-Basic/0266
copy to test/scripts/4110-exim-filter/4137
diff --git a/test/scripts/0000-Basic/0270 b/test/scripts/4110-exim-filter/4138
similarity index 100%
copy from test/scripts/0000-Basic/0270
copy to test/scripts/4110-exim-filter/4138
diff --git a/test/scripts/0000-Basic/0296 b/test/scripts/4110-exim-filter/4139
similarity index 100%
rename from test/scripts/0000-Basic/0296
rename to test/scripts/4110-exim-filter/4139
diff --git a/test/scripts/0000-Basic/0297 b/test/scripts/4110-exim-filter/4140
similarity index 100%
rename from test/scripts/0000-Basic/0297
rename to test/scripts/4110-exim-filter/4140
diff --git a/test/scripts/0000-Basic/0298 b/test/scripts/4110-exim-filter/4141
similarity index 100%
rename from test/scripts/0000-Basic/0298
rename to test/scripts/4110-exim-filter/4141
diff --git a/test/scripts/0000-Basic/0316 b/test/scripts/4110-exim-filter/4142
similarity index 100%
rename from test/scripts/0000-Basic/0316
rename to test/scripts/4110-exim-filter/4142
diff --git a/test/scripts/0000-Basic/0319 b/test/scripts/4110-exim-filter/4143
similarity index 100%
rename from test/scripts/0000-Basic/0319
rename to test/scripts/4110-exim-filter/4143
diff --git a/test/scripts/0000-Basic/0326 b/test/scripts/4110-exim-filter/4144
similarity index 100%
rename from test/scripts/0000-Basic/0326
rename to test/scripts/4110-exim-filter/4144
diff --git a/test/scripts/0000-Basic/0328 b/test/scripts/4110-exim-filter/4145
similarity index 100%
rename from test/scripts/0000-Basic/0328
rename to test/scripts/4110-exim-filter/4145
diff --git a/test/scripts/0000-Basic/0329 b/test/scripts/4110-exim-filter/4146
similarity index 100%
rename from test/scripts/0000-Basic/0329
rename to test/scripts/4110-exim-filter/4146
diff --git a/test/scripts/4110-exim-filter/4147 b/test/scripts/4110-exim-filter/4147
new file mode 100644
index 000000000..8e47911af
--- /dev/null
+++ b/test/scripts/4110-exim-filter/4147
@@ -0,0 +1,4 @@
+# duplicate loops in address graphs
+exim -odi x@dom1 x@dom2
+****
+no_msglog_check
diff --git a/test/scripts/0000-Basic/0349 b/test/scripts/4110-exim-filter/4148
similarity index 100%
rename from test/scripts/0000-Basic/0349
rename to test/scripts/4110-exim-filter/4148
diff --git a/test/scripts/0000-Basic/0351 b/test/scripts/4110-exim-filter/4149
similarity index 100%
rename from test/scripts/0000-Basic/0351
rename to test/scripts/4110-exim-filter/4149
diff --git a/test/scripts/0000-Basic/0352 b/test/scripts/4110-exim-filter/4150
similarity index 100%
rename from test/scripts/0000-Basic/0352
rename to test/scripts/4110-exim-filter/4150
diff --git a/test/scripts/0000-Basic/0372 b/test/scripts/4110-exim-filter/4151
similarity index 100%
rename from test/scripts/0000-Basic/0372
rename to test/scripts/4110-exim-filter/4151
diff --git a/test/scripts/0000-Basic/0378 b/test/scripts/4110-exim-filter/4152
similarity index 100%
rename from test/scripts/0000-Basic/0378
rename to test/scripts/4110-exim-filter/4152
diff --git a/test/scripts/0000-Basic/0382 b/test/scripts/4110-exim-filter/4153
similarity index 100%
rename from test/scripts/0000-Basic/0382
rename to test/scripts/4110-exim-filter/4153
diff --git a/test/scripts/0000-Basic/0383 b/test/scripts/4110-exim-filter/4154
similarity index 100%
rename from test/scripts/0000-Basic/0383
rename to test/scripts/4110-exim-filter/4154
diff --git a/test/scripts/0000-Basic/0404 b/test/scripts/4110-exim-filter/4155
similarity index 100%
rename from test/scripts/0000-Basic/0404
rename to test/scripts/4110-exim-filter/4155
diff --git a/test/scripts/0000-Basic/0406 b/test/scripts/4110-exim-filter/4156
similarity index 100%
rename from test/scripts/0000-Basic/0406
rename to test/scripts/4110-exim-filter/4156
diff --git a/test/scripts/0000-Basic/0411 b/test/scripts/4110-exim-filter/4157
similarity index 100%
rename from test/scripts/0000-Basic/0411
rename to test/scripts/4110-exim-filter/4157
diff --git a/test/scripts/0000-Basic/0412 b/test/scripts/4110-exim-filter/4158
similarity index 100%
rename from test/scripts/0000-Basic/0412
rename to test/scripts/4110-exim-filter/4158
diff --git a/test/scripts/0000-Basic/0421 b/test/scripts/4110-exim-filter/4159
similarity index 100%
rename from test/scripts/0000-Basic/0421
rename to test/scripts/4110-exim-filter/4159
diff --git a/test/scripts/0000-Basic/0444 b/test/scripts/4110-exim-filter/4160
similarity index 100%
rename from test/scripts/0000-Basic/0444
rename to test/scripts/4110-exim-filter/4160
diff --git a/test/scripts/0000-Basic/0452 b/test/scripts/4110-exim-filter/4161
similarity index 100%
rename from test/scripts/0000-Basic/0452
rename to test/scripts/4110-exim-filter/4161
diff --git a/test/scripts/0000-Basic/0454 b/test/scripts/4110-exim-filter/4162
similarity index 100%
rename from test/scripts/0000-Basic/0454
rename to test/scripts/4110-exim-filter/4162
diff --git a/test/scripts/0000-Basic/0472 b/test/scripts/4110-exim-filter/4163
similarity index 100%
rename from test/scripts/0000-Basic/0472
rename to test/scripts/4110-exim-filter/4163
diff --git a/test/scripts/0000-Basic/0506 b/test/scripts/4110-exim-filter/4164
similarity index 100%
rename from test/scripts/0000-Basic/0506
rename to test/scripts/4110-exim-filter/4164
diff --git a/test/scripts/0000-Basic/0510 b/test/scripts/4110-exim-filter/4165
similarity index 100%
rename from test/scripts/0000-Basic/0510
rename to test/scripts/4110-exim-filter/4165
diff --git a/test/scripts/0000-Basic/0616 b/test/scripts/4110-exim-filter/4166
similarity index 100%
rename from test/scripts/0000-Basic/0616
rename to test/scripts/4110-exim-filter/4166
diff --git a/test/scripts/0000-Basic/0617 b/test/scripts/4110-exim-filter/4167
similarity index 100%
rename from test/scripts/0000-Basic/0617
rename to test/scripts/4110-exim-filter/4167
diff --git a/test/scripts/4110-exim-filter/REQUIRES b/test/scripts/4110-exim-filter/REQUIRES
new file mode 100644
index 000000000..13cddeb65
--- /dev/null
+++ b/test/scripts/4110-exim-filter/REQUIRES
@@ -0,0 +1 @@
+support Exim_filter
diff --git a/test/scripts/4160-sieve-filter/4160 b/test/scripts/4190-sieve-filter/4190
similarity index 100%
rename from test/scripts/4160-sieve-filter/4160
rename to test/scripts/4190-sieve-filter/4190
diff --git a/test/scripts/4160-sieve-filter/4161 b/test/scripts/4190-sieve-filter/4191
similarity index 100%
rename from test/scripts/4160-sieve-filter/4161
rename to test/scripts/4190-sieve-filter/4191
diff --git a/test/scripts/4160-sieve-filter/4162 b/test/scripts/4190-sieve-filter/4192
similarity index 100%
rename from test/scripts/4160-sieve-filter/4162
rename to test/scripts/4190-sieve-filter/4192
diff --git a/test/scripts/4160-sieve-filter/4163 b/test/scripts/4190-sieve-filter/4193
similarity index 100%
rename from test/scripts/4160-sieve-filter/4163
rename to test/scripts/4190-sieve-filter/4193
diff --git a/test/scripts/4160-sieve-filter/REQUIRES b/test/scripts/4190-sieve-filter/REQUIRES
similarity index 100%
rename from test/scripts/4160-sieve-filter/REQUIRES
rename to test/scripts/4190-sieve-filter/REQUIRES
diff --git a/test/scripts/5200-queryprogram/5201 b/test/scripts/5210-queryprogram-filter/5210
similarity index 100%
rename from test/scripts/5200-queryprogram/5201
rename to test/scripts/5210-queryprogram-filter/5210
diff --git a/test/scripts/5200-queryprogram/5202 b/test/scripts/5210-queryprogram-filter/5211
similarity index 100%
rename from test/scripts/5200-queryprogram/5202
rename to test/scripts/5210-queryprogram-filter/5211
diff --git a/test/scripts/5210-queryprogram-filter/REQUIRES b/test/scripts/5210-queryprogram-filter/REQUIRES
new file mode 100644
index 000000000..63eda7197
--- /dev/null
+++ b/test/scripts/5210-queryprogram-filter/REQUIRES
@@ -0,0 +1,2 @@
+router queryprogram
+support Exim-filter
diff --git a/test/scripts/5700-events/5701 b/test/scripts/5700-events/5701
index 50e1c27c3..9142cc501 100644
--- a/test/scripts/5700-events/5701
+++ b/test/scripts/5700-events/5701
@@ -1,19 +1,5 @@
-# Events for syntactically invalid generated recipient on autoreply
+# Filter which triggers fail command results in event.
 #
-exim -odi userx-filter@domain1
-Subject: Bad from
-From: "something" x@y
-
-This is a test with a syntactically bad From: line and we process it
-with a filter and fire events.
-****
-#
-#
-#
-#
-exim -odi userx-filter@domain1
-Subject: Good from
-From: "User X" <userx@domain1>
-
-This is a test we process with a filter and fire events.
+exim -odi userx@domain1
+Processed by a filter which triggers fail command.
 ****
diff --git a/test/scripts/5700-events/5702 b/test/scripts/5700-events/5702
index b970ec090..a8b5ffe70 100644
--- a/test/scripts/5700-events/5702
+++ b/test/scripts/5700-events/5702
@@ -1,26 +1,6 @@
-# Raise msg:fail:delivery when an error, originated by a filter, gets ignored.
+# tcp:connect deny
 #
-exim -odq userx@domain1
-Also try to deliver this message to usery via a filter deliver command.
-However that fails. But because of the noerror cmd the error just gets ignored.
-****
-server PORT_S
-220 ESMTP
-EHLO
-250-OK
-250 HELP
-MAIL
-250 OK
-RCPT
-250 OK
-RCPT
-550 Not that one
-DATA
-354 More...
-.
-250 OK
-QUIT
-220 OK
-****
-exim -qqf
+exim -odf userx@domain1
+A deliverable message
 ****
+no_msglog_check
diff --git a/test/scripts/5700-events/5703 b/test/scripts/5700-events/5703
index 54fd48544..9cb9508fe 100644
--- a/test/scripts/5700-events/5703
+++ b/test/scripts/5700-events/5703
@@ -1,20 +1,62 @@
-# Raise msg:fail:delivery when an error of a failed bounce gets ignored.
+# event on dns lookup fail
+
+exim -bd -DSERVER=server -oX PORT_D
+****
 #
-exim -odq userx@domain1
-Try to deliver this message to usery via a filter deliver "redirect".
-However that fails. Later the bounce also fails.
+# no A record
+client 127.0.0.1 PORT_D
+??? 220
+HELO nonexistent.test.ex
+??? 250
+MAIL FROM:<a@b>
+??? 250
+RCPT TO:<c@d>
+??? 550
+QUIT
+??? 221
+****
+# CNAME to no-A-record
+client 127.0.0.1 PORT_D
+??? 220
+HELO badcname.test.ex
+??? 250
+MAIL FROM:<a@b>
+??? 250
+RCPT TO:<c@d>
+??? 550
+QUIT
+??? 221
 ****
-server PORT_S 2
-220 ESMTP
-EHLO
-250-OK
-250 HELP
-MAIL
-250 OK
-RCPT
-550 Not that one
+# defer from dns lookup
+client 127.0.0.1 PORT_D
+??? 220
+HELO test.again.dns
+??? 250
+MAIL FROM:<a@b>
+??? 250
+RCPT TO:<c@d>
+??? 550
 QUIT
-220 OK
+??? 221
 ****
-exim -qqf
+# success in RCPT ACL; no-A in transport
+client 127.0.0.1 PORT_D
+??? 220
+HELO localhost
+??? 250
+MAIL FROM:<a@b>
+??? 250
+RCPT TO:<bad_A@???>
+??? 250 Accepted
+DATA
+??? 354
+Subject: test
+.
+??? 250
+QUIT
+??? 221
 ****
+#
+sleep 1
+killdaemon
+no_msglog_check
diff --git a/test/scripts/5700-events/5705 b/test/scripts/5700-events/5705
deleted file mode 100644
index 9142cc501..000000000
--- a/test/scripts/5700-events/5705
+++ /dev/null
@@ -1,5 +0,0 @@
-# Filter which triggers fail command results in event.
-#
-exim -odi userx@domain1
-Processed by a filter which triggers fail command.
-****
diff --git a/test/scripts/5700-events/5707 b/test/scripts/5700-events/5707
deleted file mode 100644
index a8b5ffe70..000000000
--- a/test/scripts/5700-events/5707
+++ /dev/null
@@ -1,6 +0,0 @@
-# tcp:connect deny
-#
-exim -odf userx@domain1
-A deliverable message
-****
-no_msglog_check
diff --git a/test/scripts/5700-events/5708 b/test/scripts/5700-events/5708
deleted file mode 100644
index 9cb9508fe..000000000
--- a/test/scripts/5700-events/5708
+++ /dev/null
@@ -1,62 +0,0 @@
-# event on dns lookup fail
-
-exim -bd -DSERVER=server -oX PORT_D
-****
-#
-# no A record
-client 127.0.0.1 PORT_D
-??? 220
-HELO nonexistent.test.ex
-??? 250
-MAIL FROM:<a@b>
-??? 250
-RCPT TO:<c@d>
-??? 550
-QUIT
-??? 221
-****
-# CNAME to no-A-record
-client 127.0.0.1 PORT_D
-??? 220
-HELO badcname.test.ex
-??? 250
-MAIL FROM:<a@b>
-??? 250
-RCPT TO:<c@d>
-??? 550
-QUIT
-??? 221
-****
-# defer from dns lookup
-client 127.0.0.1 PORT_D
-??? 220
-HELO test.again.dns
-??? 250
-MAIL FROM:<a@b>
-??? 250
-RCPT TO:<c@d>
-??? 550
-QUIT
-??? 221
-****
-# success in RCPT ACL; no-A in transport
-client 127.0.0.1 PORT_D
-??? 220
-HELO localhost
-??? 250
-MAIL FROM:<a@b>
-??? 250
-RCPT TO:<bad_A@???>
-??? 250 Accepted
-DATA
-??? 354
-Subject: test
-.
-??? 250
-QUIT
-??? 221
-****
-#
-sleep 1
-killdaemon
-no_msglog_check
diff --git a/test/scripts/5700-events/5701 b/test/scripts/5704-events-filter/5704
similarity index 100%
copy from test/scripts/5700-events/5701
copy to test/scripts/5704-events-filter/5704
diff --git a/test/scripts/5700-events/5702 b/test/scripts/5704-events-filter/5705
similarity index 100%
copy from test/scripts/5700-events/5702
copy to test/scripts/5704-events-filter/5705
diff --git a/test/scripts/5700-events/5703 b/test/scripts/5704-events-filter/5706
similarity index 100%
copy from test/scripts/5700-events/5703
copy to test/scripts/5704-events-filter/5706
diff --git a/test/scripts/5700-events/5704 b/test/scripts/5704-events-filter/5707
similarity index 100%
rename from test/scripts/5700-events/5704
rename to test/scripts/5704-events-filter/5707
diff --git a/test/scripts/5700-events/5706 b/test/scripts/5704-events-filter/5708
similarity index 100%
rename from test/scripts/5700-events/5706
rename to test/scripts/5704-events-filter/5708
diff --git a/test/scripts/5704-events-filter/REQUIRES b/test/scripts/5704-events-filter/REQUIRES
new file mode 100644
index 000000000..39a8d09ea
--- /dev/null
+++ b/test/scripts/5704-events-filter/REQUIRES
@@ -0,0 +1,2 @@
+support Event
+support Exim-filter
diff --git a/test/stderr/0037 b/test/stderr/4110
similarity index 93%
rename from test/stderr/0037
rename to test/stderr/4110
index 584120ca5..19d502695 100644
--- a/test/stderr/0037
+++ b/test/stderr/4110
@@ -11,9 +11,9 @@ configuration file is TESTSUITE/test-config
 trusted user
 admin user
 dropping to exim gid; retaining priv uid
-rda_interpret (file): 'TESTSUITE/aux-var/0037.F'
-expanded: 'TESTSUITE/aux-var/0037.F'
-ssss bytes read from TESTSUITE/aux-var/0037.F
+rda_interpret (file): 'TESTSUITE/aux-var/4110.F'
+expanded: 'TESTSUITE/aux-var/4110.F'
+ssss bytes read from TESTSUITE/aux-var/4110.F
 data is an Exim filter program
 Filter: start of processing
 Filter: end of processing
@@ -43,9 +43,9 @@ local_part=filter-userx domain=test.ex
 checking local_parts
 $home = >/usr<
 calling userfilter router
-rda_interpret (file): 'TESTSUITE/aux-var/0037.f-user'
-expanded: 'TESTSUITE/aux-var/0037.f-user'
-ssss bytes read from TESTSUITE/aux-var/0037.f-user
+rda_interpret (file): 'TESTSUITE/aux-var/4110.f-user'
+expanded: 'TESTSUITE/aux-var/4110.f-user'
+ssss bytes read from TESTSUITE/aux-var/4110.f-user
 data is an Exim filter program
 Filter: start of processing
 Filter: end of processing
diff --git a/test/stderr/0079 b/test/stderr/4116
similarity index 100%
rename from test/stderr/0079
rename to test/stderr/4116
diff --git a/test/stderr/0170 b/test/stderr/4126
similarity index 100%
rename from test/stderr/0170
rename to test/stderr/4126
diff --git a/test/stderr/0177 b/test/stderr/4128
similarity index 100%
rename from test/stderr/0177
rename to test/stderr/4128
diff --git a/test/stderr/0185 b/test/stderr/4131
similarity index 100%
rename from test/stderr/0185
rename to test/stderr/4131
diff --git a/test/stderr/0241 b/test/stderr/4134
similarity index 100%
rename from test/stderr/0241
rename to test/stderr/4134
diff --git a/test/stderr/0297 b/test/stderr/4140
similarity index 100%
rename from test/stderr/0297
rename to test/stderr/4140
diff --git a/test/stderr/0372 b/test/stderr/4151
similarity index 100%
rename from test/stderr/0372
rename to test/stderr/4151
diff --git a/test/stderr/0378 b/test/stderr/4152
similarity index 100%
rename from test/stderr/0378
rename to test/stderr/4152
diff --git a/test/stderr/0382 b/test/stderr/4153
similarity index 100%
rename from test/stderr/0382
rename to test/stderr/4153
diff --git a/test/stderr/0404 b/test/stderr/4155
similarity index 100%
rename from test/stderr/0404
rename to test/stderr/4155
diff --git a/test/stderr/0472 b/test/stderr/4163
similarity index 100%
rename from test/stderr/0472
rename to test/stderr/4163
diff --git a/test/stderr/5004 b/test/stderr/5004
index fdeed81ac..3eba9a65b 100644
--- a/test/stderr/5004
+++ b/test/stderr/5004
@@ -89,19 +89,11 @@ routing userx@???
 --------> r1 router <--------
 local_part=userx domain=test.ex
 calling r1 router
-rda_interpret (string): '# Exim filter\nsave TESTSUITE/test-mail'
-expanded: '# Exim filter
-save TESTSUITE/test-mail'
-search_tidyup called
-changed uid/gid: r1 router (recipient is userx@???)
-  uid=CALLER_UID gid=CALLER_GID pid=p1236
-turned off address rewrite logging (not root or exim in this process)
-data is an Exim filter program
-Filter: start of processing
-Filter: end of processing
-search_tidyup called
->>>>>>>>>>>>>>>> Exim pid=p1236 (router-interpret) terminating with rc=0 >>>>>>>>>>>>>>>>
-rda_interpret: subprocess yield=0 error=NULL
+rda_interpret (string): 'TESTSUITE/test-mail'
+expanded: 'TESTSUITE/test-mail'
+file is not a filter file
+parse_forward_list: TESTSUITE/test-mail
+extract item: TESTSUITE/test-mail
 set transport t1
 r1 router generated TESTSUITE/test-mail
   pipe, file, or autoreply
@@ -128,7 +120,7 @@ search_tidyup called
 no retry data available
 search_tidyup called
 changed uid/gid: local delivery to TESTSUITE/test-mail <TESTSUITE/test-mail> transport=t1
-  uid=CALLER_UID gid=CALLER_GID pid=p1237
+  uid=CALLER_UID gid=CALLER_GID pid=p1236
   home=NULL current=/
 set_process_info: pppp delivering 10HmaX-000000005vi-0000 to TESTSUITE/test-mail using t1
 appendfile transport entered
@@ -149,7 +141,7 @@ renaming temporary file
 renamed tmp/MAILDIR.mail.test.ex as new/MAILDIR.mail.test.ex
 appendfile yields 0 with errno=dd more_errno=dd
 search_tidyup called
->>>>>>>>>>>>>>>> Exim pid=p1237 (delivery-local) terminating with rc=0 >>>>>>>>>>>>>>>>
+>>>>>>>>>>>>>>>> Exim pid=p1236 (delivery-local) terminating with rc=0 >>>>>>>>>>>>>>>>
 journalling TESTSUITE/test-mail:userx@???
 t1 transport returned OK for TESTSUITE/test-mail
 post-process TESTSUITE/test-mail (0)
diff --git a/test/stderr/5420 b/test/stderr/5420
index a157bf5f5..b96d91def 100644
--- a/test/stderr/5420
+++ b/test/stderr/5420
@@ -71,7 +71,7 @@ try option acl_smtp_rcpt
  ├───expanded: ${if░eq░{SERVER}{server}{queue}{cutthrough}}
  ╰─────result: cutthrough
 using ACL "cutthrough"
-processing "accept" (TESTSUITE/test-config 22)
+processing ACL cutthrough "accept" (TESTSUITE/test-config 22)
 check control = cutthrough_delivery
 check verify = recipient
 domain.com in domains?
@@ -95,11 +95,14 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 ----------- end verify ------------
-accept: condition test succeeded in ACL "cutthrough"
-end of ACL "cutthrough": ACCEPT
+accept: condition test succeeded in ACL cutthrough
+end of ACL cutthrough: ACCEPT
 ----------- start cutthrough setup ------------
 domain.com in domains?
  list element: !░+local_domains
@@ -122,6 +125,9 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 try option interface
@@ -282,7 +288,7 @@ sync_responses expect rcpt for userx@???
 holding verify callout open for cutthrough delivery
 ----------- end cutthrough setup ------------
 try option acl_smtp_predata
-processing "accept" (TESTSUITE/test-config 55)
+processing inline ACL "accept"
 accept: condition test succeeded in inline ACL
 end of inline ACL: ACCEPT
   SMTP>> DATA
@@ -742,7 +748,7 @@ try option acl_smtp_rcpt
  ├───expanded: ${if░eq░{SERVER}{server}{queue}{cutthrough}}
  ╰─────result: cutthrough
 using ACL "cutthrough"
-processing "accept" (TESTSUITE/test-config 22)
+processing ACL cutthrough "accept" (TESTSUITE/test-config 22)
 check control = cutthrough_delivery
 check verify = recipient
 domain.com in domains?
@@ -766,11 +772,14 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 ----------- end verify ------------
-accept: condition test succeeded in ACL "cutthrough"
-end of ACL "cutthrough": ACCEPT
+accept: condition test succeeded in ACL cutthrough
+end of ACL cutthrough: ACCEPT
 ----------- start cutthrough setup ------------
 domain.com in domains?
  list element: !░+local_domains
@@ -793,6 +802,9 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 try option interface
@@ -902,7 +914,7 @@ sync_responses expect rcpt for usery@???
 holding verify callout open for cutthrough delivery
 ----------- end cutthrough setup ------------
 try option acl_smtp_predata
-processing "accept" (TESTSUITE/test-config 55)
+processing inline ACL "accept"
 accept: condition test succeeded in inline ACL
 end of inline ACL: ACCEPT
   SMTP>> DATA
@@ -1362,7 +1374,7 @@ try option acl_smtp_rcpt
  ├───expanded: ${if░eq░{SERVER}{server}{queue}{cutthrough}}
  ╰─────result: cutthrough
 using ACL "cutthrough"
-processing "accept" (TESTSUITE/test-config 22)
+processing ACL cutthrough "accept" (TESTSUITE/test-config 22)
 check control = cutthrough_delivery
 check verify = recipient
 domain.com in domains?
@@ -1386,11 +1398,14 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 ----------- end verify ------------
-accept: condition test succeeded in ACL "cutthrough"
-end of ACL "cutthrough": ACCEPT
+accept: condition test succeeded in ACL cutthrough
+end of ACL cutthrough: ACCEPT
 ----------- start cutthrough setup ------------
 domain.com in domains?
  list element: !░+local_domains
@@ -1413,6 +1428,9 @@ processing address_data
 domain.com in "*"?
  list element: *
  domain.com in "*"? yes (matched "*")
+try option errors_to
+try option headers_add
+try option headers_remove
 try option transport
 try option unseen
 try option interface
@@ -1522,7 +1540,7 @@ sync_responses expect rcpt for usery@???
 holding verify callout open for cutthrough delivery
 ----------- end cutthrough setup ------------
 try option acl_smtp_predata
-processing "accept" (TESTSUITE/test-config 55)
+processing inline ACL "accept"
 accept: condition test succeeded in inline ACL
 end of inline ACL: ACCEPT
   SMTP>> DATA
diff --git a/test/stderr/5820 b/test/stderr/5820
index 362fffd94..583a3cddc 100644
--- a/test/stderr/5820
+++ b/test/stderr/5820
@@ -13,7 +13,7 @@

>>> list element: @
>>> list element: @[]
>>> test in helo_lookup_domains? no (end of list)

->>> processing "accept" (TESTSUITE/test-config 88)
+>>> processing inline ACL "accept"
>>> check verify = recipient/callout
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing rcptuser@???

diff --git a/test/stdout/0015 b/test/stdout/0015
index 07c87514e..cda50cf2c 100644
--- a/test/stdout/0015
+++ b/test/stdout/0015
@@ -1,31 +1,7 @@
 
 ******** SERVER ********
 Listening on port 1224 ... 
-Connection request from [127.0.0.1]
-220 Server ready
-EHLO the.local.host.name
-250 OK
-MAIL FROM:<CALLER@???>
-250 OK
-RCPT TO:<userx@???>
-250 OK
-DATA
-300 go ahead
-Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
-    id 10HmbE-000000005vi-0000
-    for S+userx@???;
-    Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbE-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-
-More text.
-.
-250 OK
-QUIT
-250 OK
-End of script
+Server timed out
 Listening on port 1224 ... 
 Connection request from [127.0.0.1]
 220 Server ready
@@ -39,10 +15,10 @@ DATA
 300 go ahead
 Received: from CALLER by the.local.host.name with local (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmbG-000000005vi-0000
+    id 10HmaY-000000005vi-0000
     for Userx-S@???;
     Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmbG-000000005vi-0000@???>
+Message-Id: <E10HmaY-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
diff --git a/test/stdout/0037 b/test/stdout/4110
similarity index 85%
rename from test/stdout/0037
rename to test/stdout/4110
index 5fe47ee95..dcb6c682b 100644
--- a/test/stdout/0037
+++ b/test/stdout/4110
@@ -2,7 +2,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-1"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-1"
 
 Add 1 to n3
 Add 3 to n4
@@ -33,14 +33,14 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-2"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-2"
 
 Filter error: errors_to must point to the caller's address
 Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-3"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-3"
 
 Deliver message to: root@??? errors_to root@???
 Testprint: End
@@ -50,7 +50,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -60,7 +60,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -69,7 +69,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Personal
 Testprint: $home = CALLER_HOME
@@ -78,7 +78,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -87,7 +87,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Personal
 Testprint: $home = CALLER_HOME
@@ -96,7 +96,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -105,7 +105,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -114,7 +114,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -123,7 +123,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Personal
 Testprint: $home = CALLER_HOME
@@ -132,7 +132,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -141,7 +141,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -150,7 +150,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -159,7 +159,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -168,7 +168,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Not personal
 Testprint: $home = CALLER_HOME
@@ -177,7 +177,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = anon@ymous
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-4"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-4"
 
 Testprint: Personal
 Testprint: $home = CALLER_HOME
@@ -187,7 +187,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-6"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-6"
 
 Filtering did not set up a significant delivery.
 Normal delivery will occur.
@@ -195,7 +195,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-var/0037.f-7"
+Testing Exim filter file "TESTSUITE/aux-var/4110.f-7"
 
 Testprint: Testing <
 Testprint: >abcd|xyz<
@@ -206,7 +206,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-5"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-5"
 
 Testprint: Before fail
 Fail text "This is a forced failure"
@@ -219,7 +219,7 @@ TTT   sss 10HmbA-000000005vi-0000 <CALLER@???> *** frozen ***
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-var/0037.F"
+Testing Exim filter file "TESTSUITE/aux-var/4110.F"
 
 Testprint: message_size      = 186
 Testprint: message_body_size = 137
@@ -236,7 +236,7 @@ Normal delivery will occur.
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-var/0037.F"
+Testing Exim filter file "TESTSUITE/aux-var/4110.F"
 
 Testprint: ------------------------------------------------
 Testprint: Test-headers: first one\nFrom: x@y\nTest-headers: another one\nMore-test-headers : yet another one\nSubject: testing, testing\nMessage-Id: <E10HmcH-000000005vi-0000@???>\nDate: Tue, 2 Mar 1999 09:44:33 +0000
@@ -265,13 +265,13 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-8"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-8"
 
 Filter error: "seen", "unseen", or "noerror" near line 5 is not followed by a command
 Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-9"
+Testing Exim filter file "TESTSUITE/aux-fixed/4110.f-9"
 
 Filter error: "seen" or "unseen" near line 4 is not followed by a command
diff --git a/test/stdout/0015 b/test/stdout/4111
similarity index 100%
copy from test/stdout/0015
copy to test/stdout/4111
diff --git a/test/stdout/0046 b/test/stdout/4113
similarity index 93%
rename from test/stdout/0046
rename to test/stdout/4113
index c1a01b533..10f37d8f7 100644
--- a/test/stdout/0046
+++ b/test/stdout/4113
@@ -2,7 +2,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: This message has quite a short body, so both variables should end up containing the same amount of data. 
 Testprint: End:  This message has quite a short body, so both variables should end up containing the same amount of data. 
@@ -12,7 +12,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: This message has a long body, more than 500 characters, so the start and end variables should end up containing different character strings.  The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy were 
 Testprint: End:  nd variables should end up containing different character strings.  The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy were the borogoves, and the mome raths outgrabe. There, that should be enough. 
@@ -22,7 +22,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: This message has a long body, more than 500 characters, so the start and end variables should end up containing different character strings.  The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs. . . See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy we
 Testprint: End:  variables should end up containing different character strings.  The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs. . . See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy were the borogoves, and the mome raths outgrabe. There, that should be enough. 
@@ -32,7 +32,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: This message has a long body, more than 500 characters, so the start and end variables should end up containing different character strings.  . The quick brown fox jumps over the lazy dog. . Pack my box with five dozen liquor jugs.  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy w
 Testprint: End:  ariables should end up containing different character strings.  . The quick brown fox jumps over the lazy dog. . Pack my box with five dozen liquor jugs.  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy were the borogoves, and the mome raths outgrabe. There, that should be enough. 
@@ -42,7 +42,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: Here's a body with a NULL( ) in it. That should become a space. 
 Testprint: End:  Here's a body with a NULL( ) in it. That should become a space. 
@@ -52,7 +52,7 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = usery@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0046.filter.userx"
+Testing Exim filter file "TESTSUITE/aux-fixed/4113.filter.userx"
 
 Testprint: Body: This message has a long body, more than 500 characters, so the start and end variables should end up containing different character strings.  The quick brown fox jumps over the lazy dog. NULL( ) Pack my box with five dozen liquor jugs. NULL( )  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe,
 Testprint: End:  up containing different character strings.  The quick brown fox jumps over the lazy dog. NULL( ) Pack my box with five dozen liquor jugs. NULL( )  See! The second of those is shorter, but also contains all 26 letters of the alphabet, and also makes some kind of sense. Now is the time for all good men to come to the aid of the party. 'Twas brillig and the slithy toves did gyre and gimble in the wabe, all mimsy were the borogoves, and the mome raths outgrabe. NULL( ) There, that should be enough. 
diff --git a/test/stdout/0079 b/test/stdout/4116
similarity index 100%
rename from test/stdout/0079
rename to test/stdout/4116
diff --git a/test/stdout/0093 b/test/stdout/4117
similarity index 94%
rename from test/stdout/0093
rename to test/stdout/4117
index dd0b3d2a7..f3e3da52e 100644
--- a/test/stdout/0093
+++ b/test/stdout/4117
@@ -1,7 +1,7 @@
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-var/0093.f-1"
+Testing Exim filter file "TESTSUITE/aux-var/4117.f-1"
 
 Testprint: yes
 Testprint: no
@@ -16,13 +16,13 @@ Warning: no message headers read
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-var/0093.f-2"
+Testing Exim filter file "TESTSUITE/aux-var/4117.f-2"
 
 Filter error: failed to expand "${if eq {1}{0}{yes}{${lookup{key1}lsearch{TESTSUITE/aux-fixed/junkjunk}{$value}{notfound}}}}" in testprint command: failed to open TESTSUITE/aux-fixed/junkjunk for linear search: No such file or directory
 Return-path copied from sender
 Sender      = CALLER@???
 Recipient   = CALLER@???
-Testing Exim filter file "TESTSUITE/aux-fixed/0093.f-3"
+Testing Exim filter file "TESTSUITE/aux-fixed/4117.f-3"
 
 Testprint: From: is defined
 Testprint: Absent: is not defined
diff --git a/test/stdout/0098 b/test/stdout/4118
similarity index 100%
rename from test/stdout/0098
rename to test/stdout/4118
diff --git a/test/stdout/0136 b/test/stdout/4122
similarity index 100%
rename from test/stdout/0136
rename to test/stdout/4122
diff --git a/test/stdout/4128 b/test/stdout/4128
new file mode 100644
index 000000000..26fd516c5
--- /dev/null
+++ b/test/stdout/4128
@@ -0,0 +1,37 @@
+TTT   sss 10HmbA-000000005vi-0000 <CALLER@???> *** frozen ***
+          userx@???
+       +D >usery:userx@???
+
+TTT   sss 10HmbG-000000005vi-0000 <CALLER@???> *** frozen ***
+          userz@???
+
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+220 ESMTP
+EHLO the.local.host.name
+250-OK
+250 HELP
+MAIL FROM:<CALLER@???>
+250 Sender OK
+RCPT TO:<userx@???>
+250 Recipient OK
+DATA
+350 Send message
+Received: from CALLER by the.local.host.name with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmbG-000000005vi-0000
+    for userz@???;
+    Tue, 2 Mar 1999 09:44:33 +0000
+Subject: freeze this (3)
+Message-Id: <E10HmbG-000000005vi-0000@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+This is a third message to be frozen.
+.
+250 OK
+QUIT
+250 OK
+End of script
diff --git a/test/scripts/0000-Basic/0184 b/test/stdout/4130
similarity index 98%
rename from test/scripts/0000-Basic/0184
rename to test/stdout/4130
index 4110cb126..7c70e0960 100644
--- a/test/scripts/0000-Basic/0184
+++ b/test/stdout/4130
@@ -1,7 +1,5 @@
-# expand very long header in user filter
-exim -odi userx@???
-From: userx@???
-To: 000@???, 001@???, 002@???, 003@???, 004@???,
+To: contains
+000@???, 001@???, 002@???, 003@???, 004@???,
     005@???, 006@???, 007@???, 008@???, 009@???,
     010@???, 011@???, 012@???, 013@???, 014@???,
     015@???, 016@???, 017@???, 018@???, 019@???,
@@ -201,8 +199,4 @@ To: 000@???, 001@???, 002@???, 003@???, 004@???,
     985@???, 986@???, 987@???, 988@???, 989@???,
     990@???, 991@???, 992@???, 993@???, 994@???,
     995@???, 996@???, 997@???, 998@???, 999@???
-
-Here is a very short message.
-.
-****
-no_msglog_check
+nnnnnn
diff --git a/test/stdout/5702 b/test/stdout/4131
similarity index 50%
copy from test/stdout/5702
copy to test/stdout/4131
index 590e16ef2..68425b415 100644
--- a/test/stdout/5702
+++ b/test/stdout/4131
@@ -1,3 +1,6 @@
+TTT   sss 10HmaX-000000005vi-0000 <CALLER@???> *** frozen ***
+          usery@???
+
 
 ******** SERVER ********
 Listening on port 1224 ... 
@@ -6,27 +9,25 @@ Connection request from [127.0.0.1]
 EHLO the.local.host.name
 250-OK
 250 HELP
-MAIL FROM:<CALLER@???>
-250 OK
-RCPT TO:<userx@domain1>
-250 OK
-RCPT TO:<usery@domain1>
-550 Not that one
+MAIL FROM:<CALLER@???>
+250 Sender OK
+RCPT TO:<userx@???>
+250 Recipient OK
 DATA
-354 More...
+350 Send message
 Received: from CALLER by the.local.host.name with local (Exim x.yz)
-    (envelope-from <CALLER@???>)
+    (envelope-from <CALLER@???>)
     id 10HmaX-000000005vi-0000
-    for userx@domain1;
+    for usery@???;
     Tue, 2 Mar 1999 09:44:33 +0000
+Subject: freeze this
 Message-Id: <E10HmaX-000000005vi-0000@???>
-From: CALLER_NAME <CALLER@???>
+From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Also try to deliver this message to usery via a filter deliver command.
-However that fails. But because of the noerror cmd the error just gets ignored.
+This is a message to be frozen.
 .
 250 OK
 QUIT
-220 OK
+250 OK
 End of script
diff --git a/test/stdout/4132 b/test/stdout/4132
new file mode 100644
index 000000000..55a07933b
--- /dev/null
+++ b/test/stdout/4132
@@ -0,0 +1,6 @@
+prefix-filter1.test.ex@???
+    <-- filter1.test.ex@???
+  router = rest, transport = local_delivery
+postmaster@???
+    <-- filter1.test.ex@???
+  router = rest, transport = local_delivery
diff --git a/test/stdout/4133 b/test/stdout/4133
new file mode 100644
index 000000000..97fdce807
--- /dev/null
+++ b/test/stdout/4133
@@ -0,0 +1,16 @@
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 myhost.test.ex Hello CALLER at test
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmbA-000000005vi-0000
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmbB-000000005vi-0000
+250 OK
+250 Accepted
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmbD-000000005vi-0000
+221 myhost.test.ex closing connection
diff --git a/test/stdout/4134 b/test/stdout/4134
new file mode 100644
index 000000000..4bd6a5344
--- /dev/null
+++ b/test/stdout/4134
@@ -0,0 +1 @@
+Message 10HmaX-000000005vi-0000 is no longer frozen
diff --git a/test/stdout/4140 b/test/stdout/4140
new file mode 100644
index 000000000..d6947af8c
--- /dev/null
+++ b/test/stdout/4140
@@ -0,0 +1,8 @@
+/a/b/c@??? -> /a/b/c
+  transport = tf1
+/x/y/z@??? -> /x/y/z
+  transport = tf2
+/a/b/c/@??? -> /a/b/c/
+  transport = td1
+/a/a/b//@??? -> /a/a/b//
+  transport = td2
diff --git a/test/stdout/4142 b/test/stdout/4142
new file mode 100644
index 000000000..dd8b25bcd
--- /dev/null
+++ b/test/stdout/4142
@@ -0,0 +1,12 @@
+Warning: no message headers read
+Return-path copied from sender
+Sender      = CALLER@???
+Recipient   = CALLER@???
+Testing Exim filter file "TESTSUITE/aux-fixed/4142.f-user"
+
+Testprint: 1 Matched c@d
+Testprint: 2 Matched c@d
+Testprint: 3 Matched cc@dd
+Testprint: 4 Matched e@f
+Filtering did not set up a significant delivery.
+Normal delivery will occur.
diff --git a/test/stdout/4151 b/test/stdout/4151
new file mode 100644
index 000000000..76372708e
--- /dev/null
+++ b/test/stdout/4151
@@ -0,0 +1,38 @@
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 myhost.test.ex Hello CALLER at host.name [1.2.3.4]
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaY-000000005vi-0000
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaZ-000000005vi-0000
+221 myhost.test.ex closing connection
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 myhost.test.ex Hello CALLER at host2.name [4.3.2.1]
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaX-000000005vi-0000
+221 myhost.test.ex closing connection
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO test
+??? 250
+<<< 250 myhost.test.ex Hello localhost [127.0.0.1]
+>>> MAIL FROM:<>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<x@y>
+??? 250
+<<< 250 Accepted
+>>> DATA
+??? 354
+<<< 354 Enter message, ending with "." on a line by itself
+>>> .
+??? 250
+<<< 250 OK id=10HmbA-000000005vi-0000
+>>> QUIT
+End of script
diff --git a/test/stdout/4152 b/test/stdout/4152
new file mode 100644
index 000000000..988556e1e
--- /dev/null
+++ b/test/stdout/4152
@@ -0,0 +1,29 @@
+10HmaX-000000005vi-0000-H
+CALLER UID GID
+<CALLER@???>
+ddddddddd 0
+-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
+-ident CALLER
+-received_protocol local
+-body_linecount 0
+-max_received_linelength 0
+-auth_id CALLER
+-auth_sender CALLER@???
+-allow_unqualified_recipient
+-allow_unqualified_sender
+-local
+YY >CALLER@???:aaaa@???
+NN TESTSUITE/test-mail/file:aaaa@???
+NN |/bin/sh -c exit:aaaa@???
+1
+aaaa@???
+
+dddP Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaX-000000005vi-0000
+    for aaaa@???;
+    Tue, 2 Mar 1999 09:44:33 +0000
+054I Message-Id: <E10HmaX-000000005vi-0000@???>
+dddF From: CALLER_NAME <CALLER@???>
+038  Date: Tue, 2 Mar 1999 09:44:33 +0000
diff --git a/test/stdout/4156 b/test/stdout/4156
new file mode 100644
index 000000000..f7defe3e6
--- /dev/null
+++ b/test/stdout/4156
@@ -0,0 +1,71 @@
+Return-path copied from sender
+Sender      = CALLER@???
+Recipient   = CALLER@???
+Testing Exim filter file "TESTSUITE/aux-fixed/4156.f"
+
+Testprint: subject = >lots of leading and trailing space<
+Testprint: raw subject = >       lots of leading and trailing space         \n<
+Testprint: to = >a@b,\nc@d<
+Testprint: raw to = >    a@b    \n    c@d    \n<
+Testprint: rX-1: > (=?ISO-8859-1?Q?a?=)\n<
+Testprint: bX-1: >(a)<
+Testprint:  X-1: >(a)<
+Testprint: rX-2: > (=?ISO-8859-1?Q?a?= b)\n<
+Testprint: bX-2: >(a b)<
+Testprint:  X-2: >(a b)<
+Testprint: rX-3: > (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)\n<
+Testprint: bX-3: >(ab)<
+Testprint:  X-3: >(ab)<
+Testprint: rX-4: > (=?ISO-8859-1?Q?a?=  =?ISO-8859-1?Q?b?=)\n<
+Testprint: bX-4: >(ab)<
+Testprint:  X-4: >(ab)<
+Testprint: rX-5: > (=?ISO-8859-1?Q?a?=  \n     =?ISO-8859-1?Q?b?=)\n<
+Testprint: bX-5: >(ab)<
+Testprint:  X-5: >(ab)<
+Testprint: rX-6: > (=?ISO-8859-1?Q?a_b?=)\n<
+Testprint: bX-6: >(a b)<
+Testprint:  X-6: >(a b)<
+Testprint: rX-7: > (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)\n<
+Testprint: bX-7: >(a b)<
+Testprint:  X-7: >(a b)<
+Testprint: rX-8: > (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)\n<
+Testprint: bX-8: >(\355\345\354\371 \357\341 \351\354\350\364\360)<
+Testprint:  X-8: >(\355\345\354\371 \357\341 \351\354\350\364\360)<
+Testprint: rX-9: > =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <xxx>\n<
+Testprint: bX-9: >Patrik F\344ltstr\366m <xxx><
+Testprint:  X-9: >Patrik F\344ltstr\366m <xxx><
+Testprint: rX-10: > =?US-ASCII?Q?Keith_Moore?= <xxx>\n<
+Testprint: bX-10: >Keith Moore <xxx><
+Testprint:  X-10: >Keith Moore <xxx><
+Testprint: rX-11: > =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <xxx>\n<
+Testprint: bX-11: >Keld J\370rn Simonsen <xxx><
+Testprint:  X-11: >Keld J\370rn Simonsen <xxx><
+Testprint: rX-12: > =?ISO-8859-1?Q?Andr=E9?= Pirard <xxx>\n<
+Testprint: bX-12: >Andr\351 Pirard <xxx><
+Testprint:  X-12: >Andr\351 Pirard <xxx><
+Testprint: rX-13: > =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n<
+Testprint: bX-13: >If you can read this you understand the example.<
+Testprint:  X-13: >If you can read this you understand the example.<
+Testprint: rX-14: > =?ISO-8859-1?Q?X=00Y?=      \n<
+Testprint: bX-14: >X?Y<
+Testprint:  X-14: >X?Y<
+Testprint: rX-15: > =?iso-8859-3?Q?=?= =?US-ASCII?Q?ABCD?= Text\n<
+Testprint: bX-15: >=?iso-8859-3?Q?=?= ABCD Text<
+Testprint:  X-15: >=?iso-8859-3?Q?=?= ABCD Text<
+Testprint: rX-16: > =?iso-8859-3?B?+2?= =?UTF-8?Q?ABCD?= Text\n<
+Testprint: bX-16: >=?iso-8859-3?B?+2?= ABCD Text<
+Testprint:  X-16: >=?iso-8859-3?B?+2?= ABCD Text<
+Testprint: rX-17: > =?UTF-8?Q?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?=\n<
+Testprint: bX-17: >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<
+Testprint:  X-17: >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<
+Testprint: rX-18: > =?UTF-8?Q?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?=\n<
+Testprint: bX-18: >=?UTF-8?Q?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?=<
+Testprint:  X-18: >=?UTF-8?Q?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?=<
+Testprint: rX-19: > =?iso-8859-3?B?=?= =?UTF-8?Q?ABCD?= Text\n<
+Testprint: bX-19: >=?iso-8859-3?B?=?= ABCD Text<
+Testprint:  X-19: >=?iso-8859-3?B?=?= ABCD Text<
+Testprint: rX-20: > =?iso-8859-1?Q?a?= =?ISO-8859-1?Q?x y?= bad because of space\n<
+Testprint: bX-20: >a =?ISO-8859-1?Q?x y?= bad because of space<
+Testprint:  X-20: >a =?ISO-8859-1?Q?x y?= bad because of space<
+Filtering did not set up a significant delivery.
+Normal delivery will occur.
diff --git a/test/stdout/4160 b/test/stdout/4160
deleted file mode 100644
index 7e70360e3..000000000
--- a/test/stdout/4160
+++ /dev/null
@@ -1,458 +0,0 @@
-==========
-# Sieve filter
-if address ["From","To"] "marian@???"
-        { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if address :is "From" "marian@???"
-        { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if address :is "To" "marian@???"
-        { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if address :contains "To" "abcdefgh"
-        { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if address :matches "To" "*abc?efgh*"
-        { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if true { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if false { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if allof (false,false) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if allof (true,false) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if allof (false,true) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if allof (true,true) { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if anyof (false,false) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if anyof (true,false) { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if anyof (false,true) { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if anyof (true,true) { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not anyof (false,false) { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not anyof (true,false) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if not anyof (false,true) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if not anyof (true,true) { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header "to" "MARIAN@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :comparator "i;octet" "to" "MARIAN@???" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header :comparator "i;ascii-casemap" "to" "MARIAN@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-require "envelope";
-if envelope "from" "marian@???" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-require "envelope";
-if envelope "from" "offerqn@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if exists [ "X-NotHere", "X-Notheretoo" ] { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if exists [ "X-NotHere", "Delivered-To" ] { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if exists [ "From", "Delivered-To" ] { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :contains "X-NotHere" "" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header "Delivered-To" "" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header :contains "Delivered-To" "" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :contains "Delivered-To" "rc@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "Delivered-To" ["irc@???"] { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header "Delivered-To" ["irc@???","irc@???","some.one"] { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header "Mime-Version" "1.0" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if false { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if true { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if true { discard; } else { keep; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if false { keep; } else { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if false { keep; } elsif true { discard; } else { keep; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if true { discard; } elsif true { keep; } else { keep; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if false { keep; }
-    else
-    { if true { discard; } else { keep; } }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :matches "to" "MA*AN@abc*fg?.example" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not header :matches "to" "MA?AN@abc*fg?.example" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :matches "to" "*marian@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not header :matches "to" "?marian@???" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :matches "to" "marian@???*" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not header :matches "to" "marian@????" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :matches "x-special1" "\\?*\\*" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header :matches "x-special1" "*\0*" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if not header :matches "x-special1" "*\0*q" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-require "encoded-character";
-if not header :matches "x-special1" "*${hex:00}*" { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if not header :matches "x-special2" "\\?*\\*" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not header :matches "x-special2" "*\0*" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if size :over 400 {
-            discard;
-            }
-==========
-No implicit keep
-==========
-# Sieve filter
-if size :over 4K {
-            discard;
-            }
-==========
-Implicit keep
-==========
-# Sieve filter
-if size :under 4K { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if size :under 400 { discard; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if false { keep; }
-==========
-Implicit keep
-==========
-# no filter line here
-if unknowntest { keep; }
-==========
-Testing forward file file "test-data"
-
-exim: error in forward file: missing or malformed local part (expected word or "<") in "if unknowntest { keep; }"
-==========
-# Sieve filter
-if test keep; }
-==========
-Sieve error: missing test in line 2
-==========
-# Sieve filter
-if test { keep;
-==========
-Sieve error: missing test in line 2
-==========
-# Sieve filter
-if true { unknownaction; }
-==========
-Sieve error: expecting command or closing brace in line 2
-==========
-# Sieve filter
-if true { fileinto abcdefgh; }
-==========
-Sieve error: missing previous require "fileinto"; in line 2
-==========
-# Sieve filter
-require "fileinto";
-if true { fileinto "abcdefgh"; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header ["to"] [ "marian@???", "achnee"] { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "to" [ "egal", "achnee" { keep; }
-==========
-Sieve error: missing string list in line 2
-==========
-# Sieve filter
-if header "to","from"] "egal" { keep; }
-==========
-Sieve error: key string list expected in line 2
-==========
-# Sieve filter
-if header ["to","from" "egal" { keep; }
-==========
-Sieve error: missing string list in line 2
-==========
-# Sieve filter
-if header ["to",,"from"] "egal" { keep; }
-==========
-Sieve error: missing string list in line 2
-==========
-# Sieve filter
-if header ["to",] "egal" { keep; }
-==========
-Sieve error: missing string list in line 2
-==========
-# Sieve filter
-if header [,"to"] "egal" { keep; }
-==========
-Sieve error: missing string list in line 2
-==========
-# Sieve filter
-if unknowntest { keep; }
-==========
-Sieve error: missing test in line 2
-==========
-# Sieve filter
-if header :matches "to" "egal" { keep; }
-==========
-Implicit keep
-==========
-# Sieve filter
-if header :unknown "to" "egal" { keep; }
-==========
-Sieve error: header string list expected in line 2
-==========
-# Sieve filter
-#
-require ["fileinto", "envelope"];
-
-if header :matches "X-Warning" "* is listed at list.dsbl.org*"
-            {
-            keep;               # keep in "In" folder
-            }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-1" "1" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if not header "x-1" "=?ISO-8859-1?Q?=31?=" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-1b" "=?ISO-8859-1?Q?=31=" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-b64" "This is BASE64" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-b64-broken" "=?iso-8859-1?b?VGhpcyBpcyBCQVNFNjQ?=" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-q75total" "0123456789012345678901234567890123456789012345678901234567" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-q76total" "=?ISO-8859-1?Q?01234567890123456789012345678901234567890123456789012345678?=" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "X-Wrapped" "eins zwei  drei" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-nomimewrap" "=?iso-8859-1?q?abc def  ghi?=" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "subject" "abcdefghi" { discard; }
-==========
-No implicit keep
-==========
-# Sieve filter
-if header "x-mixed" "abc def" { discard; }
-==========
-No implicit keep
-==========
-#Sieve filter
-if true { stop; fileinto "inbox.never"; }
-==========
-Implicit keep
diff --git a/test/stdout/4162 b/test/stdout/4162
new file mode 100644
index 000000000..f1106d184
--- /dev/null
+++ b/test/stdout/4162
@@ -0,0 +1,23 @@
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> helo rhu.barb
+??? 250
+<<< 250 myhost.test.ex Hello rhu.barb [127.0.0.1]
+>>> mail from:<userx@???>
+??? 250
+<<< 250 OK
+>>> rcpt to:<userx@???>
+??? 250
+<<< 250 Accepted
+>>> DATA
+??? 3
+<<< 354 Enter message, ending with "." on a line by itself
+>>> This is a test message.
+>>> .
+??? 250
+<<< 250 OK id=10HmaX-000000005vi-0000
+>>> QUIT
+??? 221
+<<< 221 myhost.test.ex closing connection
+End of script
diff --git a/test/stdout/4163 b/test/stdout/4163
deleted file mode 100644
index 8a9ae2366..000000000
--- a/test/stdout/4163
+++ /dev/null
@@ -1,80 +0,0 @@
-Connecting to 127.0.0.1 port 1225 ... connected
-??? 220
-<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
->>> HELO tester
-??? 250
-<<< 250 myhost.test.ex Hello tester [127.0.0.1]
->>> MAIL FROM:<implcit@???>
-??? 250
-<<< 250 OK
->>> RCPT TO:<CALLER@???>
-??? 250
-<<< 250 Accepted
->>> DATA
-??? 354
-<<< 354 Enter message, ending with "." on a line by itself
->>> From: <good@???>
->>> Subject: this should be accepted and filed
->>> 
->>> a single body line
->>> .
-??? 250
-<<< 250 OK id=10HmaX-000000005vi-0000
->>> RSET
-??? 250
-<<< 250 Reset OK
-+++ 1
->>> MAIL FROM:<discard@???>
-??? 250
-<<< 250 OK
->>> RCPT TO:<CALLER@???>
-??? 250
-<<< 250 Accepted
->>> DATA
-??? 354
-<<< 354 Enter message, ending with "." on a line by itself
->>> From: <coyote@???>
->>> Subject: this should be discarded by the filter
->>> .
-??? 250
-<<< 250 OK id=10HmaY-000000005vi-0000
->>> RSET
-??? 250
-<<< 250 Reset OK
-+++ 1
->>> MAIL FROM:<identified@???>
-??? 250
-<<< 250 OK
->>> RCPT TO:<CALLER@???>
-??? 250
-<<< 250 Accepted
->>> DATA
-??? 354
-<<< 354 Enter message, ending with "." on a line by itself
->>> From: <spot_this@???>
->>> Subject: this should be delivered to a speicifc place by the filter
->>> .
-??? 250
-<<< 250 OK id=10HmaZ-000000005vi-0000
->>> RSET
-??? 250
-<<< 250 Reset OK
-+++ 1
->>> MAIL FROM:<redirect@???>
-??? 250
-<<< 250 OK
->>> RCPT TO:<CALLER@???>
-??? 250
-<<< 250 Accepted
->>> DATA
-??? 354
-<<< 354 Enter message, ending with "." on a line by itself
->>> From: <redirect@???>
->>> Subject: this should be redirected by the filter to a different address
->>> .
-??? 250
-<<< 250 OK id=10HmbA-000000005vi-0000
->>> QUIT
-??? 221
-<<< 221 myhost.test.ex closing connection
-End of script
diff --git a/test/stdout/4165 b/test/stdout/4165
new file mode 100644
index 000000000..7adebdf29
--- /dev/null
+++ b/test/stdout/4165
@@ -0,0 +1,24 @@
+Return-path copied from sender
+Sender      = sen@???
+Recipient   = CALLER@???
+Testing Exim filter file "TESTSUITE/aux-fixed/4165.sfilter"
+
+Testprint: --------System filter---------
+Testprint: Sender:  sen@???
+Testprint: Subject: test 1
+Testprint: Body:    Body content. 
+Headers add "X-Header: Added in a system filter"
+Add 3 to n1
+Testprint: n1:      3
+Filtering did not set up a significant delivery.
+Normal delivery will occur.
+Testing Exim filter file "TESTSUITE/aux-fixed/4165.ufilter"
+
+Testprint: --------User filter---------
+Testprint: Sender:  sen@???
+Testprint: Subject:  test 1
+Testprint: Body:     Body content. 
+Testprint: X-Header: Added in a system filter
+Testprint: sn1:      3
+Filtering did not set up a significant delivery.
+Normal delivery will occur.
diff --git a/test/stdout/5702 b/test/stdout/4166
similarity index 76%
copy from test/stdout/5702
copy to test/stdout/4166
index 590e16ef2..f18163d4f 100644
--- a/test/stdout/5702
+++ b/test/stdout/4166
@@ -6,7 +6,7 @@ Connection request from [127.0.0.1]
 EHLO the.local.host.name
 250-OK
 250 HELP
-MAIL FROM:<CALLER@???>
+MAIL FROM:<dump@domain1>
 250 OK
 RCPT TO:<userx@domain1>
 250 OK
@@ -23,8 +23,7 @@ Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Also try to deliver this message to usery via a filter deliver command.
-However that fails. But because of the noerror cmd the error just gets ignored.
+This message will also be delivered to usery
 .
 250 OK
 QUIT
diff --git a/test/stdout/5702 b/test/stdout/4167
similarity index 76%
rename from test/stdout/5702
rename to test/stdout/4167
index 590e16ef2..f18163d4f 100644
--- a/test/stdout/5702
+++ b/test/stdout/4167
@@ -6,7 +6,7 @@ Connection request from [127.0.0.1]
 EHLO the.local.host.name
 250-OK
 250 HELP
-MAIL FROM:<CALLER@???>
+MAIL FROM:<dump@domain1>
 250 OK
 RCPT TO:<userx@domain1>
 250 OK
@@ -23,8 +23,7 @@ Message-Id: <E10HmaX-000000005vi-0000@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 
-Also try to deliver this message to usery via a filter deliver command.
-However that fails. But because of the noerror cmd the error just gets ignored.
+This message will also be delivered to usery
 .
 250 OK
 QUIT
diff --git a/test/stdout/5703 b/test/stdout/5703
index c171ca3b5..d2c78b4a2 100644
--- a/test/stdout/5703
+++ b/test/stdout/5703
@@ -1,17 +1,71 @@
-
-******** SERVER ********
-Listening on port 1224 ... 
-Connection request from [127.0.0.1]
-220 ESMTP
-EHLO the.local.host.name
-250-OK
-250 HELP
-MAIL FROM:<CALLER@???>
-250 OK
-RCPT TO:<usery@domain1>
-550 Not that one
-QUIT
-220 OK
-Listening on port 1224 ... 
-Connection request from [127.0.0.1]
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO nonexistent.test.ex
+??? 250
+<<< 250 myhost.test.ex Hello nonexistent.test.ex [127.0.0.1]
+>>> MAIL FROM:<a@b>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<c@d>
+??? 550
+<<< 550 Administrative prohibition
+>>> QUIT
+??? 221
+<<< 221 myhost.test.ex closing connection
+End of script
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO badcname.test.ex
+??? 250
+<<< 250 myhost.test.ex Hello badcname.test.ex [127.0.0.1]
+>>> MAIL FROM:<a@b>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<c@d>
+??? 550
+<<< 550 Administrative prohibition
+>>> QUIT
+??? 221
+<<< 221 myhost.test.ex closing connection
+End of script
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO test.again.dns
+??? 250
+<<< 250 myhost.test.ex Hello test.again.dns [127.0.0.1]
+>>> MAIL FROM:<a@b>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<c@d>
+??? 550
+<<< 550 Administrative prohibition
+>>> QUIT
+??? 221
+<<< 221 myhost.test.ex closing connection
+End of script
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO localhost
+??? 250
+<<< 250 myhost.test.ex Hello localhost [127.0.0.1]
+>>> MAIL FROM:<a@b>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<bad_A@???>
+??? 250 Accepted
+<<< 250 Accepted
+>>> DATA
+??? 354
+<<< 354 Enter message, ending with "." on a line by itself
+>>> Subject: test
+>>> .
+??? 250
+<<< 250 OK id=10HmaX-000000005vi-0000
+>>> QUIT
+??? 221
+<<< 221 myhost.test.ex closing connection
 End of script


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/