From 6073ad45c336ac31081bb1625f5415dc41344641 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 8 May 2016 01:05:54 +0100 Subject: [PATCH] testcase --- doc/doc-docbook/spec.xfpt | 7 ++++++ src/src/exim.c | 8 +++++-- src/src/queue.c | 13 +++++++++-- test/confs/0574 | 45 ++++++++++++++++++++++++++++++++++++ test/log/0574 | 17 ++++++++++++++ test/scripts/0000-Basic/0574 | 36 +++++++++++++++++++++++++++++ test/stdout/0574 | 11 +++++++++ 7 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 test/confs/0574 create mode 100644 test/log/0574 create mode 100644 test/scripts/0000-Basic/0574 create mode 100644 test/stdout/0574 diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 8b615f831..4bc2e1118 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -3825,11 +3825,13 @@ This option is not intended for use by external callers. It is used internally by Exim in conjunction with the &%-MC%& option. It signifies that the remote host supports the ESMTP &_DSN_& extension. +.new .vitem &%-MCG%& .oindex "&%-MCG%&" This option is not intended for use by external callers. It is used internally by Exim in conjunction with the &%-MC%& option. It signifies that an alternate queue is used, named by the following option. +.wen .vitem &%-MCP%& .oindex "&%-MCP%&" @@ -4462,6 +4464,7 @@ The &'l'& (the letter &"ell"&) flag specifies that only local deliveries are to be done. If a message requires any remote deliveries, it remains on the queue for later delivery. +.new .vitem &%-q[q][i][f[f]][l][G]%& .oindex "&%-qG%&" .cindex queue named @@ -4471,6 +4474,7 @@ If the &'G'& flag and a name is present, the queue runner operates on the queue with the given name rather than the default queue. Because the name is the remainder of the option string, any periodic-run interval must be given as a separate &%-q%& option. +.wen .vitem &%-q%&<&'qflags'&>&~<&'start&~id'&>&~<&'end&~id'&> When scanning the queue, Exim can be made to skip over messages whose ids are @@ -28583,12 +28587,15 @@ all the conditions are true, wherever it appears in an ACL command, whereas effect. +.new .vitem &*queue*&&~=&~<&'text'&> This modifier specifies the use of a named queue for spool files for the message. This could be used, for example, for known high-volume burst sources of traffic, or for quarantine of messages. Separate queue-runner processes will be needed for named queues. +If the text after expansion is empty, the default queue is used. +.wen .vitem &*remove_header*&&~=&~<&'text'&> diff --git a/src/src/exim.c b/src/src/exim.c index 6432a4c2f..e4597c287 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -3243,7 +3243,7 @@ for (i = 1; i < argc; i++) if (*argrest == 'G') { - queue_name = string_copy(argrest); + queue_name = string_copy(argrest+1); do ++argrest; while (*argrest); } @@ -4675,7 +4675,11 @@ if (queue_interval == 0 && !daemon_listen) (start_queue_run_id == NULL)? US"" : start_queue_run_id, (stop_queue_run_id == NULL)? US"" : US" stopping at ", (stop_queue_run_id == NULL)? US"" : stop_queue_run_id); - set_process_info("running the queue (single queue run)"); + if (*queue_name) + set_process_info(CS string_sprintf( + "running the '%s' queue (single queue run)", queue_name)); + else + set_process_info("running the queue (single queue run)"); queue_run(start_queue_run_id, stop_queue_run_id, FALSE); exim_exit(EXIT_SUCCESS); } diff --git a/src/src/queue.c b/src/src/queue.c index c97179092..b6dff1107 100644 --- a/src/src/queue.c +++ b/src/src/queue.c @@ -391,7 +391,11 @@ if (!recurse) } log_detail = string_copy(big_buffer); - log_write(L_queue_run, LOG_MAIN, "Start queue run: %s", log_detail); + if (*queue_name) + log_write(L_queue_run, LOG_MAIN, "Start '%s' queue run: %s", + queue_name, log_detail); + else + log_write(L_queue_run, LOG_MAIN, "Start queue run: %s", log_detail); } /* If deliver_selectstring is a regex, compile it. */ @@ -700,7 +704,12 @@ if (queue_2stage) /* At top level, log the end of the run. */ -if (!recurse) log_write(L_queue_run, LOG_MAIN, "End queue run: %s", log_detail); +if (!recurse) + if (*queue_name) + log_write(L_queue_run, LOG_MAIN, "End '%s' queue run: %s", + queue_name, log_detail); + else + log_write(L_queue_run, LOG_MAIN, "End queue run: %s", log_detail); } diff --git a/test/confs/0574 b/test/confs/0574 new file mode 100644 index 000000000..aa3e93a9e --- /dev/null +++ b/test/confs/0574 @@ -0,0 +1,45 @@ +# Exim test configuration 0574 + +SERVER = + +exim_path = EXIM_PATH +keep_environment = +host_lookup_order = bydns +spool_directory = DIR/spool +log_file_path = DIR/spool/log/SERVER%slog +gecos_pattern = "" +gecos_name = CALLER_NAME +tls_advertise_hosts = + +log_selector = +received_recipients +sender_on_delivery + +acl_smtp_rcpt = accept queue = \ + ${if or {{eq {SERVER}{server}}{eq {normal}{$local_part}}} {} {$local_part}} +queue_only +queue_run_in_order + +#--------------- + +begin routers + +dump: + driver = redirect + condition = ${if eq {SERVER}{server}{yes}{no}} + data = :blackhole: + +all: + driver = manualroute + route_list = * 127.0.0.1 + self = send + transport = out + +#--------------- + +begin transports + +out: + driver = smtp + port = PORT_D + +# End + diff --git a/test/log/0574 b/test/log/0574 new file mode 100644 index 000000000..cf13480bc --- /dev/null +++ b/test/log/0574 @@ -0,0 +1,17 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss for normal@test.ex +1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss for alternate@test.ex +1999-03-02 09:44:33 Start queue run: pid=pppp -qq +1999-03-02 09:44:33 10HmaX-0005vi-00 => normal@test.ex F= R=all T=out H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaZ-0005vi-00" +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 End queue run: pid=pppp -qq +1999-03-02 09:44:33 Start 'nosuchqueue' queue run: pid=pppp +1999-03-02 09:44:33 End 'nosuchqueue' queue run: pid=pppp +1999-03-02 09:44:33 Start 'alternate' queue run: pid=pppp +1999-03-02 09:44:33 10HmaY-0005vi-00 => alternate@test.ex F= R=all T=out H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbA-0005vi-00" +1999-03-02 09:44:33 10HmaY-0005vi-00 Completed +1999-03-02 09:44:33 End 'alternate' queue run: pid=pppp + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@the.local.host.name H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for normal@test.ex +1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@the.local.host.name H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaY-0005vi-00@the.local.host.name for alternate@test.ex diff --git a/test/scripts/0000-Basic/0574 b/test/scripts/0000-Basic/0574 new file mode 100644 index 000000000..53f7a5da1 --- /dev/null +++ b/test/scripts/0000-Basic/0574 @@ -0,0 +1,36 @@ +# named queues +# Exim test configuration 0574 +# +exim -DSERVER=server -bd -oX PORT_D +**** +# +exim -bs +MAIL FROM: +RCPT TO: +DATA +Subject: test + +foo +. +RSET +MAIL FROM: +RCPT TO: +DATA +Subject: test + +foo +. +QUIT +**** +# +exim -qq +**** +# +exim -qGnosuchqueue +**** +# +exim -qGalternate +**** +# +killdaemon +no_msglog_check diff --git a/test/stdout/0574 b/test/stdout/0574 new file mode 100644 index 000000000..47285d74a --- /dev/null +++ b/test/stdout/0574 @@ -0,0 +1,11 @@ +220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaX-0005vi-00 +250 Reset OK +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaY-0005vi-00 +221 the.local.host.name closing connection -- 2.30.2