-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Trim surrounding single quotes in emails to support Outlook-style single-quotes around To:
header weirdness
#183
Trim surrounding single quotes in emails to support Outlook-style single-quotes around To:
header weirdness
#183
Conversation
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests strictly required to validate such a change: IMO not valid to accept a string within quotes as a valid Address
anyway, as such kind of cleanup should occur wherever you input data into the system that uses Address::fromString()
Thanks for the quick feedback. Message is loaded from IMAP in |
Aha, the fact that it is loaded via IMAP is new info. I wonder if it is possible to get one of the loaded raw messages as part of data provider entries for our test suite? That would make it clear that we're talking about a real-world IMAP use-case, and prevent future regressions. |
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
I am sorry, I should have provided this info in the initial description. |
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests make sense to me, although the type errors reported by psalm should really be checked (see them on the diff).
As for the trim()
call, I'm thinking that it should be moved into Message
, rather than in Address
. Rationale: Address::fromString()
is used outside the context of Message
too, while it looks like this Outlook IMAP oddity is only applicable when parsing messages in Outlook.
Maybe there is a small misunderstanding: We're looking at a message sent from an outlook client to a Gmail inbox. We're actually downloading this message via IMAP from Gmail in this case. |
Some thoughts looking at it a little more in depths: |
Reasoning seems fine: are you able to bring CI to green, so that somebody else can throw in a more informed review on whether putting this responsibility in |
I've read https://datatracker.ietf.org/doc/html/rfc5322 twice, and nowhere it allows But as maintainer of ddeboer/imap it's no surprise to me |
Ok, so let's get it green, then merged |
Signed-off-by: Felix Krueger <felix.krueger@gressus.de>
Awesome! |
To:
header weirdness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🚢
Thanks @CapnFelix! Releasing nao.
Thank you so much! 🌊 |
…e-quotes Trim surrounding single quotes in emails to support Outlook-style single-quotes around `To:` header weirdness
Outlook does add single quotes to emails sometimes which is not valid
Description
We're seeing emails generated by outlook which do have surrounding single quote like this:
To: <'user@example.com'>
The fix does just trim those.
Issue on microsoft.com: https://answers.microsoft.com/en-us/outlook_com/forum/all/single-quote-marks-around-email-addresses-in/37122680-0ea2-46ed-bfeb-8f67d3441e5f
This is my first PR, so please let me know if did something wrong :)