From 9815773952dd56fe4d33291ace6d0ee7afd77852 Mon Sep 17 00:00:00 2001 From: Todd Lyons Date: Wed, 4 Sep 2013 13:12:54 -0700 Subject: [PATCH] Make sender/recipient search case-insensitive --- doc/doc-docbook/spec.xfpt | 8 ++++---- doc/doc-txt/ChangeLog | 2 ++ src/src/exiqgrep.src | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index ae6e33efe..ad4df88ea 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -34435,14 +34435,14 @@ options are available: .vlist .vitem &*-f*&&~<&'regex'&> -Match the sender address. The field that is tested is enclosed in angle -brackets, so you can test for bounce messages with +Match the sender address using a case-insensitive search. The field that is +tested is enclosed in angle brackets, so you can test for bounce messages with .code exiqgrep -f '^<>$' .endd .vitem &*-r*&&~<&'regex'&> -Match a recipient address. The field that is tested is not enclosed in angle -brackets. +Match a recipient address using a case-insensitve search. The field that is +tested is not enclosed in angle brackets. .vitem &*-s*&&~<&'regex'&> Match against the size field. diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index d8990102d..b2a31442a 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -49,6 +49,8 @@ TL/06 Add Experimental DMARC support using libopendmarc libraries. TL/07 Fix an out of order global option causing a segfault. Reported to dev mailing list by by Dmitry Isaikin. +TL/08 Adjust exiqgrep to be case-insensitive for sender/receiver. + JH/01 Bugzilla 1201 & 304 - New cutthrough-delivery feature, with TLS support. JH/02 Support "G" suffix to numbers in ${if comparisons. diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src index 75265a2bb..e05589073 100644 --- a/src/src/exiqgrep.src +++ b/src/src/exiqgrep.src @@ -15,7 +15,7 @@ # Routine for extracting the UTC timestamp from message ID # lifted from eximstat utility -# Version 1.1 +# Version 1.2 use strict; use Getopt::Std; @@ -115,13 +115,13 @@ sub selection() { foreach my $msg (keys(%id)) { if ($opt{f}) { # Match sender address - next unless ($id{$msg}{from} =~ /$opt{f}/); + next unless ($id{$msg}{from} =~ /$opt{f}/i); } if ($opt{r}) { # Match any recipient address my $match = 0; foreach my $rcpt (@{$id{$msg}{rcpt}}) { - $match++ if ($rcpt =~ /$opt{r}/); + $match++ if ($rcpt =~ /$opt{r}/i); } next unless ($match); } -- 2.25.1