svn commit: r1928511 - in spamassassin/trunk: lib/Mail/SpamAssassin/Message/Metadata t
| Newsgroups | gmane.mail.spam.spamassassin.cvs |
|---|---|
| Message-ID | <175803419482.2446360.8699679874138603363@svn02-us-east.apache.org> |
Author: gbechis
Date: Tue Sep 16 14:49:54 2025
New Revision: 1928511
Log:
improve received headers parser
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
spamassassin/trunk/t/rcvd_parser.t
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Tue Sep 16 12:51:00 2025 (r1928510)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Tue Sep 16 14:49:54 2025 (r1928511)
@@ -406,7 +406,7 @@ sub parse_received_line {
# with HTTPS is used by Horde adjusts the Received header to say "HTTPS" when
# a connection is made over HTTPS
# IANA registry: https://www.iana.org/assignments/mail-parameters/mail-parameters.xhtml
- if (/ by / && / with ((?:ES|L|UTF8S|UTF8L)MTPS?A|ASMTP|HTTP[SU]?)(?: |;|$)/i) {
+ if (/ by / && / with .{0,64}((?:ES|L|UTF8S|UTF8L)MTPS?A|ASMTP|HTTP[SU]?)(?: |;|$)/i) {
$auth = $1;
}
# GMail should use ESMTPSA to indicate that it is in fact authenticated,
Modified: spamassassin/trunk/t/rcvd_parser.t
==============================================================================
--- spamassassin/trunk/t/rcvd_parser.t Tue Sep 16 12:51:00 2025 (r1928510)
+++ spamassassin/trunk/t/rcvd_parser.t Tue Sep 16 14:49:54 2025 (r1928511)
@@ -2,7 +2,7 @@
use lib '.'; use lib 't';
use SATest; sa_t_init("rcvd_parser");
-use Test::More tests => 147;
+use Test::More tests => 148;
use strict;
# format is:
@@ -451,6 +451,8 @@ my %data = (
'from ausisaps301-dmz.aus.amer.dell.com ([143.166.226.16]) (SquirrelMail authenticated user hoolis); by www.penguintowne.org with HTTP; Mon, 22 Mar 2004 12:54:13 -0600 (CST)' =>
'[ ip=143.166.226.16 rdns= helo= by=www.penguintowne.org ident= envfrom= id= auth=HTTP msa=0 ]',
+ 'from unknown (HELO [216.10.132.55]) ([email protected]@216.10.132.55) by mail.example.com with (SSL TLSv1.3 TLS_AES_128_GCM_SHA256 encrypted) SMTPSESMTPSA (a296348e-8bfe-11f0-9b0a-6b3a2ad3fd80); Sun, 07 Sep 2025 10:23:41 -0500' => '[ ip=216.10.132.55 rdns= helo=!216.10.132.55! by=mail.example.com [email protected] envfrom= id= auth=ESMTPSA msa=0 ]',
+
#ADDED PER Bug 6783
'from 67.85.219.192 (NaSMail authenticated user john.doe) by webmail.example.com with HTTP; Fri, 30 Mar 2012 12:39:58 +0100 (BST)' =>
'[ ip=67.85.219.192 rdns= helo= by=webmail.example.com ident= envfrom= id= auth=HTTP msa=0 ]',