mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-08 15:08:00 +00:00
feat(accounts): Can now add smtp server to auxilliary accounts
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user