[horde] Imp/Dimp Inbox incorrectly shows 0 emails

Michael M Slusarz slusarz at horde.org
Fri Dec 3 22:04:19 UTC 2010


Quoting Andy Dorman <adorman at ironicdesign.com>:

> On 12/03/2010 08:56 AM, Joe Besko wrote:
>>
>> If you try to change the default sorting options without deleting the
>> user's sortpref, it won't have any affect. The user's sortpref will
>> override the system's defaults. You need to delete the user's sortpref,
>> have the user log out, if logged in, then log in after deleting the
>> preference. We use mysql to store our user's prefs, and the sql code
>> looks like:
>>
>> Verify the preference:
>> select * from horde_prefs where pref_uid='<userid>' and pref_scope='imp'
>> and pref_name='sortpref';
>>
>> Deleting the preference:
>> delete from horde_prefs where pref_uid='<userid>' and pref_scope='imp'
>> and pref_name='sortpref';
>>
>> I'd be curious to know what the user was sorting his messages on.
>>
>> Good luck.
>>
>
> OK, Joe and Michael, thank you for all your suggestions.  But I  
> would love to know WHY this fixed the problem.  :-)
>
> We use OpenLDAP for the prefs because it is lightning fast and very  
> scalable. However, the tradeoff is that raw edits like you suggested  
> are not nearly as easy to do as they are with SQL.
>
> So I ended up writing a short script to find and clear the impPrefs:  
> sortpref attribute.  AND THE PROBLEM VANISHED WHEN THE ADDRESS  
> sortpref WAS REMOVED.
>
> The value I removed in OpenLDAP was this

The pertinent part of the sortpref (the value was PHP serialized and  
then base64 encoded, btw) for the INBOX was:

     [INBOX] => Array
         (
             [b] => 3
             [d] =>
         )

In the sortpref, 'b' is the value for sortBy.  And 3 is the c-client  
IMAP constant for SORTSUBJECT.  So the user was sorting by subject.

> We have asked the user to try and "recreate" his sort settings when  
> he has some time.  And if he can cause the problem again, now that I  
> KNOW what to look for, I will try the exact same settings on another  
> address.

Ask the user to sort by subject.

> And in the meantime, if anyone can explain why removing the address  
> sortpref fixed this, I would love to understand.  Is it possible we  
> have an option in the address sort prefs that we should not allow  
> for Cyrus IMAP?

By default, mailboxes are sorted by arrival (SORTARRIVAL php constant;  
see 'sortby' IMP pref).  There is a possibility that there is a  
message in his INBOX that is wonky - meaning it has something such as  
8-bit header characters (which is invalid).  it is also possible that  
this header is causing the internal sorting algorithm in c-client (or,  
less likely, cyrus itself) to fail which results in an empty list of  
messages in the mailbox.  So it requires the combo of a certain sort  
coupled with a specific kind of message to see this behavior (which is  
why most/all users never experience this).

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]




More information about the horde mailing list