Skip to content

Commit

Permalink
chore(tool): fallback to NGImap4ConnectionStringSeparator
Browse files Browse the repository at this point in the history
When using a master user to update the Sieve scripts through sogo-tool,
we may not be able to detect the IMAP delimiter. Therefore, we must
fallback to the default NGImap4ConnectionStringSeparator.

Fixes #4919
  • Loading branch information
cgx committed May 5, 2020
1 parent 1fa4b88 commit 5da7903
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions SoObjects/SOGo/SOGoSieveManager.m
Expand Up @@ -843,7 +843,7 @@ - (NSException *) updateFiltersForAccount: (SOGoMailAccount *) theAccount
andPassword: (NSString *) thePassword
forceActivation: (BOOL) forceActivation
{
NSString *filterScript, *v, *content, *message;
NSString *filterScript, *v, *delimiter, *content, *message;
NSMutableArray *req;
NSMutableString *script, *header;
NSDictionary *result, *values;
Expand Down Expand Up @@ -901,12 +901,17 @@ - (NSException *) updateFiltersForAccount: (SOGoMailAccount *) theAccount
else
imapClient = [[theAccount imap4Connection] client];

if (![imapClient delimiter])
delimiter = [imapClient delimiter];

if (!delimiter)
[imapClient list: @"INBOX" pattern: @""];

if (!delimiter)
delimiter = [dd stringForKey: @"NGImap4ConnectionStringSeparator"];

// We first handle filters
filterScript = [self sieveScriptWithRequirements: req
delimiter: [imapClient delimiter]];
delimiter: delimiter];
if (filterScript)
{
if ([filterScript length])
Expand Down

0 comments on commit 5da7903

Please sign in to comment.