[Rt-devel] [patch] rt-mailgate --extension DWIMmery

Jerrad Pierce jpierce at cambridgeenergyalliance.org
Mon Aug 11 14:45:16 EDT 2008


Since action is required (or at least documented as such) it seems that
  --action correspond --extension action
should default to an action of correspond for messages without an extension.
Thusly rt at example.com an
rt+correspond at example.com<rt%2Bcorrespond at example.com>are equivalent,
whereas rt+comment at example.com <rt%2Bcomment at example.com> is not.

The simple patch below (3.8.0) simply falls back to the value supplied on
the
command-line if EXTENSION is undef. This should work for queue and action,
and ticket will simply remain null; though a warning may be raised about
undefined value.

--- /opt/rt3/bin/rt-mailgate~   2008-08-02 10:58:26.000000000 -0400
+++ /opt/rt3/bin/rt-mailgate    2008-08-11 14:30:24.000000000 -0400
@@ -89,7 +89,7 @@
 };

 if ( ($opts{'extension'} || '') =~ /^(?:action|queue|ticket)$/i ) {
-    $args{ lc $opts{'extension'} } = $ENV{'EXTENSION'};
+    $args{ lc $opts{'extension'} } = $ENV{'EXTENSION'} ||
$opts{$opts{'extension'}};
 } elsif ( $opts{'extension'} && $ENV{'EXTENSION'} ) {
     print STDERR "Value of the --extension argument is not action, queue or
ticket"
         .", but environment variable EXTENSION is also defined. The former
is ignored.\n";

-- 
Cambridge Energy Alliance: Save money & the planet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20080811/5ea470f8/attachment.htm 


More information about the Rt-devel mailing list