fix(preferences(js)): sanitize mail identities when saving

This commit is contained in:
Francis Lachapelle
2020-09-10 12:23:54 -04:00
parent 64a8ce4048
commit aa706796c2
2 changed files with 11 additions and 1 deletions
@@ -687,6 +687,16 @@
});
});
// See Account.prototype.$omit
_.forEach(preferences.defaults.AuxiliaryMailAccounts, function (account) {
var identities = [];
_.forEach(account.identities, function (identity) {
if (!identity.isReadOnly)
identities.push(_.pick(identity, ['email', 'fullName', 'replyTo', 'signature', 'isDefault']));
});
account.identities = identities;
});
if (!preferences.defaults.SOGoMailComposeWindowEnabled)
delete preferences.defaults.SOGoMailComposeWindow;
delete preferences.defaults.SOGoMailComposeWindowEnabled;