chore(tool): fallback to NGImap4ConnectionStringSeparator

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
pull/274/head
Francis Lachapelle 2020-05-05 10:48:12 -04:00
parent 1fa4b8871d
commit 5da7903ce1
1 changed files with 8 additions and 3 deletions

View File

@ -843,7 +843,7 @@ static NSString *sieveScriptName = @"sogo";
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;
@ -901,12 +901,17 @@ static NSString *sieveScriptName = @"sogo";
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])