rt 4.2.14 (#13852)
[freeside.git] / rt / lib / RT / Crypt / SMIME.pm
index 743ab2b..fbd8108 100644 (file)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -184,6 +184,14 @@ sub Probe {
             \$buf, \$err
         ) };
 
+        if ($err && $err =~ /Invalid command/) {
+            ($buf, $err) = ('', '');
+            safe_run_child { run3( [$bin, "list", "-commands"],
+                \undef,
+                \$buf, \$err
+            ) };
+        }
+
         if ($? or $err) {
             $RT::Logger->warning(
                 "RT's SMIME libraries couldn't successfully execute openssl.".