Roundcube Community Forum

 

Dev-to-Dev: Is there a way to determine folder prefix without triggering errors?

Started by JAB Creations, March 08, 2025, 07:41:14 AM

Previous topic - Next topic

JAB Creations

Some mail accounts require a prefix for folder names (e.g. INBOX.Trash). However this can not be inherently derived from the delimiter (if one exists). Yes, if we just dump all of the raw folder strings we, as human beings, can clearly see everything prefixed with "INBOX." though this might change from one provider to another. I'm currently using PHP's IMAP extension and am wondering if there is a way to determine if the folder requires a prefix without first having to try creating a folder and interception the error message imap_errors()?

JohnDoh

I think what you want is the IMAP namespace extension, if the server supports that then it tells you answer. However a quick search suggests the PHP's IMAP extension might not support this.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

JAB Creations

Quote from: JohnDoh on March 09, 2025, 05:14:18 AMI think what you want is the IMAP namespace extension, if the server supports that then it tells you answer. However a quick search suggests the PHP's IMAP extension might not support this.

Fair enough, thank you for your efforts.