Commit 00ebcb12 authored by Tollef Fog Heen's avatar Tollef Fog Heen Committed by Thomas Sibley
Browse files

Add support for only inspecting headers, not the body

Default is to still look in body, but if you want the module to only
look in the defined header, use Set($CommandByMailOnlyHeaders, 1);

(Based on commit 2b533dc27f6a074b96a39c66379fc150a3f51ede from pr/3.)

[Adjusted tabs — s/\t/    /g — and simplified the $only_headers
conditional. -trs]
parent d75afe37
......@@ -57,5 +57,10 @@ CommandByMailHeader like:
Set($CommandByMailHeader, "X-RT-Command");
If you only want it to look in headers and not the body, you can set
CommandByMailOnlyHeaders to a true value, like:
Set($CommandByMailOnlyHeaders, 1);
......@@ -200,9 +200,13 @@ sub GetCurrentUser {
? RT->Config->Get('CommandByMailHeader')
: $RT::CommandByMailHeader;
my $only_headers = $new_config
? RT->Config->Get('CommandByMailOnlyHeaders')
: $RT::CommandByMailOnlyHeaders;
# find the content
my @content;
my @parts = $args{'Message'}->parts_DFS;
my @content = ();
my @parts = $only_headers ? () : $args{'Message'}->parts_DFS;
foreach my $part (@parts) {
my $body = $part->bodyhandle or next;
Supports Markdown
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