feat(acccount): Add read only account

This commit is contained in:
Hivert Quentin committed 2026-10-21 09:33:37 +02:00
1 parent 01f545b0b3
commit 370a4a433c
9 files changed
+120 -40

No files matched your search

+11
View File
@@ -276,6 +276,7 @@
NSURL * smtpUrl;
SOGoUser* user;
SOGoSystemDefaults *sd;
SOGoDomainDefaults *domainDefaults;
BOOL doSmtpAuth;
result = nil;
@@ -325,6 +326,16 @@
{
login = [currentAcount objectForKey: @"userName"];
password = [currentAcount objectForKey: @"password"];
domainDefaults = [[woContext activeUser] domainDefaults];
if(!password && [domainDefaults mailAuxiliaryUserAccountsReadOnly] && [currentAcount objectForKey: @"readOnly"])
{
//If aux account is read only with no password, user the current user one instead
protocol = @"imap";
if ([encryption isEqualToString: @"ssl"] || [encryption isEqualToString: @"tls"])
protocol = @"imaps";
server = [NSString stringWithFormat: @"%@://%@", protocol, [currentAcount objectForKey: @"serverName"]];
password = [authenticator smtpPasswordInContext: woContext forURL: server];
}
smtpAuthMethod = @"plain"; //Only support plain for auxiliary account
}
else