# IMAP\\Connection is already closed when running bin/console mautic📧fetch

**URL:** <https://forum.mautic.org/t/imap-connection-is-already-closed-when-running-bin-console-mauticfetch/36492>\
**Category:** Mautic 6 Install/Upgrade Support\
**Created:** [September 8, 2025, 2:39pm UTC](https://forum.mautic.org/t/imap-connection-is-already-closed-when-running-bin-console-mauticfetch/36492 "2025-09-08T14:39:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mattewwade06](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mattewwade06/32/14401_2.png) [@mattewwade06](https://forum.mautic.org/u/mattewwade06)\
**Post date:** [September 9, 2025, 9:12am UTC](https://forum.mautic.org/t/imap-connection-is-already-closed-when-running-bin-console-mauticfetch/36492/3 "2025-09-09T09:12:12Z")

</div>

Thanks for sharing this workaround it’s really helpful! Replacing `imap_ping()` with `is_resource($this->imapStream)` on line 394 in `Mailbox.php` solved the “IMAP\Connection is already closed” error for me as well on Mautic 6.0.4.  
For more context, you can also check this related discussion: [Mauticfetch command not working – Mautic 6.0.2](https://forum.mautic.org/t/mauticfetch-command-not-working-mautic-6-0-2/35833?utm_source=chatgpt.com).

---

_[View the full topic](https://forum.mautic.org/t/imap-connection-is-already-closed-when-running-bin-console-mauticfetch/36492)._
