6.0.0-beta1
7/4/25

[#8948] INBOX prefix of folder stripped in prefs
Summary INBOX prefix of folder stripped in prefs
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester imp (at) lx-soft (dot) com
Created 04/06/2010 (5568 days ago)
Due
Updated 04/16/2010 (5558 days ago)
Assigned 04/16/2010 (5558 days ago)
Resolved 04/16/2010 (5558 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/16/2010 10:23:33 PM Michael Slusarz Comment #17
State ⇒ Resolved
Reply to this comment
Thanks for helping track these issues down.
04/16/2010 10:19:47 PM imp (at) lx-soft (dot) com Comment #16 Reply to this comment
Great Job!

Everything is solved for me
04/16/2010 10:06:42 PM Michael Slusarz Comment #15 Reply to this comment
Should be fixed.
04/16/2010 10:06:18 PM Git Commit Comment #14 Reply to this comment
04/16/2010 08:49:35 PM imp (at) lx-soft (dot) com Comment #12 Reply to this comment
It seems a lot better:
- The prefs are stored as expected (no INBOX. prefix).
- The prefs are displayed as expected.

A last "minor" issue appears when I try to compose email:
- Before switching between identities, it displays: "Save a copy in sent-mail"
- When I switch between identities, it display: "Save a copy in 
INBOX.sent-mail"

But, the mail is saved in the correct folder.

Meanwhile, there is a small typo error over there:

--- a/imp/lib/Prefs/Identity.php
+++ b/imp/lib/Prefs/Identity.php
@@ -515,7 +515,7 @@ class Imp_Prefs_Identity extends Horde_Prefs_Identity
      public function setValue($key, $val, $identity = null)
      {
          if ($key == 'sent_mail_folder') {
-            $val = IMP::folderPrefs($val, false);
+            $val = IMP::folderPref($val, false);
          }
          return parent::setValue($key, $val, $identity);
      }

04/16/2010 07:34:43 PM Michael Slusarz Comment #11
Assigned to Michael Slusarz
State ⇒ Feedback
Reply to this comment
OK - what about this?
04/15/2010 09:36:39 AM imp (at) lx-soft (dot) com Comment #9 Reply to this comment
Agree.

So, my problems are from the other side:

While debugging the source code, I found that my problem come from 
IMP::folderPref('some folder', true) function.

According to a cyrus IMAP backend, this function should add a 'INBOX.' 
prefix, if the folder is not INBOX, right? It's not the case...

Debugging of "IMP::folderPref('SPAM', true)":
folder = SPAM ; append = true;
def_ns = Array ( [name] => INBOX. [delimiter] => . [type] => personal 
[hidden] => )
empty_ns = Array ( [name] => [delimiter] => . [type] => shared [hidden] => )
GLOBALS['imp_imap']->getNamespace(folder) = Array ( [name] => 
[delimiter] => . [type] => shared [hidden] => )
if ($append) {
enter this if block
if (!is_null($empty_ns) && strpos($folder, $empty_ns['delimiter']) === 0) {
skip this if block
} elseif (($ns = $GLOBALS['imp_imap']->getNamespace($folder)) == null) {
skip this if block as ns is not null

So, folder value is not changed...
04/14/2010 11:22:58 PM Michael Slusarz Comment #8 Reply to this comment
Fine.

I've updated to latest git today. But, the issue is still there 
(cyrus IMAP backend).
Thus, I've attached a patch which solves the issue for me.
This breaks things for me.  And it makes no sense - IMP:folderPref() 
MUST be false when saving to the backend.  That's the whole point of 
IMP::folderPref().
04/14/2010 08:02:05 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Revert "Bug #8948: Fix sent-mail selection for non-empty namespaces"
This reverts commit 9d2152b7ddcc976ca796ae9801154181af3fc149.

http://git.horde.org/diff.php/imp/lib/Prefs/Ui.php?rt=horde-git&r1=c4a8bbfa852ae49c87acf4806c51b8c241af2f12&r2=055adb5538a560ebfedbf44555f5fcd64159b465
04/14/2010 01:32:59 PM imp (at) lx-soft (dot) com Comment #6
New Attachment: imp-pref-fix.patch Download
Reply to this comment
Fine.

I've updated to latest git today. But, the issue is still there (cyrus 
IMAP backend).
Thus, I've attached a patch which solves the issue for me.
04/14/2010 06:00:22 AM Michael Slusarz Comment #5 Reply to this comment
So, IMP strip the "INBOX." prefix: Normal behaviour
But, it does not add it again to recognize Draft/Trash/SPAM/sent-mail folder:
Works for me, except for an issue with sent-mail folder which was just 
fixed.  Considering the entire options UI was rewritten in the last 
few weeks, you may have fallen victim to a transient issue.
04/14/2010 05:59:33 AM Git Commit Comment #4 Reply to this comment
04/06/2010 09:53:05 PM imp (at) lx-soft (dot) com Comment #3
New Attachment: option_mail.PNG Download
Reply to this comment
Fine.

So, IMP strip the "INBOX." prefix: Normal behaviour
But, it does not add it again to recognize Draft/Trash/SPAM/sent-mail folder:

When I modify "Server and Folder Information" options, It saved 
correct values in database backend, but, IMP do not display (ie. 
recognize) the corresponding value (see screenshot attached).
04/06/2010 05:15:10 PM Michael Slusarz Comment #2
State ⇒ Not A Bug
Reply to this comment
This is precisely the expected behavior.  Mailbox names are stored 
without their namespace on purpose.  See IMP::folderPref().
04/06/2010 08:52:20 AM imp (at) lx-soft (dot) com Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ INBOX prefix of folder stripped in prefs
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
On my HORDE/IMP install, based on cyrus imap 2.2 + mysql backend,
the 'INBOX.' prefix of any folder is stripped in my prefs backend:

-------------------------------------------------------------------
: pref_uid : pref_scope : pref_name : pref_value
-------------------------------------------------------------------
: vink : imp : drafts_folder : Draft
: vink : imp : trash_folder : Trash
: vink : imp : spam_folder : SPAM
--------------------------------------------------------------------

When I add 'INBOX.' in front of these elements, these folders are 
correctly recognized in the horde/imp framework.

I've same issue with identites about sent-mail folder:
When composing e-mail, imp complains of not beeing able to create 
"sent-mail", but INBOX.sent-mail already exists. If I mannually edit 
the corresponding prefs in my backend (ie. rewrite sent-mail to 
INBOX.sent-mail), the issue is solved.


Saved Queries