Skip to content
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

Bump line length soft limit to 998 for headers #24

Open
emersion opened this issue Jul 25, 2018 · 6 comments
Open

Bump line length soft limit to 998 for headers #24

emersion opened this issue Jul 25, 2018 · 6 comments

Comments

@emersion
Copy link
Owner

The algorithm mangling long lines is pretty messy. I'd rather not use it when not needed.

See https://tools.ietf.org/html/rfc5322#section-2.1.1

@emersion emersion changed the title Bump line length limit to 998 Bump line length soft limit to 998 Jul 8, 2020
@maileroo
Copy link

maileroo commented Mar 1, 2024

Not sure why we are also having trouble with this. DKIM seems to be failing when truncating at 1,000 character, but seems to be doing fine at 994.

wc = nopCloser{textwrapper.New(w, "\r\n", 1000)}

@maileroo
Copy link

maileroo commented Mar 2, 2024

Think it might make more sense to check each individual line to see if its length is beyond 998 (or 1000) characters. Right now, it's introducing line-breaks every 1000 characters even though they are not really required.

@emersion
Copy link
Owner Author

emersion commented Mar 2, 2024

Line breaks every 998 characters at most are required by the RFC.

@maileroo
Copy link

maileroo commented Mar 2, 2024

Line breaks every 998 characters at most are required by the RFC.

Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

Yes, but the textwrapper seems to be doing every 998 characters. So if you've a 2,000 characters long email, it will split into two halves even though it may not be necessary. You only need to add a linebreak if a line is more than 998 characters.

Maybe I understand it incorrectly

@emersion
Copy link
Owner Author

emersion commented Mar 2, 2024

Yeah, that's not related to this issue though. I would've sworn that we have another issue tracking this but can't find it anymore...

@emersion
Copy link
Owner Author

emersion commented Mar 3, 2024

#176 should help with the issue you describe.

@emersion emersion changed the title Bump line length soft limit to 998 Bump line length soft limit to 998 for headers Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants