[Bps-public-commit] RT-Extension-CommandByMail branch, ignore-unknown-commands, repushed

Dustin Graves dustin at bestpractical.com
Fri Aug 12 15:46:47 EDT 2016


The branch ignore-unknown-commands was deleted and repushed:
       was cb4f0b54a693292a263226fa1d31064d8c48ee07
       now 934a451a36d9c2280a32f90c51e55862f24ac858

1:  cb4f0b5 ! 1:  934a451 add config setting $CommandByMailSkipUnknown to suppress unknown command errors/crits
    @@ -1,6 +1,6 @@
     Author: Dustin Graves <dustin at bestpractical.com>
     
    -    add config setting $CommandByMailIgnoreUnknown to suppress unknown command errors/crits
    +    add config setting $CommandByMailSkipUnknown to suppress unknown command errors/crits
     
     diff --git a/README b/README
     --- a/README
    @@ -9,9 +9,9 @@
          If set, the body will not be examined, only the header defined by the
          previous configuration option.
      
    -+  $CommandByMailIgnoreUnknown
    ++  $CommandByMailSkipUnknown
     +    Traditionally, this extension throws an error if it finds an unknown
    -+    command. Setting this will make CommandByMail silently ignore them
    ++    command. Setting this will make CommandByMail silently skip them
     +    instead.
     +
      CAVEATS
    @@ -25,19 +25,31 @@
      If set, the body will not be examined, only the header defined by the previous
      configuration option.
      
    -+=head2 C<$CommandByMailIgnoreUnknown>
    ++=head2 C<$CommandByMailSkipUnknown>
     +
     +Traditionally, this extension throws an error if it finds an unknown command.
    -+Setting this will make CommandByMail silently ignore them instead.
    ++Setting this will make CommandByMail silently skip them instead.
     +
      =head1 CAVEATS
      
      This extension is incompatible with C<UnsafeEmailCommands> RT option.
     @@
    + 
    +     foreach my $cmd ( keys %cmds ) {
    +         my ($val, $msg) = _CheckCommand( $cmd );
    ++        if ($val == 2) {
    ++            delete $cmds{$cmd};
    ++            RT->Logger->debug("Skipping unknown command '$cmd'");
    ++            next;
    ++        }
    +         unless ( $val ) {
    +             $results{ $cmd } = {
    +                 value   => delete $cmds{ $cmd },
    +@@
              return 1 if grep $cmd eq lc $_, @LINK_ATTRIBUTES, @WATCHER_ATTRIBUTES;
          }
      
    -+    return 1 if RT->Config->Get('CommandByMailIgnoreUnknown');
    ++    return 2 if RT->Config->Get('CommandByMailSkipUnknown');
          return (0, "Command '$cmd' is unknown");
      }
      



More information about the Bps-public-commit mailing list