Skip to content

Commit

Permalink
Fix regression when sending ActiveSync email and no From address is s…
Browse files Browse the repository at this point in the history
…upplied in identity prefs.

Bug: 13346
  • Loading branch information
mrubinsk committed Jul 12, 2014
1 parent 8a1f6d0 commit 809d65e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions framework/Core/lib/Horde/Core/ActiveSync/Mail.php
Expand Up @@ -160,8 +160,14 @@ public function &__get($property)
public function setRawMessage(Horde_ActiveSync_Rfc822 $raw)
{
$this->_headers = $raw->getHeaders();
$this->_headers->removeHeader('From');
$this->_headers->addHeader('From', $this->_getIdentityFromAddress());

// Attempt to always use the identity's From address, but fall back
// to the device's sent value if it's not present.
$from = $this->_getIdentityFromAddress();
if (!empty($from)) {
$this->_headers->removeHeader('From');
$this->_headers->addHeader('From', $from);
}
$this->_raw = $raw;
}

Expand Down Expand Up @@ -419,6 +425,9 @@ protected function _getIdentityFromAddress()
$as_ident = $prefs->getValue('activesync_identity');
$name = $ident->getValue('fullname', $as_ident == 'horde' ? $prefs->getValue('default_identity') : $prefs->getValue('activesync_identity'));
$from_addr = $ident->getValue('from_addr', $as_ident == 'horde' ? $prefs->getValue('default_identity') : $prefs->getValue('activesync_identity'));
if (empty($from_addr)) {
return;
}
$rfc822 = new Horde_Mail_Rfc822_Address($from_addr);
$rfc822->personal = $name;

Expand Down

0 comments on commit 809d65e

Please sign in to comment.