You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix to #23 seems to have broken reply header handling in emails like this one, containing more reply headers in the quoted text below.
Expected Behavior: The first reply header gets its line breaks removed, and ends up in the second fragment along with all of the quoted text.
Observed Behavior: The line breaks aren't removed, and therefore it's not recognized as a reply header later on. So the reply header ends up in the first fragment instead of the second.
The text was updated successfully, but these errors were encountered:
I think that either this problem is a little more general, or perhaps this is just a different, related problem - the RFC's for Email have a section specifically outlining the line length of emails; the guidance specifically being:
Each line of characters MUST be no more than 998 characters and SHOULD be no more than 78 characters, excluding the CRLF.
As such, I've observed mail servers/clients (and services like send grid) edit the emails being exchanged with rules like this:
If a line is > 78 characters and has a whitespace character, split on the last one
If a line is > 78 characters and has no whitespace character, break the line into 78 character lines
So it will turn something like From: Human Resources <[email protected]> into
it's trivial to construct cases that would break any kind of general solution.
Lastly, in addition to the fix you had for #48 you could do something like (in JS, sorry not a Ruby guy):
/^\s*(From\s?:.+\s?(\[|<).+(\]|>))/u
to detect the above case.
Don't have a real conclusion here - just did a bunch of research this morning to fix a specific problem we were seeing. Happy to try adding the above into your solution for #48 if anyone wants to give me some pointers on Ruby/this project.
The fix to #23 seems to have broken reply header handling in emails like this one, containing more reply headers in the quoted text below.
Expected Behavior: The first reply header gets its line breaks removed, and ends up in the second fragment along with all of the quoted text.
Observed Behavior: The line breaks aren't removed, and therefore it's not recognized as a reply header later on. So the reply header ends up in the first fragment instead of the second.
The text was updated successfully, but these errors were encountered: