View Issue Details

IDProjectCategoryView StatusLast Update
0005236SOGoWeb Mailpublic2022-04-06 18:13
Reporterphilippg Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version5.0.1 
Summary0005236: Umlauts äöü in sieve scripts incorrectly used
Description

If I create a filter (for sieve) in the SOGO web interface and the folder contains a german umlaut (ö, ä, ü), then the rule is not stored correctly.

The seive script contains then:

if allof (address :contains "from" "@test.com") {
    fileinto "INBOX/Gesch&AOQ-ftlich/test/test1";
}
Steps To Reproduce

Generate a sieve filter for folter called INBOX/Geschäftlich/test/test1

TagsNo tags attached.

Activities

Waschbuesch

Waschbuesch

2021-02-04 14:22

reporter   ~0015071

I can confirm this.
Even with SOGoSieveFolderEncoding set to "UTF-8", the sieve filter script output seems to be modified UTF-7.

schmirl

schmirl

2022-02-25 09:03

reporter   ~0015919

Sieve expects the foldername in UTF8 encoding, not as mUTF7. The attached patch fixes this.

sogo-5.5.1-sieve_folder_encoding.patch (1,027 bytes)   
--- SoObjects/SOGo/SOGoSieveManager.m.orig	2021-11-18 21:53:17.000000000 +0100
+++ SoObjects/SOGo/SOGoSieveManager.m	2022-02-15 15:29:08.352000000 +0100
@@ -37,6 +37,7 @@
 #import <NGImap4/NGImap4Connection.h>
 #import <NGImap4/NGImap4Client.h>
 #import <NGImap4/NGSieveClient.h>
+#import <NGImap4/NSString+Imap4.h>
 #import <NGObjWeb/NSException+HTTP.h>
 
 #import "../Mailer/SOGoMailAccount.h"
@@ -529,8 +530,9 @@
               else if ([method isEqualToString: @"fileinto"])
                 {
                   mailbox
-                    = [[argument componentsSeparatedByString: @"/"]
-                          componentsJoinedByString: delimiter];
+                    = [[[argument componentsSeparatedByString: @"/"]
+                          componentsJoinedByString: delimiter]
+                          stringByDecodingImap4FolderName];
                   sieveAction = [NSString stringWithFormat: @"%@ %@",
                                           method, [mailbox asSieveQuotedString]];
                 }
francis

francis

2022-04-06 18:13

administrator   ~0015961

If you set SOGoSieveFolderEncoding = &quot;UTF-8&quot;;, the Sieve script will use UTF-8 encoding.

However, changing this parameter will require all users to revisit their filters and specify the destination folders again before saving their filters again.

Issue History

Date Modified Username Field Change
2020-12-19 20:01 philippg New Issue
2021-02-04 14:22 Waschbuesch Note Added: 0015071
2022-02-25 09:03 schmirl Note Added: 0015919
2022-02-25 09:03 schmirl File Added: sogo-5.5.1-sieve_folder_encoding.patch
2022-04-06 17:50 francis Description Updated
2022-04-06 18:13 francis Assigned To => francis
2022-04-06 18:13 francis Status new => closed
2022-04-06 18:13 francis Resolution open => no change required
2022-04-06 18:13 francis Note Added: 0015961