6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/18/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#1620] infinite loop in IMAP folder listing
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ .__ ..___.__ [__)[__) |[__ [__) [__)| \__|[___| \
Comment
> I have confirmed that Horde (though, I use Horde just for IMP, but > from what I can tell the bug is in the underlying Horde IMAP classes) > has a bug that: > > > > 1) Ignores the LATT_NOINFERIORS flag for folders. > > and/or > > 2) Ignores that the folder "delimiter" is empty() for subfolders that > it should not query. > > > > I was able to confirm the bug by writing a very simple PHP script > which lists IMAP folders. I was able to duplicate the bug that IMAP > does by incorrectly formatting subfolder queries. > > > > What I mean by that is, if you have a folder called "Blah" in the > parent list (and it does not have the LATT_NOINFERIORS flag and does > have a delimiter) and you try to list folders under it, you would > query "Blah/%" for example (assuming / is the delimiter). If that > query yeilds another box called "Foo" (that also does not have the > LATT_NOINFERIORS flag and does have a delimiter), you should be > querying "Blah/Foo/%" next time. > > > > However, it appears as though Horde is ignoring the parent folder > when looking for subfolders of subfolders. If it does this, when it > sees "Foo", it then issues a query for "Foo/%". > > > > In my particular case, it was in fact that the subfolder "Foo" (as an > example) did have the LATT_NOINFERIORS flag set as well as a > delimiter set, so it should not have been queried (for two reasons). > Because it was also improperly querying the subfolder, it was causing > an infinite loop which probably nobody ever encounted due to the > weird way my particular IMAP daemon works (SmartMax IMAPMax5). > > > > My problem is because the IMAP daemon reports that beneath every > folder, there is another folder called "INBOX". This "INBOX" > subfolder has the LATT_NOINFERIORS flag set and does not have a > delimiter so it technically should not have been queried, but it was. > That caused it to query "INBOX/%" (rather than "Trash/INBOX/%" for > example). This then caused the IMAP daemon to report a folder called > INBOX under the INBOX folder, which caused an infinite loop. > > > > If you take in to consideration the LATT_NOINFERIORS flag, the loop > is stopped because the INBOX subfolders apparently all have that flag > set. > > > > If you take in to consideration the presense of the folder delimiter > (for the folder you're querying), the loop is also stopped because > the subfolders do not have a delimiter. > > > > If you take in to consideration both cases, the loop is also stopped. > > > > I have attached my test script (minus IMAP credentials that query my > IMAP server). The code may not be streamlined, but it demonstrates > proper IMAP folder querying. > > > > Eli.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers