<?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>wrong trash folder options check in Message.php delete()</title> 
  <pubDate>Fri, 10 Apr 2026 09:21:03 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/5012</link> 
  <atom:link rel="self" type="application/rss+xml" title="wrong trash folder options check in Message.php delete()" href="https://bugs.horde.org/ticket/5012/rss" /> 
  <description>wrong trash folder options check in Message.php delete()</description> 
 
   
   
  <item> 
   <title>The following line will return a wrong result

if the user f</title> 
   <description>The following line will return a wrong result

if the user forgot to set the trash folder in

the IMP options:



$trash = IMP::folderPref($prefs-&gt;getValue(&#039;trash_folder&#039;), true);



$prefs-&gt;getValue(&#039;trash_folder&#039;)

returns nothing, however folderPref will prepend INBOX,

thus the trash folder will be INBOX, The following check

will not fail, however should:



...

$use_trash = $prefs-&gt;getValue(&#039;use_trash&#039;);

        if ($use_trash &amp;&amp; !$trash) {

...



and @imap_mail_move will report an error.</description> 
   <pubDate>Mon, 19 Feb 2007 18:57:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5012#t29610</link> 
  </item> 
   
  <item> 
   <title>No, $prefs-&gt;getValue(&#039;trash_folder&#039;) will return the default</title> 
   <description>No, $prefs-&gt;getValue(&#039;trash_folder&#039;) will return the default value from config/prefs.php when the user hasn&#039;t set a folder yet, and if you haven&#039;t broken your system.</description> 
   <pubDate>Wed, 21 Feb 2007 23:57:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5012#t29640</link> 
  </item> 
   
  <item> 
   <title>&gt; No, $prefs-&gt;getValue(&#039;trash_folder&#039;) will return the defau</title> 
   <description>&gt; No, $prefs-&gt;getValue(&#039;trash_folder&#039;) will return the default value 

&gt; from config/prefs.php when the user hasn&#039;t set a folder yet, and if 

&gt; you haven&#039;t broken your system.



I thought about having broken something too. But found nothing, and all the

other settings from prefs.php where readable. So I made a test with a vanilla

installation, with minor changes in servers.php. And came to the same results.



Here what happens:



Mail options &quot;Deleting and Moving messages&quot;, I enable the &quot;When deleting messages, move...&quot;

option. But dont choose a trash folder from the list. IMP will insert an empty trash_folder into the

horde_prefs table.



However, if I enable the very same option, choose &quot;Create a new trashfolder&quot;, instead of entering

the name press the cancel button, it works. IMP wont insert the empty trash_folder into the

horde_prefs table and uses the prefs.php setting.



And of course if giving a name for the trash folder when asked for, instead of pressing cancel,

that one will be used by IMP. 



So, the problem is quite somewhere else, namely in the page processing of the IMP options.

imp/lib/prefs.php  function handlefolders($updated, $pref, $folder, $new) does the following:

            if ($folder == IMP_PREF_NO_FOLDER) {

                $prefs-&gt;setValue($pref, &#039;&#039;);

            } else {

I think when a user chooses to move deleted messages to a trash folder this code fragment

does the wrong job. It should do as in the else part that follows, choose an appropriate trash

folder name and use it.



Thats the way I think about it. </description> 
   <pubDate>Sat, 24 Feb 2007 07:55:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5012#t29707</link> 
  </item> 
   
  <item> 
   <title>I&#039;m really not sure, I can see both actions being the right </title> 
   <description>I&#039;m really not sure, I can see both actions being the right one. Michael, Chuck, what do you think?</description> 
   <pubDate>Wed, 28 Feb 2007 18:29:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5012#t29877</link> 
  </item> 
   
  <item> 
   <title>Makes sense to only allow move to trash if a trash folder is</title> 
   <description>Makes sense to only allow move to trash if a trash folder is defined.  Fixed in HEAD and 4.1.4:

http://lists.horde.org/archives/cvs/Week-of-Mon-20070226/065652.html</description> 
   <pubDate>Thu, 01 Mar 2007 07:19:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5012#t29917</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
