-
-
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: incorrectly detects the IP address #152
Comments
ReceivedHeader: incorrectly detects the IP address zbateson#152
I proposed a solution to this problem in mariuszkrzaczkowski@882f89b |
Hi @mariuszkrzaczkowski -- Unfortunately with the Received header it's a losing battle trying to parse every possibility. Please read through my thoughts on this issue: #78 The trouble is implementations for this header are all over the place, and besides covering the very basics of what the header is defined as in RFC 5321 section 4.4, I'm not convinced this library should attempt to parse much outside of that definition. In this case, the relevant part is:
The trouble with your example is the 'helo=' part in the address, which is not valid according to that. For example this test is testing exactly that, the domain part in front of the address:
|
Do you have any idea to handle it universally? if others are doing it, it may be worth fighting. I can help |
we can add experimental or compliance mode or not and then try to handle such different cases in an additional mode |
My feeling on this is that I don't want mail-mime-parser chasing unstandardized formats -- think this or something like finding the 'reply' part of an email. There's just too much variation for a library like this, and it's not what I think it should be. I'd encourage this to be outside of mail-mime-parser as an add-on for instance or something. Unfortunately at the moment mmp isn't very extensible, but I'm working on fixing that in a 2.0 so something like this could be created on the side and plugged in if someone wanted it... it's very slow going as I'm going through a busy period (fatherhood) and so haven't had much time to dedicate unfortunately. |
only how many servers are standards compliant ??? this is meant to be used and must be able to deal with every e-mail present only then the library can be used everywhere, this is my opinion |
The variation on Received headers is to the point that the format is 'unstandardized' imo, not that there are widely-used bad implementations. I'm happy to support mistakes in implementation so long as they're widely used and can't be fixed at the source. Implementing support for Received (seems to me) to be an exercise in how much to support -- you can always find a new variation and need additional code added for it. I don't think that belongs here. |
IP discovery only works when the address is at the end, not as it is at the beginning
an example for which it works
an example for which it doesn't work
the problem is in regex
mail-mime-parser/src/Header/Consumer/Received/DomainConsumer.php
Lines 70 to 82 in 56792b4
The text was updated successfully, but these errors were encountered: