Rt-mailgate --extension DWIMmery

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@example.com an
rt+correspond@example.comrt%2Bcorrespond@example.comare equivalent,
whereas rt+comment@example.com rt%2Bcomment@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