Coder Social home page Coder Social logo

Comments (3)

tedivm avatar tedivm commented on July 2, 2024

There isn't currently, but if you find a way to do it I'd be happy to include it.

from fetch.

benr77 avatar benr77 commented on July 2, 2024

Looking at the PHP IMAP docs, you can call imap_getmailboxes() which will return detailed info about the mailboxes, including the IMAP separator. http://php.net/manual/en/function.imap-getmailboxes.php

So you could easily expose this via a new public method alongside the existing public method listMailboxes(). Perhaps listMailboxDetails() or something.
If you directly return the return value from imap_getmailboxes() then the user can decide how to deal with the information provided as there is other useful stuff aside from the delimiter.

In the meantime, I have also implemented a quick and dirty solution using the existing listMailBox() method, which greps the value out of the list of returned mailboxes and child mailboxes - this is assuming that some child mailboxes exist, but normally a mailbox will have at least Trash, Sent etc

foreach ($imap->listMailBox() as $mailBox)
{
    $imapSeparator = preg_replace("#.*}\w+([/.]{1}).*#", "$1", $mailBox);
    if (strlen($imapSeparator) == 1) break;
}

from fetch.

tedivm avatar tedivm commented on July 2, 2024

Closing this out as I've merged the pull request.

from fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.