Bug 7479 - Mutliple From addresses incorrectly parsed
Summary: Mutliple From addresses incorrectly parsed
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 3.4.1
Hardware: All All
: P2 minor
Target Milestone: 4.0.0
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2017-10-17 13:33 UTC by RW
Modified: 2019-09-20 13:21 UTC (History)
2 users (show)

Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description RW 2017-10-17 13:33:32 UTC
The following header, mentioned in the user list, isn't parsed correctly:

From: Struthers@psfc.mit.edu, "Lorraine M." <alexa.morales@glcamerica.com>

using these rules
header   __FROM_NAME  From:name =~ /.*/
header   __FROM_ADDR  From:addr =~ /.*/

I get:

__FROM_ADDR ======> got hit: "alexa.morales@glcamerica.com"
__FROM_NAME ======> got hit: "Struthers@psfc.mit.edu, Lorraine M."

i.e the first address has ended-up in the display name of the second address.
Comment 1 Kevin A. McGrail 2018-08-28 23:39:39 UTC
Not sure it can be parsed correctly.  Isn't it an invalid header for From?  Was it a ham or a spam in the sample?
Comment 2 Henrik Krohns 2019-09-20 13:21:59 UTC
Curreny parser is pretty lame and doesn't support multiple addresses. We need to either write our own RFC 5322 parser (*groan*) or use Email::Address::XS (which is not packaged in major distributions, *groan*).