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

Allow empty quoted subject #2

Merged
merged 1 commit into from Jun 3, 2022
Merged

Conversation

monich
Copy link
Member

@monich monich commented Jun 2, 2022

Some software encodes empty MMS subject as 2 bytes: 0x7f 0x00. That's Quote and End-of-string characters according to WSP spec:

  Quote = <Octet 127>
  End-of-string = <Octet 0>

However the same section of WSP spec says this:

  Text-string = [Quote] *TEXT End-of-string

  If the first character in the TEXT is in the range of 128-255,
  a Quote character must precede it. Otherwise the Quote character
  must be omitted. The Quote is not part of the contents.

Since the subject is empty, the first character in the TEXT is not in the range of 128-255 (since there's no first character), therefore the Quote character must be omitted. But it's there. Such encoding is incorrect.

But let's allow it anyway.

Some software encodes empty MMS subject as 2 bytes: 0x7f 0x00.
That's Quote and End-of-string characters according to WSP spec:

  Quote = <Octet 127>
  End-of-string = <Octet 0>

However the same section of WSP spec says this:

  Text-string = [Quote] *TEXT End-of-string

  If the first character in the TEXT is in the range of 128-255,
  a Quote character must precede it. Otherwise the Quote character
  must be omitted. The Quote is not part of the contents.

Since the subject is empty, the first character in the TEXT is not
in the range of 128-255 (since there's no first character), therefore
the Quote character must be omitted. But it's there. Such encoding is
incorrect.

But let's allow it anyway.
@monich monich merged commit 4d7ccd8 into sailfishos:master Jun 3, 2022
@monich monich deleted the empty-subject branch June 3, 2022 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants