Skip to content

Email payload is broken when set CURLOPT_CRLF = 1 #14165

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

Closed
vuonganh1993 opened this issue Jul 12, 2024 · 6 comments
Closed

Email payload is broken when set CURLOPT_CRLF = 1 #14165

vuonganh1993 opened this issue Jul 12, 2024 · 6 comments
Assignees

Comments

@vuonganh1993
Copy link

I did this

My program sends emails by curl with CURLOPT_CRLF = 1. Everything worked fine with 7.76.0. Recently, we upgraded to curl 8.8.0 and the email is always broken if the payload is greater than 64Kb. I found out that the payload is missing some data.
image

To fix the issue, I need to set CURLOPT_CRLF = 0 and add "\r\n" to the end of every line in the payload. it works fine again.

I expected the following

No response

curl/libcurl version

curl 8.8.0

operating system

Windows Enterprise 11

@bagder
Copy link
Member

bagder commented Jul 12, 2024

please tell us a way how we can reproduce this!

@vuonganh1993
Copy link
Author

Hi @bagder ,
Attach the sample code and the sample email file.
For testing, I place the email file at "C:\test_email.txt", and then read the content as the input stream.

test_email.txt
send_email_code.txt

@icing
Copy link
Contributor

icing commented Jul 12, 2024

I can verify that there is a bug with input larger than 64kb.

@icing icing self-assigned this Jul 12, 2024
icing added a commit to icing/curl that referenced this issue Jul 12, 2024
When CRLF line end conversion was enabled (--crlf), input after
the last newline in the upload buffer was not sent, if the buffer
contained a newline.

- refs curl#14165
@vuonganh1993
Copy link
Author

Thank @icing

@icing
Copy link
Contributor

icing commented Jul 12, 2024

I propose #14169 as fix for this, including a modified test case to trigger the bug.

If you can build curl yourself it would be nice if you could verify this. (There is a Windows nightly build out there, I think, but could not find a link. Someone can help out here?)

@vszakats
Copy link
Member

vszakats commented Jul 12, 2024

Daily Windows builds can be found here, scroll down to Artifacts:
https://github.com/curl/curl-for-win/actions/workflows/daily.yml

(don't mind the red, it affects mac runners and pushed a(nother) fix just today.)

@bagder bagder closed this as completed in 9e5b11c Jul 15, 2024
meslubi2021 pushed a commit to Unity-Curl/curl that referenced this issue Jul 19, 2024
When CRLF line end conversion was enabled (--crlf), input after the last
newline in the upload buffer was not sent, if the buffer contained a
newline.

Reported-by: vuonganh1993 on github
Fixes curl#14165
Closes curl#14169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants