tmail-flutter
tmail-flutter copied to clipboard
TF-2602 Fix charset is not set when I attach a `text/plain` attachment
Issue
#2602
Solution
Use flutter_charset_detector to detect charset of the text file.
Demo
https://github.com/linagora/tmail-flutter/assets/80730648/ea3daaaa-cf46-44a2-ac93-24c49408d8d2
Log
Related
We can review this PR to help it quickly merge
- https://github.com/amake/flutter_charset_detector/pull/6
This PR has been deployed to https://linagora.github.io/tmail-flutter/2634.
Hi BE team cc @chibenwa @quantranhong1999 , I found a problem:
Desc:
- I have set
charsetfor attachment files withmimeType=text/plainwhen sending emails and it was successful. - But when opening the received email, in the attachment the
charsetattribute is set by the jmap server to defaultus-ascii.
- Payload
Email/set:
- Response
Email/get
Question:
Is it wrong if I pass charset like that?. Does the server accept attachment charset changes?
The contentype shall be specified when uploading the blob:
Request method: POST
Request URI: http://localhost:34833/upload/29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Headers: accept=application/json; jmapVersion=rfc-8621
Content-Type=text/plain; charset=US_ASCII
Cookies: <none>
Multiparts: <none>
Body:
[49, 50, 51, 52, 53, 54, 55, 56, 57, 13, 10...
Likely the Email/set charset should be able to override the one of the upload though...
https://github.com/apache/james-project/pull/2081
- Tested again and it is working well on
preprodserver after BE release. - We should review and merge it @hoangdat
https://github.com/linagora/tmail-flutter/assets/80730648/1fafba55-7e59-4dc9-9755-bdba67ca558c
@dab246 Should this PR be rebased to refactor or we can review it at current state?
@dab246 Should this PR be rebased to
refactoror we can review it at current state?
Rebase on refactor. Please review again.
- [x] @dab246 please rebase and verify Memory leak for this PR. Please check it in both mobile and web.
- [x] @dab246 please rebase and verify Memory leak for this PR. Please check it in both mobile and web.
Memory leak
No leak
- Web:
https://github.com/user-attachments/assets/c4712777-6f9d-44b5-88da-587da1f3f5a0
- Mobile:
https://github.com/user-attachments/assets/9b131bc0-a449-4e4b-96e2-9ff61f15b65d