-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fold long lines during smtp communication in Protocol\Smtp class #138
Conversation
To deal with the 998/78 character limitations per line, long lines can be split into a multiple-line representation separated by CRLF + WSP; this is called "folding". Correct folding is particularly important for long header fields. Signed-off-by: Vlad Safronov <[email protected]>
Signed-off-by: Vlad Safronov <[email protected]>
@vladsf could you cross-link with the discussion in Eventum thread where this was discussed, please. |
Maintainers: looks like the I think it's better to avoid the acronym and write out Discussion, or remove the option at all? |
@vladsf could you update PR title that this affects only |
It seems, the underlying problem of the bug is that currently, the loop reads up to 1000 bytes, and if the input is longer than that, then everything over 1000 bytes will appear as the next line in mail headers, resulting in corruption. And depending on MTA, such corruption is treated as the end of headers input. could you copy this explanation to PR body please. |
@vladsf your solution postpones the problem when the next limit, more appropriate would be to check if the string is not read up to UPDATE: so, the other way to detect if the line read was complete is to compare if read length equals to so, maybe switch to use maybe maintainers can chime in here and give directions? |
UPDATE, I took my own note and converted it into commits #140 so, perhaps this one can be closed as a duplicate. |
OK, let me look into #140. |
Closed as a duplicate of #140. |
Description
Fold long lines following RFC 5322 section-2.2.3
To deal with the 998/78 character limitations per line,
long lines can be split into a multiple-line representation
separated by CRLF + SPACE; this is called "folding".
Correct folding is particularly important for long header fields
(e.g. generated by MS Exchange).
@glensc adds:
It seems, the underlying problem of the bug is that currently, the loop reads up to 1000 bytes, and if the input is longer than that, then everything over 1000 bytes will appear as the next line in mail headers, resulting in corruption. And depending on MTA, such corruption is treated as the end of headers input.