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

Split long subject to avoid RFC2047 violation, but only when String#scan is aware of multibyte strings. #1288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qnighy
Copy link

@qnighy qnighy commented Nov 2, 2018

I've hit RFC2047 violation ("An 'encoded-word' may not be more than 75 characters long") when sending a mail with a long Japanese subject. This led to a corrupted subject in some mailers, at least in Windows 10 Mail in conjunction with GMail IMAP.

I found that in history of mail, there was a character boundary problem with splitting multibyte characters. Therefore, in this patch, it only tries to split encoded words when String#scan seems to be able to split multibyte strings appropriately.

It doesn't check the RFC2047 constraint directly, but I think in most cases the encoded words will be within 75 bytes.

@qnighy
Copy link
Author

qnighy commented Nov 2, 2018

The failing tests seem unrelated to this PR. The current master also fails, at least in my local machine.

@qnighy qnighy force-pushed the rfc2047-encoded-word-limit branch from df6a4e7 to de70982 Compare July 19, 2019 09:54
@qnighy
Copy link
Author

qnighy commented Jul 19, 2019

Rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant