Hi Ilja, > Isn't the simplest solution this: > > change the query for the special case of 'INBOX' to: > > SELECT mailbox_idnr FROM mailboxes WHERE name = 'INBOX' and owner_idnr = > '%llu'; > > We always store 'INBOX' as 'INBOX' (all caps), so, this will always > work. And we have no problem with indexes this way. > > It just too simple probably.. Perhaps I'm overlooking something?
I'm confused at the moment. Your query is right but the 'if' statement isn't?! I changed the query and broke dbmail. If I try to change to folder INBOX/lists/dbmail-dev I get my INBOX: ---------------------------------------------------------------------- if (strncasecmp(name, "INBOX", 5) == 0) { snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM mailboxes " "WHERE name = 'INBOX' " "AND owner_idnr='%llu'", owner_idnr); } else { snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM mailboxes " "WHERE name='%s' AND owner_idnr='%llu'", name, owner_idnr); } ---------------------------------------------------------------------- strncasecmp() tests if the folder begins with INBOX and thats always true - right? So we have to use strcasecmp(name, "INBOX") right? Confused ... Thomas -- http://www.tmueller.com for pgp key (95702B3B)