[Rt-commit] rt branch, 4.2/crypt-docs, created. rt-4.2.1-23-ga534ab4

Alex Vandiver alexmv at bestpractical.com
Fri Nov 22 13:09:04 EST 2013


The branch, 4.2/crypt-docs has been created
        at  a534ab4a2ba7dbe5e85ecc1b957342075967403a (commit)

- Log -----------------------------------------------------------------
commit c7a546e99beb20654afa803fc63dfb963ad2ebc0
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Nov 22 12:47:56 2013 -0500

    Crypt: Make clearer that Auth::Crypt needs Auth::MailFrom as well

diff --git a/lib/RT/Crypt.pm b/lib/RT/Crypt.pm
index 7554aab..da28f77 100644
--- a/lib/RT/Crypt.pm
+++ b/lib/RT/Crypt.pm
@@ -84,7 +84,9 @@ additional options to fine-tune behaviour.
 
 However, note that you B<must> add the
 L<Auth::Crypt|RT::Interface::Email::Auth::Crypt> email filter to enable
-the handling of incoming encrypted/signed messages.
+the handling of incoming encrypted/signed messages.  It should be added
+in addition to the standard
+L<Auth::MailFrom|RT::Interface::Email::Auth::Crypt> plugin.
 
 =head2 %Crypt
 
diff --git a/lib/RT/Interface/Email/Auth/Crypt.pm b/lib/RT/Interface/Email/Auth/Crypt.pm
index d716e2c..09e9a3f 100644
--- a/lib/RT/Interface/Email/Auth/Crypt.pm
+++ b/lib/RT/Interface/Email/Auth/Crypt.pm
@@ -66,6 +66,9 @@ it put the module in the mail plugins list:
 
     Set(@MailPlugins, 'Auth::MailFrom', 'Auth::Crypt', ...other filters...);
 
+C<Auth::Crypt> will not function without C<Auth::MailFrom> listed before
+it.
+
 =head3 GnuPG
 
 To use the gnupg-secured mail gateway, you need to do the following:

commit e93e0d2e21a1fd823265a03387bee3135a285b5d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Nov 22 12:50:27 2013 -0500

    Crypt: Warn if we are altering an explicitly provided Incoming or Outgoing list

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 7ea5433..00db514 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -665,11 +665,17 @@ our %META;
             $opt->{'Incoming'} = [ $opt->{'Incoming'} ]
                 if $opt->{'Incoming'} and not ref $opt->{'Incoming'};
             if ( $opt->{'Incoming'} && @{ $opt->{'Incoming'} } ) {
+                $RT::Logger->warning("$_ explicitly set as incoming Crypt plugin, but not marked Enabled; removing")
+                    for grep {not $enabled{$_}} @{$opt->{'Incoming'}};
                 $opt->{'Incoming'} = [ grep {$enabled{$_}} @{$opt->{'Incoming'}} ];
             } else {
                 $opt->{'Incoming'} = \@enabled;
             }
             if ( $opt->{'Outgoing'} ) {
+                if (not $enabled{$opt->{'Outgoing'}}) {
+                    $RT::Logger->warning("$_ explicitly set as outgoing Crypt plugin, but not marked Enabled; "
+                                             . (@enabled ? "using $enabled[0]" : "removing"));
+                }
                 $opt->{'Outgoing'} = $enabled[0] unless $enabled{$opt->{'Outgoing'}};
             } else {
                 $opt->{'Outgoing'} = $enabled[0];

commit a534ab4a2ba7dbe5e85ecc1b957342075967403a
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Nov 22 12:50:50 2013 -0500

    Crypt: Warn if Auth::Crypt is enabled but no Incoming plugins exist

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 00db514..87bf698 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -619,6 +619,10 @@ our %META;
         Type => 'ARRAY',
         PostLoadCheck => sub {
             my $self = shift;
+
+            # Make sure Crypt is post-loaded first
+            $META{Crypt}{'PostLoadCheck'}->( $self, $self->Get( 'Crypt' ) );
+
             my @plugins = $self->Get('MailPlugins');
             if ( grep $_ eq 'Auth::GnuPG' || $_ eq 'Auth::SMIME', @plugins ) {
                 $RT::Logger->warning(
@@ -636,6 +640,10 @@ our %META;
                     } @plugins;
                 $self->Set( MailPlugins => @plugins );
             }
+
+            if ( not @{$self->Get('Crypt')->{Incoming}} and grep $_ eq 'Auth::Crypt', @plugins ) {
+                $RT::Logger->warning("Auth::Crypt enabled in MailPlugins, but no available incoming encryption formats");
+            }
         },
     },
     Crypt        => {

-----------------------------------------------------------------------


More information about the rt-commit mailing list