fix(mail): pick proper "from" address when replying/forwarding

Fixes #5056
This commit is contained in:
Francis Lachapelle
2020-07-06 12:17:11 -04:00
parent 089935297c
commit c99170b9bc
7 changed files with 173 additions and 78 deletions
@@ -443,7 +443,7 @@
return Message.$$resource.fetch(_this.$absolutePath({asDraft: true}), 'edit').then(function(data) {
// Try to match a known account identity from the specified "from" address
var identity = _.find(_this.$mailbox.$account.identities, function(identity) {
return data.from.toLowerCase().indexOf(identity.email) !== -1;
return data.from && data.from.toLowerCase().indexOf(identity.email) !== -1;
});
if (identity)
data.from = identity.full;