<?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>Unable to get message content on pre_sent hook</title> 
  <pubDate>Fri, 10 Apr 2026 19:46:41 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/10306</link> 
  <atom:link rel="self" type="application/rss+xml" title="Unable to get message content on pre_sent hook" href="https://bugs.horde.org/ticket/10306/rss" /> 
  <description>Unable to get message content on pre_sent hook</description> 
 
   
   
  <item> 
   <title>After debugging this hook a bit I found that getContents() i</title> 
   <description>After debugging this hook a bit I found that getContents() is always returning an empty string.

I was using your Example #2 from hooks.php.dist</description> 
   <pubDate>Mon, 04 Jul 2011 16:01:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66147</link> 
  </item> 
   
  <item> 
   <title>Works fine here.</title> 
   <description>Works fine here.</description> 
   <pubDate>Tue, 05 Jul 2011 08:22:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66154</link> 
  </item> 
   
  <item> 
   <title>&gt; Works fine here.

Even with this syntax error? :P

htt</title> 
   <description>&gt; Works fine here.

Even with this syntax error? :P

https://github.com/horde/horde/blob/master/imp/config/hooks.php.dist#L208</description> 
   <pubDate>Tue, 05 Jul 2011 08:39:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66156</link> 
  </item> 
   
  <item> 
   <title>I assume you&#039;ve been able to fix that too.</title> 
   <description>I assume you&#039;ve been able to fix that too.</description> 
   <pubDate>Tue, 05 Jul 2011 11:05:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66159</link> 
  </item> 
   
  <item> 
   <title>Can this be closed?</title> 
   <description>Can this be closed?</description> 
   <pubDate>Tue, 12 Jul 2011 18:30:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66282</link> 
  </item> 
   
  <item> 
   <title>&gt; Can this be closed?

Just pulled your latest code (horde</title> 
   <description>&gt; Can this be closed?

Just pulled your latest code (horde code only) and I am still unable to use this hook.

$message-&gt;getContents() always return empty :\
</description> 
   <pubDate>Tue, 12 Jul 2011 19:03:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66287</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Can this be closed?
&gt;
&gt; Just pulled your latest code (h</title> 
   <description>&gt;&gt; Can this be closed?
&gt;
&gt; Just pulled your latest code (horde code only) and I am still unable 
&gt; to use this hook.
&gt;
&gt; $message-&gt;getContents() always return empty :\

Why are you using getContents()?  That only returns the text contained in the base part.  If sending text/html messages, this will always be empty (since it is a multipart/related part, which has not text of its own).</description> 
   <pubDate>Tue, 12 Jul 2011 19:14:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66288</link> 
  </item> 
   
  <item> 
   <title>&gt; Why are you using getContents()?  That only returns the te</title> 
   <description>&gt; Why are you using getContents()?  That only returns the text 
&gt; contained in the base part.  If sending text/html messages, this will 
&gt; always be empty (since it is a multipart/related part, which has not 
&gt; text of its own).

I was just trying to use the example provided. My knowledge of Mime_Part is not that much :X

Can you update hooks.php.dist with an example of how to do it with text/html messages? Please? :)
</description> 
   <pubDate>Tue, 12 Jul 2011 19:41:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66289</link> 
  </item> 
   
  <item> 
   <title>&gt; Can you update hooks.php.dist with an example of how to do</title> 
   <description>&gt; Can you update hooks.php.dist with an example of how to do it with 
&gt; text/html messages? Please? :)

*on how

Sorry my English :\</description> 
   <pubDate>Tue, 12 Jul 2011 19:46:24 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66290</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Ticket #1030</title> 
   <description>Changes have been made in Git for this ticket:

Ticket #10306: Correct way to search for compose message contents in HTML message

 1 files changed, 3 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/b0ba72085c12702e4eac6cb93496c01f90e5a407</description> 
   <pubDate>Wed, 13 Jul 2011 20:19:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66312</link> 
  </item> 
   
  <item> 
   <title>Added code to hooks.php to always grab the plaintext portion</title> 
   <description>Added code to hooks.php to always grab the plaintext portion of the message.</description> 
   <pubDate>Wed, 13 Jul 2011 20:20:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66313</link> 
  </item> 
   
  <item> 
   <title>&gt; Added code to hooks.php to always grab the plaintext porti</title> 
   <description>&gt; Added code to hooks.php to always grab the plaintext portion of the message.
Thank you Michael :D</description> 
   <pubDate>Thu, 14 Jul 2011 01:20:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66314</link> 
  </item> 
   
  <item> 
   <title>&gt; Added code to hooks.php to always grab the plaintext porti</title> 
   <description>&gt; Added code to hooks.php to always grab the plaintext portion of the message.

I was testing this hook now but I am still unable to use it :\

After some debug I found the problem. The Horde_Mime_Part received on pre_sent hook do not have any mimeid set so the contentTypeMap method always returns the first part only (multipart/alternative).

I fixed this using $message-&gt;buildMimeIds() just before using IMP_Contents.

I have no idea why this is happening.</description> 
   <pubDate>Wed, 20 Jul 2011 14:29:15 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66452</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Ticket #1030</title> 
   <description>Changes have been made in Git for this ticket:

Ticket #10306: Build MIME IDs when building message from contents

 1 files changed, 2 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/a997228094366e783f8ce0f9dcdf963e2dda0c43</description> 
   <pubDate>Wed, 20 Jul 2011 18:36:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66453</link> 
  </item> 
   
  <item> 
   <title>&gt; I have no idea why this is happening.

I have no idea, b</title> 
   <description>&gt; I have no idea why this is happening.

I have no idea, because this doesn&#039;t happen for me - buldMimeIds() is internally called somewhere so this should not be an issue.

Ahhh... you probably did not patch the Mime package with commit 16d7d4e08bc47cc43f70958ad2c0faeca5cbbe40.  That is also needed.

So I am going to revert what I just added - since it should not be needed and is unnecessary overhead.</description> 
   <pubDate>Wed, 20 Jul 2011 18:39:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66454</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Revert &quot;Tick</title> 
   <description>Changes have been made in Git for this ticket:

Revert &quot;Ticket #10306: Build MIME IDs when building message from contents&quot;
This reverts commit a997228094366e783f8ce0f9dcdf963e2dda0c43.

 1 files changed, 1 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/a4d7baf4cfaa663aa5635ef59171bb41beee7135</description> 
   <pubDate>Wed, 20 Jul 2011 18:39:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66455</link> 
  </item> 
   
  <item> 
   <title>&gt; Ahhh... you probably did not patch the Mime package with c</title> 
   <description>&gt; Ahhh... you probably did not patch the Mime package with commit 
&gt; 16d7d4e08bc47cc43f70958ad2c0faeca5cbbe40.  That is also needed.

That patch looks good indeed. I am almost sure I always pull your code before testing a bug. Tomorrow I will recheck that.
</description> 
   <pubDate>Wed, 20 Jul 2011 22:13:24 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66457</link> 
  </item> 
   
  <item> 
   <title>&gt; Ahhh... you probably did not patch the Mime package with c</title> 
   <description>&gt; Ahhh... you probably did not patch the Mime package with commit 
&gt; 16d7d4e08bc47cc43f70958ad2c0faeca5cbbe40.  That is also needed.

Confirmed. Working since this commit.

Thank you Michael :)</description> 
   <pubDate>Thu, 21 Jul 2011 17:07:51 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/10306#t66473</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
