feat(accounts): Can now add smtp server to auxilliary accounts

This commit is contained in:
Hivert Quentin
2024-02-08 17:07:25 +01:00
parent f5cd67972b
commit adc2d74e54
9 changed files with 87 additions and 52 deletions
@@ -232,6 +232,7 @@
"New Mail Account" = "New Mail Account";
"Server Name" = "Server Name";
"Outgoing Server Name (SMTP)" = "Outgoing Server Name (SMTP)";
"Smtp Auth" = "Smtp Auth";
"Port" = "Port";
"Encryption" = "Encryption";
"Outgoing Encryption" = "Outgoing Encryption";
@@ -232,6 +232,7 @@
"New Mail Account" = "Nouveau compte";
"Server Name" = "Serveur";
"Outgoing Server Name (SMTP)" = "Serveur sortant (SMTP)";
"Smtp Auth" = "Smtp Auth";
"Port" = "Port";
"Encryption" = "Chiffrement";
"Outgoing Encryption" = "Chiffrement sortant";
-31
View File
@@ -513,37 +513,6 @@ static SoProduct *preferencesProduct = nil;
}
[auxAccount setObject: limitedSecurity forKey: @"security"];
}
//Decrypt password if needed
sogoSecret = [[SOGoSystemDefaults sharedSystemDefaults] sogoSecretValue];
if (sogoSecret)
{
if(![[auxAccount objectForKey: @"password"] isKindOfClass: [NSDictionary class]])
{
[self errorWithFormat:@"Can't decrypt the password for auxiliary account %@, is not a dictionnary",
[auxAccount objectForKey: @"name"]];
continue;
}
accountPassword = [auxAccount objectForKey: @"password"];
encryptedPassword = [accountPassword objectForKey: @"cypher"];
iv = [accountPassword objectForKey: @"iv"];
tag = [accountPassword objectForKey: @"tag"];
if([encryptedPassword length] > 0)
{
NS_DURING
password = [encryptedPassword decryptAES256GCM: sogoSecret iv: iv tag: tag exception:&exception];
NS_HANDLER
[self errorWithFormat:@"Can't decrypt the password for auxiliary account %@, probably not encrypted.",
[auxAccount objectForKey: @"name"]];
password = [auxAccount objectForKey: @"password"];
NS_ENDHANDLER
if(exception)
[self errorWithFormat:@"Can't decrypt the password for auxiliary account %@: %@",
[auxAccount objectForKey: @"name"], [exception reason]];
else
[auxAccount setObject: password forKey: @"password"];
}
}
}
}
// We inject our default mail account
+1 -1
View File
@@ -1359,7 +1359,7 @@ static NSArray *reminderValues = nil;
if (!knownKeys)
{
knownKeys = [NSArray arrayWithObjects: @"id", @"name", @"serverName", @"port",
@"smtpServerName", @"smtpPort", @"smtpEncryption",
@"smtpServerName", @"smtpPort", @"smtpEncryption", @"smtpAuth",
@"userName", @"password", @"encryption", @"replyTo",
@"identities", @"mailboxes", @"forceDefaultIdentity",
@"receipts", @"security", @"isNew",