You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jq...@apache.org on 2015/06/29 17:03:27 UTC

svn commit: r1688247 - /spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm

Author: jquinn
Date: Mon Jun 29 15:03:27 2015
New Revision: 1688247

URL: http://svn.apache.org/r1688247
Log:
anchored txrep relay helo check for extra safety

Modified:
    spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm

Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm?rev=1688247&r1=1688246&r2=1688247&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TxRep.pm Mon Jun 29 15:03:27 2015
@@ -1252,9 +1252,14 @@ sub check_senders_reputation {
     foreach my $rly ( @{$pms->{relays_trusted}}, @{$pms->{relays_untrusted}} ) {
 	# Get the last found HELO, regardless of private/public or trusted/untrusted
 	# Avoiding a redundant duplicate entry if HELO is equal/similar to another identificator
-	if (defined $rly->{helo} && $rly->{helo} !~ /^\[?$rly->{ip}\]?$/ && $rly->{helo} !~ /$domain/i && $rly->{helo} !~ /$from/i ) {
-	    $helo   = $rly->{helo};
-	}
+        # Get the last found HELO, regardless of private/public or trusted/untrusted
+        # Avoiding a redundant duplicate entry if HELO is equal/similar to another identificator
+        if (defined $rly->{helo} &&
+            $rly->{helo} !~ /^\[?\Q$rly->{ip}\E\]?$/ &&
+            $rly->{helo} !~ /^\Q$domain\E$/i &&
+            $rly->{helo} !~ /^\Q$from\E$/i ) {
+            $helo   = $rly->{helo};
+        }
 	# use only trusted ID, but use the first untrusted IP (if available) (AWL bug 6908)
 	# at low spam scores (<2) ignore trusted/untrusted
 	# set IP to 127.0.0.1 for any internal IP, so that it can be distinguished from none (AWL bug 6357)