-
-
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
[2.14]: Fix: Fold long lines during SMTP communication #140
Commits on Mar 15, 2021
-
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 + WSP; this is called "folding". Correct folding is particularly important for long header fields. Signed-off-by: Vlad Safronov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8512e5d - Browse repository at this point
Copy the full SHA 8512e5dView commit details -
Use Headers::FOLDING when folding
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7bc2deb - Browse repository at this point
Copy the full SHA 7bc2debView commit details -
Use fgets and detect partial line reads
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 44c4053 - Browse repository at this point
Copy the full SHA 44c4053View commit details -
Add unit test for long header wrapping
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 009eed6 - Browse repository at this point
Copy the full SHA 009eed6View commit details -
Refactor data reader in Protocol\Smtp to use Generator
This isolates the logic of handling incomplete reads to own unit. Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3dab0b3 - Browse repository at this point
Copy the full SHA 3dab0b3View commit details -
As the buffer max size is known, can check last byte with isset Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 662433d - Browse repository at this point
Copy the full SHA 662433dView commit details -
Test for max length of all SMTP data lines
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb82a12 - Browse repository at this point
Copy the full SHA fb82a12View commit details -
Move chunkedReader to a method
he method has no state, so therefore declared static. Ideally this should be a standalone class, perhaps in laminas-stdlib. Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0deb254 - Browse repository at this point
Copy the full SHA 0deb254View commit details -
Update chunk_split to use 997 for correct result
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a3e57fd - Browse repository at this point
Copy the full SHA a3e57fdView commit details -
Update test that header line with exact length is not wrapped
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b40d5d4 - Browse repository at this point
Copy the full SHA b40d5d4View commit details -
Update test to require lines not to be empty
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 38bc378 - Browse repository at this point
Copy the full SHA 38bc378View commit details -
Add MAX_LINE_LENGTH constant for magic 998 value
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 43d8da3 - Browse repository at this point
Copy the full SHA 43d8da3View commit details -
Update test to use SmtpProtocol::MAX_LINE_LENGTH constant
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4105ce6 - Browse repository at this point
Copy the full SHA 4105ce6View commit details -
Introduce local variable and exccessively document the logic in the loop
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for db94751 - Browse repository at this point
Copy the full SHA db94751View commit details -
Rename MAX_LINE_LENGTH -> SMTP_LINE_LIMIT
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b93be75 - Browse repository at this point
Copy the full SHA b93be75View commit details -
Update test to expect Headers::FOLDING never change
Signed-off-by: Elan Ruusamäe <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 74f4242 - Browse repository at this point
Copy the full SHA 74f4242View commit details