linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

[Bug] [james-mime4j] AddressListFieldLenientImpl parse AddressList incorrect #5086

Closed vttranlina closed 4 months ago

vttranlina commented 6 months ago

When parsing the rawField To: name1 <invalid1> by AddressListFieldLenientImpl The AddressList return incorrect

Actual: size 2 ("invalid", ">")

Expected: size 1 ("invalid")

image

vttranlina commented 6 months ago

Bug of repo https://github.com/apache/james-mime4j But I can not create new issue on that repository. Please move it if creation the issue here is incorrect

chibenwa commented 6 months ago

https://issues.apache.org/jira/projects/MIME4J/issues/MIME4J-251?filter=allopenissues

chibenwa commented 6 months ago

We can keep the isues here.

chibenwa commented 6 months ago

And what if... To: invalid how would mime4j parse this?

image

image

image

The current use case would be to: [{name: null, email: "invalid"}].

So this corner case is not a blocker.

vttranlina commented 6 months ago

I think have a confusion here. Currently, Tmail does not approve invalid email addresses when saving a draft However, this behavior is expected to change after addressing ticket https://github.com/linagora/james-project/issues/5075

Then. Tmail will save a draft email, that has to: [{name: null, email: "invalid"}] And because of this issue, when "Email/get" the draft email, it will appear as:

"to": [
  {
      "name": "name1",
      "email": "invalid1"
  },
  {
      "email": ">"
  }
]
chibenwa commented 6 months ago

Ok

chibenwa commented 6 months ago

Not a critical blocker, just a very very nice to have.

How about by the time we get this fixed we filter in the JMAP stack the lone > email? Not clean but it would do as a temporary fix...

vttranlina commented 4 months ago

james-mime4j pr: https://github.com/apache/james-mime4j/pull/102