View Issue Details

IDProjectCategoryView StatusLast Update
0005664SOGoActiveSyncpublic2023-04-27 14:26
ReporterAndreyEver Assigned Tosebastien  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.8.0 
Fixed in Version5.8.3 
Summary0005664: Wrong decoding emails in Outlook via EAS
Description

Some emails wrongly decoded when accessing in Outlook via EAS

Additional Information

EML file attached.

Via Sogo webmail - OK
Outlook Via IMAP - OK
Outlook Via EAS - NOK

TagsActiveSync, encoding

Activities

AndreyEver

AndreyEver

2022-12-20 14:50

reporter  

message.eml (12,367 bytes)
outlook_pc_eas.jpg (100,885 bytes)   
outlook_pc_eas.jpg (100,885 bytes)   
webmail_sogo.jpg (64,608 bytes)   
webmail_sogo.jpg (64,608 bytes)   
outlook_mobile_eas.jpg (108,477 bytes)   
outlook_mobile_eas.jpg (108,477 bytes)   
AndreyEver

AndreyEver

2023-03-02 17:43

reporter   ~0016710

Any chance to get this fixed?
Workaround to view such mails in Webmail is quite painful(

AndreyEver

AndreyEver

2023-03-02 17:45

reporter   ~0016711

Outlook displays such mails corrupted only via EAS (via IMAP no issue)

tfu

tfu

2023-04-23 16:04

reporter   ~0016860

Problem seems to be that the contnet-type specifies charset=us7-ascii and html part specifies <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.
This combination is not handled in SOGoMailObject+ActiveSync.m.

Perhaps we can just assume utf-8 if us-ascii is specified:

diff --git a/ActiveSync/SOGoMailObject+ActiveSync.m b/ActiveSync/SOGoMailObject+ActiveSync.m
index 91e611df5..a975752ef 100644
--- a/ActiveSync/SOGoMailObject+ActiveSync.m
+++ b/ActiveSync/SOGoMailObject+ActiveSync.m
@@ -410,7 +410,7 @@ struct GlobalObjectId {

   charset = [[[self lookupInfoForBodyPart: key] objectForKey: @&quot;parameterList&quot;] objectForKey: @&quot;charset&quot;];
  • if (![charset length])

  • if (![charset length] || [charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
    charset = @"utf-8";

    s = [NSString stringWithData: d usingEncodingNamed: charset];
    @@ -708,7 +708,7 @@ struct GlobalObjectId {

       charset = [[[self lookupInfoForBodyPart: @&quot;&quot;] objectForKey: @&quot;parameterList&quot;] objectForKey: @&quot;charset&quot;];
  • if (![charset length])

  • if (![charset length] || [charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
    charset = @"utf-8";

       d = [[self fetchPlainTextParts] objectForKey: @&quot;&quot;];
AndreyEver

AndreyEver

2023-04-25 08:56

reporter   ~0016872

any chance to get this patch merged to master?

sebastien

sebastien

2023-04-25 09:02

administrator   ~0016873

Hi can anybody can do a pull request ?

Sebastien

sebastien

sebastien

2023-04-26 07:51

administrator   ~0016881

Commit : https://github.com/Alinto/sogo/commit/39ab482b7f1a9206528a3e9fdb229b3b4e276baf

Please test next nightly build and provide feedback

Sebastien

sebastien

sebastien

2023-04-26 11:53

administrator   ~0016886

Now available for testing

Issue History

Date Modified Username Field Change
2022-12-20 14:50 AndreyEver New Issue
2022-12-20 14:50 AndreyEver File Added: message.eml
2022-12-20 14:50 AndreyEver File Added: outlook_pc_eas.jpg
2022-12-20 14:50 AndreyEver File Added: webmail_sogo.jpg
2022-12-20 14:50 AndreyEver File Added: outlook_mobile_eas.jpg
2023-03-02 17:43 AndreyEver Note Added: 0016710
2023-03-02 17:45 AndreyEver Note Added: 0016711
2023-03-02 17:51 AndreyEver Tag Attached: ActiveSync
2023-03-02 17:51 AndreyEver Tag Attached: encoding
2023-04-23 16:04 tfu Note Added: 0016860
2023-04-25 08:56 AndreyEver Note Added: 0016872
2023-04-25 09:02 sebastien Note Added: 0016873
2023-04-26 07:51 sebastien Note Added: 0016881
2023-04-26 07:51 sebastien Assigned To => sebastien
2023-04-26 07:51 sebastien Status new => feedback
2023-04-26 11:53 sebastien Note Added: 0016886
2023-04-27 14:26 sebastien Status feedback => resolved
2023-04-27 14:26 sebastien Resolution open => fixed
2023-04-27 14:26 sebastien Fixed in Version => 5.8.3