My mail queue is currently full of bounce messages for the same domain, but in mixed case.
I tried using exiqgrep
to filter these mails from my queue, but it seems that the command is case sensitive. Is there any way to perform a case insensitive search?
As the other gentleman pointed out, the exiqgrep program is just a perl script. It takes the raw value passed to the -r function (recipient) and uses it in a pattern match. The pattern match is a simple
$rcpt =~ /$opt{r}/
perl test, the default match, since it's not specified, is case sensitive.As with all things perl, TIMTOWTDI (There Is More Than One Way To Do It). Since the function above does not strip or sanitize the value passed to -r, you can simply embed an ignore case modifier in the regex. See
perldoc perlre
for more details about how the(?MODIFIERS:...)
sequence works.Here is an example where I show that a mixed case search doesn't find the domain I'm looking for, but by using an inline flag modifier as part of the search term, it finds it.
Your search will be similar, something like:
The manpage does not show such option, but the
exiqgrep
utility is aperl
script whose source you can modify to fit your needs: