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

Bug > JMAP/get > Return incorrect result when using invalid header parse form #4012

Open
tlle14 opened this issue Nov 9, 2020 · 6 comments
Assignees
Labels
bug minor Priority of a bug - QA priorization tool

Comments

@tlle14
Copy link

tlle14 commented Nov 9, 2020

Actual Result

When using an invalid parse form of a header, it returns null instead of invalidArguments
image
image

Expected Result

Please confirm this expected result:

header: header-field-name: parse-form Result
  valid valid valid
  valid invalid invalidArguments
  invalid valid null
  invalid invalid null (I guess)

Example:

  1. "header:from:asAddresses" => Return the value
  2. "header:from:asDate" => Return invalidArguments
  3. "header:fro:asAddresses" => Return null
  4. "header:fro:asBlahBlah" => Return invalidArguments or null?

If you haven't implemented this requirement yet, please update the documentation
https://github.com/linagora/james-project/blob/master/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown

@tlle14 tlle14 added bug minor Priority of a bug - QA priorization tool labels Nov 9, 2020
@tlle14 tlle14 changed the title Return incorrect result when using invalid header parse form Bug > JMAP/get > Return incorrect result when using invalid header parse form Nov 9, 2020
@tlle14
Copy link
Author

tlle14 commented Nov 10, 2020

If you haven't implemented this requirement yet, please update the documentation
https://github.com/linagora/james-project/blob/master/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown

@Arsnael
Copy link
Member

Arsnael commented Nov 10, 2020

I would say:

  1. "header:from:asAddresses" => Return the value
  2. "header:from:asDate" => Return invalidArguments
  3. "header:fro:asAddresses" => Return invalidArguments
  4. "header:fro:asBlahBlah" => Return invalidArguments

The header field is an all. If the syntax of the field is incorrect, it is an error. Null is only returned if you fail to parse correctly the value of a header field. For example:

"header:from:asAddresses": "rcordier@linagora.com" => valid (valid header filed and valid value)

"header:from:asAddresses": "blabla" => should return null (valid header field but can't parse blabla as an email address)

Regarding documentation there is a task for this already planned: #3980

@chibenwa
Copy link
Member

chibenwa commented Nov 10, 2020

I (slightly) disagree.

I would say:

    1. "header:from:asAddresses" => Return the value
    1. "header:from:asDate" => Return invalidArguments (as from is implicitly known of being of type "asAdresses")
    1. "header:fro:asAddresses" => Return the value (we should enable other parsing options for fields we don't know)
    1. "header:fro:asBlahBlah" => Return invalidArguments (as BlahBlah is not a known header type)

"header:from:asAddresses": "blabla" => should return null (valid header field but can't parse blabla as an email address) => :+1:

@Arsnael
Copy link
Member

Arsnael commented Nov 10, 2020

Was not sure about point 3 but... I guess we can have custom headers too yes

@tlle14
Copy link
Author

tlle14 commented Nov 10, 2020

Was not sure about point 3 but... I guess we can have custom headers too yes

the point 3 means the header name is non-existing

@tlle14
Copy link
Author

tlle14 commented Nov 10, 2020

So I summarize as below:

the header filed parsed form = header:header-field-name:parse-form

  • Either the header-filed-name or parse-form is invalid, the header filed parsed form is still invalid and returns invalidArguments because it is.
  • Only return null when the value of the header field parsed form is invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug minor Priority of a bug - QA priorization tool
Projects
None yet
Development

No branches or pull requests

4 participants