Mauticđź“§fetch command not working - Mautic 6.0.2

When running the command:

php bin/console mautic:email:fetch

Mautic (on a fresh install) throws this error:

Fatal error: Uncaught ValueError: IMAP\Connection is already closed in /mautic-path/docroot/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php:396
Stack trace:
#0 /mautic-path/docroot/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php(396): imap_ping(Object(IMAP\Connection))
#1 /mautic-path/docroot/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php(1071): Mautic\EmailBundle\MonitoredEmail\Mailbox->isConnected()
#2 /mautic-path/docroot/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php(1103): Mautic\EmailBundle\MonitoredEmail\Mailbox->disconnect()
#3 [internal function]: Mautic\EmailBundle\MonitoredEmail\Mailbox->__destruct()
#4 {main}
  thrown in /mautic-path/docroot/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php on line 396

It seems like a lot of people are having this problem, based on the corresponding Github issue and further bugfix.

I’m not sure if this is the right place to post, but what do we need to do to gain traction on this issue? To me, it’s surprising a fix for one of Mautic’s core commands has gone unresolved. Is there something I’m missing where we can’t get mautic:email:fetch back to working in the newer updates via the fix?

Hello,
Maybe you can test if the workaround is viable in 6.0.2?

I pushed the change from the bugfix and it’s working fine on Mautic 6.0.2 with php 8.3.6.

I’m wondering why that fix has been sitting. I see that the suggested code failed the PHPSTAN-8.1 test, but with the function_exists check, that should be a viable solution, no?

Mainly I’m worried about having to update in the future and breaking mautic:email:fetch, essentially

Until a stable fix is published, the fix it will break by the next update.
YOu can create the PR, and if it passes the tests, it can be merged into the core.
That is the beauty of the open source.
Joey

The beauty and curse, I suppose. Fair enough