How can I check if an email folder exists using Zend_Mail_Storage_Imap, theres a createFOlder, renameFOlder and removeFolder and also a getFOlders but not exactly any fixed method to query if a certain mail folder exists? The GetFOlders returns a humonogous tree of folders to start with.
How can I check if an email folder exists using Zend_Mail_Storage_Imap, theres a createFOlder,
Share
I’ve not worked with
Zend_Mail_Storage_Imapbefore, but from what I can glean from the source, this should do the trick:If you want to preserve the current folder through the check, it gets a bit trickier, of course:
(Your preference of how to deal with that situation may, of course, vary, that one is rather sloppy.)