queue_run_max main option expanded, allowing per-queue values
12 files changed:
The value set for the &%qualify_recipient%& option in the configuration file,
or if not set, the value of &$qualify_domain$&.
The value set for the &%qualify_recipient%& option in the configuration file,
or if not set, the value of &$qualify_domain$&.
+.new
+.vitem &$queue_name$&
+.vindex &$queue_name$&
+.cindex "named queues"
+.cindex queues named
+The name of the spool queue in use; empty for the default queue.
+.wen
+
.vitem &$rcpt_count$&
.vindex "&$rcpt_count$&"
When a message is being received by SMTP, this variable contains the number of
.vitem &$rcpt_count$&
.vindex "&$rcpt_count$&"
When a message is being received by SMTP, this variable contains the number of
-.option queue_run_max main integer 5
+.option queue_run_max main integer&!! 5
.cindex "queue runner" "maximum number of"
This controls the maximum number of queue runner processes that an Exim daemon
can run simultaneously. This does not mean that it starts them all at once,
.cindex "queue runner" "maximum number of"
This controls the maximum number of queue runner processes that an Exim daemon
can run simultaneously. This does not mean that it starts them all at once,
run. If you do not want queue runs to occur, omit the &%-q%&&'xx'& setting on
the daemon's command line.
run. If you do not want queue runs to occur, omit the &%-q%&&'xx'& setting on
the daemon's command line.
+.new
+.cindex queues named
+.condex "named queues"
+To set limits for different named queues use
+an expansion depending on the &$queue_name$& variable.
+.wen
+
.option queue_smtp_domains main "domain list&!!" unset
.cindex "queueing incoming messages"
.cindex "message" "queueing remote deliveries"
.option queue_smtp_domains main "domain list&!!" unset
.cindex "queueing incoming messages"
.cindex "message" "queueing remote deliveries"
1. The new perl_tainmode option allows to run the embedded perl
interpreter in taint mode.
1. The new perl_tainmode option allows to run the embedded perl
interpreter in taint mode.
- 2. Facility for named queues. A commandline argument can specify
+ 2. Facility for named queues: A commandline argument can specify
the queue name for a queue-runner, and an ACL modifier can set
the queue name for a queue-runner, and an ACL modifier can set
- the queue to be used for a message.
+ the queue to be used for a message. A $queue_name variable gives
+ visibility.
/* If it wasn't an accepting process, see if it was a queue-runner
process that we are tracking. */
/* If it wasn't an accepting process, see if it was a queue-runner
process that we are tracking. */
- if (queue_pid_slots != NULL)
- for (i = 0; i < queue_run_max; i++)
- {
+ int max = atoi(expand_string(queue_run_max));
+ for (i = 0; i < max; i++)
if (queue_pid_slots[i] == pid)
{
queue_pid_slots[i] = 0;
if (queue_pid_slots[i] == pid)
{
queue_pid_slots[i] = 0;
queue_run_count, (queue_run_count == 1)? "" : "es");
break;
}
queue_run_count, (queue_run_count == 1)? "" : "es");
break;
}
int listen_socket_count = 0;
ip_address_item *addresses = NULL;
time_t last_connection_time = (time_t)0;
int listen_socket_count = 0;
ip_address_item *addresses = NULL;
time_t last_connection_time = (time_t)0;
+int local_queue_run_max = atoi(expand_string(queue_run_max));
/* If any debugging options are set, turn on the D_pid bit so that all
debugging lines get the pid added. */
/* If any debugging options are set, turn on the D_pid bit so that all
debugging lines get the pid added. */
/* Get somewhere to keep the list of queue-runner pids if we are keeping track
of them (and also if we are doing queue runs). */
/* Get somewhere to keep the list of queue-runner pids if we are keeping track
of them (and also if we are doing queue runs). */
-if (queue_interval > 0 && queue_run_max > 0)
+if (queue_interval > 0 && local_queue_run_max > 0)
- queue_pid_slots = store_get(queue_run_max * sizeof(pid_t));
- for (i = 0; i < queue_run_max; i++) queue_pid_slots[i] = 0;
+ queue_pid_slots = store_get(local_queue_run_max * sizeof(pid_t));
+ for (i = 0; i < local_queue_run_max; i++) queue_pid_slots[i] = 0;
}
/* Set up the handler for termination of child processes. */
}
/* Set up the handler for termination of child processes. */
re-exec is required. */
if (queue_interval > 0 &&
re-exec is required. */
if (queue_interval > 0 &&
- (queue_run_max <= 0 || queue_run_count < queue_run_max))
+ (local_queue_run_max <= 0 || queue_run_count < local_queue_run_max))
{
if ((pid = fork()) == 0)
{
{
if ((pid = fork()) == 0)
{
- for (i = 0; i < queue_run_max; ++i)
- {
+ for (i = 0; i < local_queue_run_max; ++i)
if (queue_pid_slots[i] <= 0)
{
queue_pid_slots[i] = pid;
queue_run_count++;
break;
}
if (queue_pid_slots[i] <= 0)
{
queue_pid_slots[i] = pid;
queue_run_count++;
break;
}
DEBUG(D_any) debug_printf("%d queue-runner process%s running\n",
queue_run_count, (queue_run_count == 1)? "" : "es");
}
DEBUG(D_any) debug_printf("%d queue-runner process%s running\n",
queue_run_count, (queue_run_count == 1)? "" : "es");
}
{ "prvscheck_result", vtype_stringptr, &prvscheck_result },
{ "qualify_domain", vtype_stringptr, &qualify_domain_sender },
{ "qualify_recipient", vtype_stringptr, &qualify_domain_recipient },
{ "prvscheck_result", vtype_stringptr, &prvscheck_result },
{ "qualify_domain", vtype_stringptr, &qualify_domain_sender },
{ "qualify_recipient", vtype_stringptr, &qualify_domain_recipient },
+ { "queue_name", vtype_stringptr, &queue_name },
{ "rcpt_count", vtype_int, &rcpt_count },
{ "rcpt_defer_count", vtype_int, &rcpt_defer_count },
{ "rcpt_fail_count", vtype_int, &rcpt_fail_count },
{ "rcpt_count", vtype_int, &rcpt_count },
{ "rcpt_defer_count", vtype_int, &rcpt_defer_count },
{ "rcpt_fail_count", vtype_int, &rcpt_fail_count },
BOOL queue_run_force = FALSE;
BOOL queue_run_in_order = FALSE;
BOOL queue_run_local = FALSE;
BOOL queue_run_force = FALSE;
BOOL queue_run_in_order = FALSE;
BOOL queue_run_local = FALSE;
+uschar *queue_run_max = US"5";
pid_t queue_run_pid = (pid_t)0;
int queue_run_pipe = -1;
BOOL queue_running = FALSE;
pid_t queue_run_pid = (pid_t)0;
int queue_run_pipe = -1;
BOOL queue_running = FALSE;
extern BOOL queue_only_override; /* Allow override from command line */
extern BOOL queue_only_policy; /* ACL or local_scan wants queue_only */
extern BOOL queue_run_in_order; /* As opposed to random */
extern BOOL queue_only_override; /* Allow override from command line */
extern BOOL queue_only_policy; /* ACL or local_scan wants queue_only */
extern BOOL queue_run_in_order; /* As opposed to random */
-extern int queue_run_max; /* Max queue runners */
+extern uschar *queue_run_max; /* Max queue runners */
extern BOOL queue_smtp; /* Disable all immediate STMP (-odqs)*/
extern uschar *queue_smtp_domains; /* Ditto, for these domains */
extern BOOL queue_smtp; /* Disable all immediate STMP (-odqs)*/
extern uschar *queue_smtp_domains; /* Ditto, for these domains */
{ "queue_only_load_latch", opt_bool, &queue_only_load_latch },
{ "queue_only_override", opt_bool, &queue_only_override },
{ "queue_run_in_order", opt_bool, &queue_run_in_order },
{ "queue_only_load_latch", opt_bool, &queue_only_load_latch },
{ "queue_only_override", opt_bool, &queue_only_override },
{ "queue_run_in_order", opt_bool, &queue_run_in_order },
- { "queue_run_max", opt_int, &queue_run_max },
+ { "queue_run_max", opt_stringptr, &queue_run_max },
{ "queue_smtp_domains", opt_stringptr, &queue_smtp_domains },
{ "receive_timeout", opt_time, &receive_timeout },
{ "received_header_text", opt_stringptr, &received_header_text },
{ "queue_smtp_domains", opt_stringptr, &queue_smtp_domains },
{ "receive_timeout", opt_time, &receive_timeout },
{ "received_header_text", opt_stringptr, &received_header_text },
queue_only_file = /var/spool/exim/queue_only
queue_only_load = 8.2
no_queue_run_in_order
queue_only_file = /var/spool/exim/queue_only
queue_only_load = 8.2
no_queue_run_in_order
+queue_run_max = ${if = {1}{1} {5}{10}}
queue_smtp_domains = x.y.z
receive_timeout = 0s
received_header_text = Received: ${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}{${if def:sender_ident {from ${sender_ident} }}${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}by ${primary_hostname} ${if def:received_protocol {with ${received_protocol}}} (Exim ${version_number} #${compile_number})\n\tid ${message_id}${if def:received_for {\n\tfor $received_for}}
queue_smtp_domains = x.y.z
receive_timeout = 0s
received_header_text = Received: ${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}{${if def:sender_ident {from ${sender_ident} }}${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}by ${primary_hostname} ${if def:received_protocol {with ${received_protocol}}} (Exim ${version_number} #${compile_number})\n\tid ${message_id}${if def:received_for {\n\tfor $received_for}}
log_selector = +received_recipients +sender_on_delivery
log_selector = +received_recipients +sender_on_delivery
-acl_smtp_rcpt = accept queue = ${if eq {normal}{$local_part} {} {$local_part}}
queue_only
queue_run_in_order
#---------------
queue_only
queue_run_in_order
#---------------
+begin acl
+
+rcpt:
+ accept
+ queue = ${if eq {normal}{$local_part} {} {$local_part}}
+ logwrite = using queue '$queue_name'
+
+#---------------
+
+1999-03-02 09:44:33 using queue ''
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 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 using queue 'alternate'
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss Q=alternate 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 <normal@test.ex> F=<CALLER@the.local.host.name> R=all T=dump
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss Q=alternate 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 <normal@test.ex> F=<CALLER@the.local.host.name> R=all T=dump
1999-03-02 09:44:33 10HmaY-0005vi-00 => alternate <alternate@test.ex> F=<CALLER@the.local.host.name> Q=alternate R=all T=dump
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
1999-03-02 09:44:33 End 'alternate' queue run: pid=pppp
1999-03-02 09:44:33 10HmaY-0005vi-00 => alternate <alternate@test.ex> F=<CALLER@the.local.host.name> Q=alternate R=all T=dump
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
1999-03-02 09:44:33 End 'alternate' queue run: pid=pppp
+1999-03-02 09:44:33 using queue 'lowpri'
1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss Q=lowpri for lowpri@test.ex
******** SERVER ********
1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss Q=lowpri for lowpri@test.ex
******** SERVER ********
qualify_domain: $qualify_domain
bounce_return_size_limit: ${bounce_return_size_limit}
spool_directory: $spool_directory
qualify_domain: $qualify_domain
bounce_return_size_limit: ${bounce_return_size_limit}
spool_directory: $spool_directory
unknown: ${unknown}
h_subject: $h_subject:(should be empty)
h_subject:$h_subject (should be empty)
unknown: ${unknown}
h_subject: $h_subject:(should be empty)
h_subject:$h_subject (should be empty)
> qualify_domain: myhost.test.ex
> bounce_return_size_limit: 102400
> spool_directory: TESTSUITE/spool
> qualify_domain: myhost.test.ex
> bounce_return_size_limit: 102400
> spool_directory: TESTSUITE/spool
> Failed: unknown variable in "${unknown}"
> h_subject: (should be empty)
> h_subject: (should be empty)
> Failed: unknown variable in "${unknown}"
> h_subject: (should be empty)
> h_subject: (should be empty)