svn commit: r1937482 - in spamassassin/trunk: lib/Mail/SpamAssassin/Message/Metadata t
| Newsgroups | gmane.mail.spam.spamassassin.cvs |
|---|---|
| Message-ID | <178773367456.2517351.10653395343726936640@svn03-he-fi> |
Author: gbechis
Date: Wed Aug 26 08:41:14 2026
New Revision: 1937482
Log:
Correctly parse Exim 4.99 received lines
bz #8365
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 Wed Aug 26 08:30:40 2026 (r1937481)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Wed Aug 26 08:41:14 2026 (r1937482)
@@ -409,6 +409,15 @@ sub parse_received_line {
if (/ by / && / with .{0,64}((?:ES|L|UTF8S|UTF8L)MTPS?A|ASMTP|HTTP[SU]?)(?: |;|$)/i) {
$auth = $1;
}
+
+ # Exim 4.99 and later can be configured to report a non-standard protocol
+ # when TLS is negotiated on connection rather than with STARTTLS. (It is
+ # mostly intended for logging purposes, but it bleeds through into headers.)
+ # Recognize this and treat as if using the standard protocol designator.
+ elsif (/ by / && / with ESSMTPA(?:\s|;|$)/i) {
+ $auth = 'esmtpsa';
+ }
+
# GMail should use ESMTPSA to indicate that it is in fact authenticated,
# but doesn't.
elsif (/ by mx\.google\.com with ESMTPS id [a-z0-9]{1,4}sm[0-9]{2,9}[a-z]{3}\.[0-9]{1,3}\.[0-9]{4}\.(?:[0-6][0-9]\.){4}[0-6][0-9]/ && /\(version=([^ ]+) cipher=([^\)]+)\)/ ) {
Modified: spamassassin/trunk/t/rcvd_parser.t
==============================================================================
--- spamassassin/trunk/t/rcvd_parser.t Wed Aug 26 08:30:40 2026 (r1937481)
+++ spamassassin/trunk/t/rcvd_parser.t Wed Aug 26 08:41:14 2026 (r1937482)
@@ -2,7 +2,7 @@
use lib '.'; use lib 't';
use SATest; sa_t_init("rcvd_parser");
-use Test::More tests => 150;
+use Test::More tests => 151;
use strict;
# format is:
@@ -474,6 +474,9 @@ my %data = (
'from cold-email.sendkit-mail.com (static.25.190.130.94.clients.your-server.de. [94.130.190.25]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e0748994bsm1467533e87.36.2026.01.29.16.59.37 for <[email protected]> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 16:59:38 -0800 (PST)' =>
'[ ip=94.130.190.25 rdns=static.25.190.130.94.clients.your-server.de helo=cold-email.sendkit-mail.com by=smtp.gmail.com ident= envfrom= id=2adb3069b0e04-59e0748994bsm1467533e87.36.2026.01.29.16.59.37 auth=ESMTPSA msa=0 ]',
+ 'from 192-0-2-1.isp.example ([192.0.2.1]:43502 helo=ehlo.thunderbird.net) by mail.customer.example with essmtpa (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.99.1) (envelope-from <[email protected]>) id 1vfyfh-000000085oY-23Kr for [email protected]; Wed, 14 Jan 2026 11:04:20 +0000' =>
+ '[ ip=192.0.2.1 rdns=192-0-2-1.isp.example helo=ehlo.thunderbird.net by=mail.customer.example ident= [email protected] intl=0 id=1vfyfh-000000085oY-23Kr auth=esmtpsa msa=0 ]',
+
);
my $sa = create_saobj();