Commit ea04c376 authored by Tollef Fog Heen's avatar Tollef Fog Heen
Browse files

Look for commands in headers too

This allows us to parse a configurable header for commands too, by
setting the CommandByMailHeader setting.
parent 81ade309
......@@ -52,5 +52,10 @@ There is an optional configuration option CommandByMailGroup
Set($CommandByMailGroup, group_id);
You can find the id by browsing to Configuration -> Groups
You can get it to look for commands in headers as well by setting
CommandByMailHeader like:
Set($CommandByMailHeader, "X-RT-Command");
Enjoy.
......@@ -10,8 +10,8 @@ This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
DESCRIPTION
This extension parse content of incoming messages for list commands.
Format of commands is:
This extension parses the body and headers of incoming messages
for list commands. Format of commands is:
Command: value
Command: value
......
......@@ -18,8 +18,8 @@ RT::Interface::Email::Filter::TakeAction - Change metadata of ticket via email
=head1 DESCRIPTION
This extension parse content of incomming messages for list commands. Format
of commands is:
This extension parses the body and headers of incoming messages for
list commands. Format of commands is:
Command: value
Command: value
......@@ -183,6 +183,10 @@ sub GetCurrentUser {
$RT::Logger->debug("Running CommandByMail as ".$args{'CurrentUser'}->UserObj->Name);
my $headername = $new_config
? RT->Config->Get('CommandByMailHeader')
: $RT::CommandByMailHeader;
# find the content
my @content;
my @parts = $args{'Message'}->parts_DFS;
......@@ -196,6 +200,10 @@ sub GetCurrentUser {
}
}
if (defined $headername) {
unshift @content, $args{'Message'}->head->get_all($headername);
}
my @items;
my $found_pseudoheaders = 0;
foreach my $line (@content) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment