-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReceivedHeader: address is null when hostname is unknown #104
Comments
Hi @toto4ds -- That's because "unknown" doesn't look like a hostname, the rules for parsing FROM and BY were created as follows (from https://mail-mime-parser.org/api/1.2/classes/ZBateson.MailMimeParser.Header.ReceivedHeader.html):
Because "Received" doesn't seem to be very documented and there is bound to be a large amount of variation in the wild, I'm not sure I want to chase every instance of a difference and make it work for Received. Having said that, I could consider a change in parsing for this specific issue: If the pattern of the parenthesized part is "(no-whitespace [ip.address])", ignore the the no-whitespace part if it doesn't look like a hostname (containing at least one '.')? Or what change would be the most beneficial? |
Hello,
This header return address as null
Received: from mx.yandex.ru (unknown [114.234.11.107])
by my.mail.host (Postfix) with ESMTP id A11294BE6E49
for [email protected]; Sat, 18 Jan 2020 14:11:04 +0700 (+07)
ZBateson\MailMimeParser\Header\ReceivedHeader^ {#1216
#comments: array:2 [
0 => "unknown [114.234.11.107]"
1 => "Postfix"
]
#date: DateTime @1579331464 {#1266
date: 2020-01-18 14:11:04.0 +07:00
}
#parameters: array:5 [
"from" => ZBateson\MailMimeParser\Header\Part\ReceivedDomainPart^ {#1249
#ehloName: "mx.yandex.ru"
#hostname: null
#address: null
#name: "from"
#language: null
#canIgnoreSpacesBefore: false
#canIgnoreSpacesAfter: false
#languages: []
#value: "mx.yandex.ru"
thx
The text was updated successfully, but these errors were encountered: