From 8f5275323d79854459fdb34fc20d3afeca4fd8b6 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Thu, 11 Sep 2008 13:39:29 +0000 Subject: [PATCH] update: mailqueue_query at mailqueue.pm accepts a regex as q_value git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12427 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/client/events/mailqueue.pm | 14 ++++++++++---- gosa-si/tests/client.php | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gosa-si/client/events/mailqueue.pm b/gosa-si/client/events/mailqueue.pm index 2521be247..76c92e2f6 100644 --- a/gosa-si/client/events/mailqueue.pm +++ b/gosa-si/client/events/mailqueue.pm @@ -170,7 +170,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'msg_id'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'msg_id'}, $q_operator, $q_value) ) { + $query_positiv++; + } } # Query for message size @@ -198,7 +200,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'sender'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'sender'}, $q_operator, $q_value)) { + $query_positiv++; + } } # Query for recipient @@ -209,7 +213,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'recipient'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'recipient'}, $q_operator, $q_value)) { + $query_positiv++; + } } } } @@ -684,7 +690,7 @@ sub _exec_op { my $res; if ($op eq "eq") { - $res = $a == $b ? 1 : 0 ; + $res = $a =~ /$b/ ? 1 : 0 ; } elsif ($op eq "gt") { $res = $a > $b ? 1 : 0 ; } elsif ($op eq "lt") { diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index cb8f19025..81cfbc383 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -185,7 +185,7 @@ for($count = 1; $count <= $zahl; $count++) # Querying the mailqueue at #$data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:aa:16
"; - $data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa arrival_time gt 20080812120000
"; + $data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa recipient eq rett
"; # Multiple xml tags msg_id are allowed #$data = "
gosa_mailqueue_hold
GOSA 00:01:6c:9d:b9:fa 99C8ABEF23
"; -- 2.30.2