summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b576ea)
raw | patch | inline | side by side (parent: 8b576ea)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 12 Sep 2008 08:57:18 +0000 (08:57 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 12 Sep 2008 08:57:18 +0000 (08:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12441 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/client/events/mailqueue.pm | patch | blob | history | |
gosa-si/tests/client.php | patch | blob | history |
index 76c92e2f67d08fa51ed02f675aa2ff61ad258b24..866b5eae6792cda669a5d6d702b01cc31d79c362 100644 (file)
use warnings;
use GOSA::GosaSupportDaemon;
use Data::Dumper;
+use MIME::Base64;
BEGIN {}
$act_result->{'recipient'} = $info_l[2] =~ /([\w.-]+@[\w.-]+)/ ? $1 : 'unknown' ;
$act_result->{'msg_status'} = $info_l[1] =~ /^([\s\S]*)$/ ? $1 : 'unknown' ;
- # If a query tag exists, perform the selection
+ # If all query tags exists, perform the selection
my $query_positiv = 0;
if (defined $q_tag && defined $q_operator && defined $q_value) {
}
}
}
- }
+
+ # If no query tag exists, return all mails in mailqueue
+ } elsif ((not defined $q_tag) && (not defined $q_operator) && (not defined $q_value)) {
+ $query_positiv++;
+
+ # If query tags are not complete return error message
+ } elsif ((not defined $q_tag) || (not defined $q_operator) || (not defined $q_value)) {
+ $error++;
+ $error_string = "'mailqueue_query'-msg is not complete, some query tags (q_tag, q_operator, q_value) are missing";
+ &main::daemon_log("$session_id WARNING: $error_string", 3);
+ }
# If query was successful, add resutls to answer
if ($query_positiv) {
}
# parsing information
+ my $msg_header;
if (not $error) {
my $cmd = "postcat -q $msg_id";
&main::daemon_log("DEBUG: run '$cmd'", 7);
my $result = qx($cmd);
- foreach (split(/\n/, $result)) {
- if ($_ =~ /^To: ([\S]+)/) { $recipient = $1; }
- if ($_ =~ /^From: ([\S]+)/) { $sender = $1; }
- if ($_ =~ /^Subject: ([\s\S]+)/) { $subject = $1; }
- }
+
+ my @header_l = split(/\n\n/, $result);
+ $msg_header = $header_l[0];
}
# create outgoing msg
# add mail infos to outgoing msg
} else {
- &add_content2xml_hash($out_hash, "recipient", $recipient);
- &add_content2xml_hash($out_hash, "sender", $sender);
- &add_content2xml_hash($out_hash, "subject", $subject);
+ #&add_content2xml_hash($out_hash, "msg_header", &decode_base64($msg_header));
+ &add_content2xml_hash($out_hash, "msg_header", $msg_header);
$out_msg = &main::create_xml_string($out_hash);
}
index 81cfbc383ad6d5398c02c64d1fb9773ef9e54e97..15fe8451362e6a48785b6d04d1ac2773a107cf96 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
#echo sabber | mail -s test horst@woauchimmer.de
# Querying the mailqueue at
- #$data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:aa:16</target> </xml>";
- $data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <q_tag>recipient</q_tag> <q_operator>eq</q_operator> <q_value>rett</q_value> </xml>";
+ #$data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> </xml>";
+ $data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <q_tag>recipient</q_tag> <q_operator>eq</q_operator> <q_value>retta</q_value> </xml>";
# Multiple xml tags msg_id are allowed
#$data = "<xml> <header>gosa_mailqueue_hold</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <msg_id>99C8ABEF23</msg_id> </xml>";