From c4d5e329acddb83df43254990f98c53cd5b1fbf7 Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12-RIPE)" Date: Mon, 18 Sep 2017 22:56:36 +0200 Subject: [PATCH] exipick: add -C|--config option This fits better to echo test | exim -C /tmp/test.conf -v test@example.com exipick -C /tmp/test.conf --- doc/doc-txt/NewStuff | 3 +++ src/src/exipick.src | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 1948641c9..d975fe14a 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -55,6 +55,9 @@ Version 4.90 13. DKIM support for multiple signing, by domain and/or key-selector. DKIM support for multiple hashes. +14. Exipick understands -C|--config for an alternative Exim + configuration file. + Version 4.89 ------------ diff --git a/src/src/exipick.src b/src/src/exipick.src index 4999d843f..4751f7657 100644 --- a/src/src/exipick.src +++ b/src/src/exipick.src @@ -42,6 +42,7 @@ $| = 1; # unbuffer STDOUT Getopt::Long::Configure("bundling_override"); GetOptions( 'spool=s' => \$G::spool, # exim spool dir + 'C|Config=s' => \$G::config, # use alternative Exim configuration file 'input-dir=s' => \$G::input_dir, # name of the "input" dir 'finput' => \$G::finput, # same as "--input-dir Finput" 'bp' => \$G::mailq_bp, # List the queue (noop - default) @@ -115,8 +116,8 @@ $G::msg_ids = {}; # short circuit when crit is only MID $G::caseless = $G::caseful ? 0 : 1; # nocase by default, case if both @G::recipients_crit = (); # holds per-recip criteria $spool = defined $G::spool ? $G::spool - : do { chomp($_ = `$exim -n -bP spool_directory`); - $_ // $spool }; + : do { chomp($_ = `$exim @{[defined $G::config ? "-C $G::config" : '']} -n -bP spool_directory`) + and $_ or $spool }; my $input_dir = $G::input_dir || ($G::finput ? "Finput" : "input"); my $count_only = 1 if ($G::mailq_bpc || $G::qgrep_c); my $unsorted = 1 if ($G::mailq_bpr || $G::mailq_bpra || @@ -1354,6 +1355,11 @@ Same as '-bpu --unsorted' (exim) Same as -bp, but only show undelivered messages (exim) +=item -C | --config + +Use to determine the proper spool directory. (See C<--spool> +or C<--input> for alternative ways to specify the directories to operate on.) + =item -c Show a count of matching messages (exiqgrep) @@ -1432,8 +1438,7 @@ Same as '$shown_message_size eq ' (exiqgrep) =item --spool -Set the path to the exim spool to use. This value will have the argument to --input or 'input' appended, or be ignored if --input is a full path. If not specified, exipick uses the value from C, and if this fails, the F -from build time (F) is used. +Set the path to the exim spool to use. This value will have the argument to --input or 'input' appended, or be ignored if --input is a full path. If not specified, exipick uses the value from C, and if this call fails, the F from build time (F) is used. See also --config. =item --show-rules -- 2.30.2