[Rt-commit] rt branch, 4.4/fix-needs-unsigned-warning-logic, created. rt-4.4.4-165-ge74805287b

Dianne Skoll dianne at bestpractical.com
Wed Nov 18 09:39:56 EST 2020


The branch, 4.4/fix-needs-unsigned-warning-logic has been created
        at  e74805287b50a8753cb3f73f79335622631a4f25 (commit)

- Log -----------------------------------------------------------------
commit e74805287b50a8753cb3f73f79335622631a4f25
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Wed Nov 18 09:38:27 2020 -0500

    Fix a bug in the logic that suppresses the "email is unsigned" warning.
    
    The intention was to suppress the warning if there are *zero* Received:
    headers in the mail; this commit enables this behavior.
    
    The older code would suppress the warning if there were any
    non-Received: headers... effectively, always suppressing it.

diff --git a/share/html/Elements/CryptStatus b/share/html/Elements/CryptStatus
index e6c0e7ba8f..c43e0313a1 100644
--- a/share/html/Elements/CryptStatus
+++ b/share/html/Elements/CryptStatus
@@ -53,6 +53,7 @@ $Reverify     => 1
 <%INIT>
 my @runs;
 my $needs_unsigned_warning = $WarnUnsigned;
+my $seen_received = 0;
 
 my @protocols = RT::Crypt->EnabledProtocols;
 my $re_protocols = join '|', map "\Q$_\E", @protocols;
@@ -63,12 +64,14 @@ foreach ( $Message->SplitHeaders ) {
     }
 
     $needs_unsigned_warning = 0 if /^X-RT-Incoming-Signature:/;
-
-    # if this is not set, then the email is generated by RT, and so we don't
-    # need "email is unsigned" warnings
-    $needs_unsigned_warning = 0 if not /^Received:/;
+    $seen_received = 1 if /^Received:/;
 }
 
+# If there are no Received: headers, then the email
+# is generated by RT and we don't need "email is unsigned"
+# warnings.
+$needs_unsigned_warning = 0 unless $seen_received;
+
 return unless @runs or $needs_unsigned_warning;
 
 my $reverify_cb = sub {

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


More information about the rt-commit mailing list