Bug 2008217

Summary: Camel: Understand non-standard "Content-Transfer-Encoding: uuencode"
Product: Red Hat Enterprise Linux 8 Reporter: Alex B <sitezreg>
Component: evolution-data-serverAssignee: Milan Crha <mcrha>
Status: CLOSED ERRATA QA Contact: Michal Odehnal <modehnal>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.4CC: mcrha, modehnal, tpelka
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: evolution-data-server-3.28.5-18.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 13:37:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
attachment test files
none
reproducer none

Description Alex B 2021-09-27 15:31:49 UTC
Created attachment 1826702 [details]
attachment test files

Created attachment 1826702 [details]
attachment test files

### Background:
We're running bunch of AIX systems and we have shell scripts generating some reporting CSV files (semi-colon delimited lists). Then we're using uuencode + mailx to send these reports to our sysadmins.
Our mail-server is MS Exchange on Azure/Office365 so some of us are using Microsoft OWA webUI and some are using Evolution-EWS clients.

### Issue description:
If the attached file is downloaded via Evolution it gets corrupted. It contains a bunch of garbage characters and can not be used. It is NOT an issue of the Libre-Office. Even if the file is opened via text-editor/vim/less it still has wrong content.
BUT if the SAME attachment of the SAME email is download via OWA it is perfectly fine and contains the expected content.
Meaning the source of the issue seems to be with Evolution itself (and not with uuencode/mailx or mailserver)

I am attaching three files:
- TEST_39_2021-09-27_int_SRC.csv - Is the test-generated file downloaded from one of the hosts (so NOT processed by uuencode/mailx)
- TEST_39_2021-09-27_int_OWA.csv - Is the file downloaded from the reporting mail via OWA - content is OK
- TEST_39_2021-09-27_int_EVO.csv - Is the file downloaded via Evolution client and which is "broken"

### Environment:
- OS: RHEL 8.4 (4.18.0-305.12.1.el8_4.x86_64)
- Desktop: KDE Plasma 5.18.4
- Qt ver: 5.12.5
- Evolution:
  - evolution-3.28.5-16.el8.x86_64
  - evolution-langpacks-3.28.5-16.el8.noarch
  - evolution-ews-3.28.5-10.el8.x86_64
  - evolution-ews-langpacks-3.28.5-10.el8.noarch
  - evolution-data-server-3.28.5-15.el8.x86_64
  - evolution-data-server-langpacks-3.28.5-15.el8.noarch
  - evolution-mapi-3.28.3-3.el8.x86_64
  - evolution-mapi-langpacks-3.28.3-3.el8.noarch
  - evolution-help-3.28.5-16.el8.noarch

Reported to Gnome Gitlab as well but closed as the "version is too old". Could we get the Evolution bumped in the RHEL 8.4 repos please?
Update: Reopened as the report is still valid even for recent 3.42.0

Alex

Comment 1 Alex B 2021-09-27 15:54:36 UTC
Tested Flatpak of Evolution version 3.42.0 - Exactly the same beahvior. Gitlab issue reopened.

Comment 2 Milan Crha 2021-09-27 16:21:06 UTC
Thanks for a bug report. Let's investigate it upstream first.

Comment 3 Milan Crha 2021-09-29 09:58:39 UTC
From the upstream investigation, the attachment is not corrupted, it's only not decoded. The reason is that the:

   Content-Transfer-Encoding: uuencode

is invalid according to the RFC 2045, it should be prefixed with "x-", thus:

   Content-Transfer-Encoding: x-uuencode

With that change the Evolution decodes the attachment content.

I asked it upstream, but no answer there yet, thus I'll ask here as well:

Who does fill the Content-Transfer-Encoding header, please? Is it your script or the mailx? If your script, then you should fix it to follow the standards.

Comment 4 Milan Crha 2021-09-30 15:11:48 UTC
Upstream bug [1] contains a workaround [2] for this. It can be backported.

[1] https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/361
[2] https://gitlab.gnome.org/GNOME/evolution-data-server/-/commit/882ebf6d101fbe4c1b51272e302732c5ab88d881

Comment 5 Milan Crha 2021-09-30 15:18:53 UTC
Created attachment 1827726 [details]
reproducer

The attachment is a reproducer, just import it to Evolution and check its content in the message preview.

Comment 9 errata-xmlrpc 2022-05-10 13:37:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (evolution-data-server bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1782