<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>ActiveSync mail setting From: header</title> 
  <pubDate>Fri, 10 Apr 2026 09:36:28 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/14988</link> 
  <atom:link rel="self" type="application/rss+xml" title="ActiveSync mail setting From: header" href="https://bugs.horde.org/ticket/14988/rss" /> 
  <description>ActiveSync mail setting From: header</description> 
 
   
   
  <item> 
   <title>The From: header of mail being sent through ActiveSync is no</title> 
   <description>The From: header of mail being sent through ActiveSync is not replaced with the information (address and full name) given by the identity chosen in the ActiveSync preferences. Only the (wrong) information sent by the client is passed through.</description> 
   <pubDate>Sat, 08 Feb 2020 14:30:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93633</link> 
  </item> 
   
  <item> 
   <title>&gt; The From: header of mail being sent through ActiveSync is </title> 
   <description>&gt; The From: header of mail being sent through ActiveSync is not 
&gt; replaced with the information (address and full name) given by the 
&gt; identity chosen in the ActiveSync preferences. Only the (wrong) 
&gt; information sent by the client is passed through.

Cannot reproduce. Selecting an identity other than &quot;Horde&quot; in the ActiveSync preferences correctly replaces the From: header in the outgoing email.  Note that the activesync log will NOT show this replaced header, as it only shows what is being sent from the device.  Looking at the email received by the recipient, I see the correct From header.</description> 
   <pubDate>Mon, 10 Feb 2020 00:42:00 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93634</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; The From: header of mail being sent through ActiveSync is</title> 
   <description>&gt;&gt; The From: header of mail being sent through ActiveSync is not
&gt;&gt; replaced with the information (address and full name) given by the
&gt;&gt; identity chosen in the ActiveSync preferences. Only the (wrong)
&gt;&gt; information sent by the client is passed through.
&gt;
&gt; Cannot reproduce. Selecting an identity other than &quot;Horde&quot; in the 
&gt; ActiveSync preferences correctly replaces the From: header in the 
&gt; outgoing email.  Note that the activesync log will NOT show this 
&gt; replaced header, as it only shows what is being sent from the device. 
&gt;  Looking at the email received by the recipient, I see the correct 
&gt; From header.

It&#039;s been a while, sorry for the late feedback. Can&#039;t get it to work here. Under &quot;Global Preferences&quot; &gt; &quot;Active Sync&quot; my setting is &quot;Default Identity&quot; for &quot;Identity to use when sending email via ActiveSync.&quot;. And I do have a default identity defined under &quot;Preferences for Mail&quot; &gt; &quot;Personal Information&quot;. Any hints, eventually also on how to debug are most welcome.</description> 
   <pubDate>Sun, 24 May 2020 07:08:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93724</link> 
  </item> 
   
  <item> 
   <title>
Does the &quot;Default Identity&quot; entry have a &quot;The default e-ma</title> 
   <description>
Does the &quot;Default Identity&quot; entry have a &quot;The default e-mail address to use with this identity:&quot; value set?

Other things to try:
Use the administrative sql shell and execute:

SELECT * FROM horde_prefs WHERE pref_name=&#039;activesync_identity&#039;;

If you have something other than &quot;use horde default&quot; set in the prefs, this will be some number. Probably &#039;0&#039; for the original default identity.


Then, in the administrative PHP shell:

ident = $injector-&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)-&gt;create(&#039;your_username_here&#039;);
var_dump($ident-&gt;getValue(&#039;from_addr&#039;, x);  // replace &#039;x&#039; with the number returned from the query above.

This should output the email address that activesync will use as the From address of outgoing email.</description> 
   <pubDate>Mon, 25 May 2020 18:21:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93728</link> 
  </item> 
   
  <item> 
   <title>&gt; Does the &quot;Default Identity&quot; entry have a &quot;The default e-ma</title> 
   <description>&gt; Does the &quot;Default Identity&quot; entry have a &quot;The default e-mail address 
&gt; to use with this identity:&quot; value set?
&gt;
&gt; Other things to try:
&gt; Use the administrative sql shell and execute:
&gt;
&gt; SELECT * FROM horde_prefs WHERE pref_name=&#039;activesync_identity&#039;;
&gt;
&gt; If you have something other than &quot;use horde default&quot; set in the 
&gt; prefs, this will be some number. Probably &#039;0&#039; for the original 
&gt; default identity.
&gt;
&gt;
&gt; Then, in the administrative PHP shell:
&gt;
&gt; ident = 
&gt; $injector-&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)-&gt;create(&#039;your_username_here&#039;);
&gt; var_dump($ident-&gt;getValue(&#039;from_addr&#039;, x);  // replace &#039;x&#039; with the 
&gt; number returned from the query above.
&gt;
&gt; This should output the email address that activesync will use as the 
&gt; From address of outgoing email.

Yes, the default identity has an e-mail address set.

SELECT * FROM horde_prefs WHERE pref_name=&#039;activesync_identity&#039;;

in the SQL Shell delivers:

pref_uid 	pref_scope 	pref_name 	pref_value
&lt;username&gt; 	horde 	activesync_identity 	0

$ident=$injector-&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)-&gt;create(&#039;&lt;username&gt;&#039;);
var_dump($ident-&gt;getValue(&#039;from_addr&#039;,0));

in the PHP shell correctly delivers the e-mail address set for the default identity. Still, this address is not set in the &quot;From&quot; header when sending messages via ActiveSync. Here an excerpt from Core/ActiveSync/Mail.php:

    public function setRawMessage(Horde_ActiveSync_Rfc822 $raw)
    {
        $this-&gt;_headers = $raw-&gt;getHeaders();
   
        // Attempt to always use the identity&#039;s From address, but fall back
  	// to the device&#039;s sent value if it&#039;s not present.
        if ($from = $this-&gt;_getIdentityFromAddress()) {
            $this-&gt;_headers-&gt;removeHeader(&#039;From&#039;);
            $this-&gt;_headers-&gt;addHeader(&#039;From&#039;, $from);
        }
 
        // Reply-To?
  	if ($replyto = $this-&gt;_getReplyToAddress()) {
            $this-&gt;_headers-&gt;addHeader(&#039;Reply-To&#039;, $replyto);
        }
 
        $this-&gt;_raw = $raw;
    }

The first &quot;if&quot; seems to fail so the &quot;From&quot; header is not removed and set to the default identity. How can I debug that one? Thanks for any help.</description> 
   <pubDate>Wed, 03 Jun 2020 20:12:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93735</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Does the &quot;Default Identity&quot; entry have a &quot;The default e-m</title> 
   <description>&gt;&gt; Does the &quot;Default Identity&quot; entry have a &quot;The default e-mail address
&gt;&gt; to use with this identity:&quot; value set?
&gt;&gt;
&gt;&gt; Other things to try:
&gt;&gt; Use the administrative sql shell and execute:
&gt;&gt;
&gt;&gt; SELECT * FROM horde_prefs WHERE pref_name=&#039;activesync_identity&#039;;
&gt;&gt;
&gt;&gt; If you have something other than &quot;use horde default&quot; set in the
&gt;&gt; prefs, this will be some number. Probably &#039;0&#039; for the original
&gt;&gt; default identity.
&gt;&gt;
&gt;&gt;
&gt;&gt; Then, in the administrative PHP shell:
&gt;&gt;
&gt;&gt; ident =
&gt;&gt; $injector-&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)-&gt;create(&#039;your_username_here&#039;);
&gt;&gt; var_dump($ident-&gt;getValue(&#039;from_addr&#039;, x);  // replace &#039;x&#039; with the
&gt;&gt; number returned from the query above.
&gt;&gt;
&gt;&gt; This should output the email address that activesync will use as the
&gt;&gt; From address of outgoing email.
&gt;
&gt; Yes, the default identity has an e-mail address set.
&gt;
&gt; SELECT * FROM horde_prefs WHERE pref_name=&#039;activesync_identity&#039;;
&gt;
&gt; in the SQL Shell delivers:
&gt;
&gt; pref_uid 	pref_scope 	pref_name 	pref_value
&gt; &lt;username&gt; 	horde 	activesync_identity 	0
&gt;
&gt; $ident=$injector-&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)-&gt;create(&#039;&lt;username&gt;&#039;);
&gt; var_dump($ident-&gt;getValue(&#039;from_addr&#039;,0));
&gt;
&gt; in the PHP shell correctly delivers the e-mail address set for the 
&gt; default identity. Still, this address is not set in the &quot;From&quot; header 
&gt; when sending messages via ActiveSync. Here an excerpt from 
&gt; Core/ActiveSync/Mail.php:
&gt;
&gt;     public function setRawMessage(Horde_ActiveSync_Rfc822 $raw)
&gt;     {
&gt;         $this-&gt;_headers = $raw-&gt;getHeaders();
&gt;
&gt;         // Attempt to always use the identity&#039;s From address, but fall back
&gt;   	// to the device&#039;s sent value if it&#039;s not present.
&gt;         if ($from = $this-&gt;_getIdentityFromAddress()) {
&gt;             $this-&gt;_headers-&gt;removeHeader(&#039;From&#039;);
&gt;             $this-&gt;_headers-&gt;addHeader(&#039;From&#039;, $from);
&gt;         }
&gt;
&gt;         // Reply-To?
&gt;   	if ($replyto = $this-&gt;_getReplyToAddress()) {
&gt;             $this-&gt;_headers-&gt;addHeader(&#039;Reply-To&#039;, $replyto);
&gt;         }
&gt;
&gt;         $this-&gt;_raw = $raw;
&gt;     }
&gt;
&gt; The first &quot;if&quot; seems to fail so the &quot;From&quot; header is not removed and 
&gt; set to the default identity. How can I debug that one? Thanks for any 
&gt; help.

If that if is failing, then you need to figure out why _getIdentityFromAddress() is returning an empty value.  Use some debug logging in that method with Horde::debug() as so:

    protected function _getIdentityFromAddress()
    {
        global $prefs;

        $ident = $GLOBALS[&#039;injector&#039;]
            -&gt;getInstance(&#039;Horde_Core_Factory_Identity&#039;)
            -&gt;create($this-&gt;_user);

        $as_ident = $prefs-&gt;getValue(&#039;activesync_identity&#039;);
        $name = $ident-&gt;getValue(&#039;fullname&#039;, $as_ident == &#039;horde&#039; ? $prefs-&gt;getValue(&#039;default_identity&#039;) : $prefs-&gt;getValue(&#039;activesync_identity&#039;));
        $from_addr = $ident-&gt;getValue(&#039;from_addr&#039;, $as_ident == &#039;horde&#039; ? $prefs-&gt;getValue(&#039;default_identity&#039;) : $prefs-&gt;getValue(&#039;activesync_identity&#039;));
        
       // ADD LOGGING
      Horde::debug($this-&gt;_user);  // This should output the Horde username.
      Horde::debug($from_addr);   // This should output the address you expect. If it doesn&#039;t, it&#039;s probably not the identity you think it is.
      Horde::debug($name);          // This should ouput the human readable username configured in the identity.
     

        if (empty($from_addr)) {
            return;
        }
        $rfc822 = new Horde_Mail_Rfc822_Address($from_addr);
        $rfc822-&gt;personal = $name;

        // ADD LOGGING
       Horde::debug($rfc822-&gt;encoded);  // If this is empty, probably something wrong with the format of the email address.

        return $rfc822-&gt;encoded;
    }


The log entries will be written to a file called horde_debug.txt located in your system&#039;s temporary directory (or the temp directory configured in Horde, if different).

</description> 
   <pubDate>Sun, 07 Jun 2020 17:40:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14988#t93741</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
