[Bps-public-commit] RT-Extension-CommandByMail branch, ignore-unknown-commands, created. 2.01-2-gcb4f0b5
Dustin Graves
dustin at bestpractical.com
Fri Aug 12 15:12:12 EDT 2016
The branch, ignore-unknown-commands has been created
at cb4f0b54a693292a263226fa1d31064d8c48ee07 (commit)
- Log -----------------------------------------------------------------
commit cb4f0b54a693292a263226fa1d31064d8c48ee07
Author: Dustin Graves <dustin at bestpractical.com>
Date: Fri Aug 12 19:12:00 2016 +0000
add config setting $CommandByMailIgnoreUnknown to suppress unknown command errors/crits
diff --git a/README b/README
index b2bfcdf..f9948c4 100644
--- a/README
+++ b/README
@@ -75,6 +75,11 @@ CONFIGURATION
If set, the body will not be examined, only the header defined by the
previous configuration option.
+ $CommandByMailIgnoreUnknown
+ Traditionally, this extension throws an error if it finds an unknown
+ command. Setting this will make CommandByMail silently ignore them
+ instead.
+
CAVEATS
This extension is incompatible with UnsafeEmailCommands RT option.
diff --git a/lib/RT/Extension/CommandByMail.pm b/lib/RT/Extension/CommandByMail.pm
index cc20218..65a72c8 100644
--- a/lib/RT/Extension/CommandByMail.pm
+++ b/lib/RT/Extension/CommandByMail.pm
@@ -106,6 +106,11 @@ as well. For example:
If set, the body will not be examined, only the header defined by the previous
configuration option.
+=head2 C<$CommandByMailIgnoreUnknown>
+
+Traditionally, this extension throws an error if it finds an unknown command.
+Setting this will make CommandByMail silently ignore them instead.
+
=head1 CAVEATS
This extension is incompatible with C<UnsafeEmailCommands> RT option.
@@ -867,6 +872,7 @@ sub _CheckCommand {
return 1 if grep $cmd eq lc $_, @LINK_ATTRIBUTES, @WATCHER_ATTRIBUTES;
}
+ return 1 if RT->Config->Get('CommandByMailIgnoreUnknown');
return (0, "Command '$cmd' is unknown");
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list