DKIM: rename internal signing api
[exim.git] / src / src / exiqgrep.src
index 05c1b9ed06ef9ee43212ef9ef1e39798ce71a495..d900e99337a49be8709277bae1eb0d203f34aa22 100644 (file)
@@ -18,6 +18,7 @@
 # Version 1.2
 
 use strict;
+BEGIN { pop @INC if $INC[-1] eq '.' };
 use Getopt::Std;
 
 # Have this variable point to your exim binary.
@@ -43,9 +44,11 @@ if ($^O eq 'darwin') { # aka MacOS X
   $base = 62;
 };
 
-getopts('hf:r:y:o:s:zxlibRca',\%opt);
+getopts('hf:r:y:o:s:C:zxlibRca',\%opt);
+if ($ARGV[0]) { &help; exit;}
 if ($opt{h}) { &help; exit;}
 if ($opt{a}) { $eargs = '-bp'; }
+if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; }
 
 # Read message queue output into hash
 &collect();
@@ -61,6 +64,7 @@ sub help() {
 Exim message queue display utility.
 
        -h              This help message.
+       -C              Specify which exim.conf to use.
 
 Selection criteria:
        -f <regexp>     Match sender address sender (field is "< >" wrapped)
@@ -84,7 +88,7 @@ EOF
 }
 
 sub collect() {
-       open(QUEUE,"$exim $eargs |") or die("Error openning pipe: $!\n");
+       open(QUEUE,"$exim $eargs |") or die("Error opening pipe: $!\n");
        while(<QUEUE>) {
                chomp();
                my $line = $_;