diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-12-12 08:54:33 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-12-12 08:54:33 +0100 |
commit | bb5d7282855dd83ccdd211cb77d0776dce71468e (patch) | |
tree | 371bfc9a6e7fb5679fe6db5f59bc8acd353a2334 /program/steps/mail | |
parent | 3a1a361422c93da782d51719df5112fe734dd11c (diff) |
Use also Envelope-To for identity selection (#1488553)
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/compose.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index d181a72e6..d764f5289 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -455,6 +455,16 @@ function rcmail_identity_select($MESSAGE, $identities, $compose_mode) } } + // Fallback using Envelope-To + if ($from_idx === null && ($envelope_to = $MESSAGE->headers->others['envelope-to'])) { + foreach ($identities as $idx => $ident) { + if (in_array($ident['email_ascii'], (array)$envelope_to)) { + $from_idx = $idx; + break; + } + } + } + return $identities[$from_idx !== null ? $from_idx : $default_identity]; } |