svn commit: r1934692 - spamassassin/trunk/lib/Mail/SpamAssassin
[email protected] Wed, 27 May 2026 16:50:58 -0000
| Newsgroups | gmane.mail.spam.spamassassin.cvs |
|---|---|
| Message-ID | <177990065883.4085082.16621671586702135743@svn03-he-fi> |
Author: fkento
Date: Wed May 27 16:50:58 2026
New Revision: 1934692
Log:
Drop XS pseudo-entries with neither phrase nor address
When Email::Address::XS encounters unparseable input (e.g. a truncated
address header), it emits an entry with both address and phrase undef.
_parse_header_addresses_xs was copying the entire input string into
phrase for those entries, which caused header:first:name lookups to
return the whole header — for example, a long multi-recipient To header
truncated at MAX_HEADER_VALUE_LENGTH would yield a single 8KB 'name'
that matched any non-trivial length-based rule.
Drop these entries instead. The internal parser already does so
implicitly, and an entry with no address and no real phrase carries no
information for downstream :addr or :name consumers.
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Wed May 27 15:59:35 2026 (r1934691)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Wed May 27 16:50:58 2026 (r1934692)
@@ -2806,10 +2806,10 @@ sub _parse_header_addresses_xs {
$phrase = $comment;
}
- # Use input as name if nothing found
- if (!defined $phrase && !defined $address) {
- $phrase = $str;
- }
+ # Skip entries with neither phrase nor address — XS emits these for
+ # unparseable tails (e.g. a truncated address header), and copying the
+ # whole input into phrase here causes :name to return the entire header.
+ next if !defined $phrase && !defined $address;
push @results, {
'phrase' => $phrase,