T
Twentyβ€’5mo ago
deurk

[IMAP] Error fetching from mailbox XXXX: Connection not available

Hello dear people πŸ™‚ I am facing an issue when testing the IMAP email sync. I was able to configure the IMAP using the Lab option and UI settings, but I am now faced with the error in the title. Here is the docker log:
worker-1 | [Nest] 34 - 07/31/2025, 10:20:00 AM LOG [CalDavGetEventsService] Getting calendar events for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:01 AM LOG [ImapClientProvider] Connected to IMAP server for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:01 AM LOG [ImapClientProvider] Available mailboxes for user@domain.com: INBOX, Sent, Drafts, Spam, Trash, Inbox/temp, Inquiries, INVOICES, Notifications
worker-1 | [Nest] 34 - 07/31/2025, 10:20:02 AM LOG [ImapGetMessageListService] Found sent folder via special-use flag: Sent
worker-1 | [Nest] 34 - 07/31/2025, 10:20:02 AM LOG [CalDavGetEventsService] Found 1 calendar events for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapGetMessageListService] Error fetching from mailbox INBOX: Connection not available
worker-1 | Error: Connection not available
worker-1 | at ImapFlow.close (/app/node_modules/imapflow/lib/imap-flow.js:1604:31)
worker-1 | at TLSSocket._socketEnd (/app/node_modules/imapflow/lib/imap-flow.js:758:22)
worker-1 | at TLSSocket.emit (node:events:530:35)
worker-1 | at endReadableNT (node:internal/streams/readable:1698:12)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM LOG [ImapGetMessageListService] Fetched 0 messages from INBOX
worker-1 | [Nest] 34 - 07/31/2025, 10:20:00 AM LOG [CalDavGetEventsService] Getting calendar events for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:01 AM LOG [ImapClientProvider] Connected to IMAP server for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:01 AM LOG [ImapClientProvider] Available mailboxes for user@domain.com: INBOX, Sent, Drafts, Spam, Trash, Inbox/temp, Inquiries, INVOICES, Notifications
worker-1 | [Nest] 34 - 07/31/2025, 10:20:02 AM LOG [ImapGetMessageListService] Found sent folder via special-use flag: Sent
worker-1 | [Nest] 34 - 07/31/2025, 10:20:02 AM LOG [CalDavGetEventsService] Found 1 calendar events for user@domain.com
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapGetMessageListService] Error fetching from mailbox INBOX: Connection not available
worker-1 | Error: Connection not available
worker-1 | at ImapFlow.close (/app/node_modules/imapflow/lib/imap-flow.js:1604:31)
worker-1 | at TLSSocket._socketEnd (/app/node_modules/imapflow/lib/imap-flow.js:758:22)
worker-1 | at TLSSocket.emit (node:events:530:35)
worker-1 | at endReadableNT (node:internal/streams/readable:1698:12)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM LOG [ImapGetMessageListService] Fetched 0 messages from INBOX
(the rest will be in a message below because caracters count limit) Any clue as to why this is happening and how I can fix it? Thanks a lot.
3 Replies
deurk
deurkOPβ€’5mo ago
Rest of the log
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapGetMessageListService] Error fetching from mailbox Sent: Connection not available
worker-1 | Error: Connection not available
worker-1 | at ImapFlow.processLocks (/app/node_modules/imapflow/lib/imap-flow.js:3078:25)
worker-1 | at /app/node_modules/imapflow/lib/imap-flow.js:3176:18
worker-1 | at new Promise (<anonymous>)
worker-1 | at ImapFlow.getMailboxLock (/app/node_modules/imapflow/lib/imap-flow.js:3174:22)
worker-1 | at ImapGetMessageListService.getMessagesFromMailbox (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/drivers/imap/services/imap-get-message-list.service.js:79:33)
worker-1 | at ImapGetMessageListService.getMessageLists (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/drivers/imap/services/imap-get-message-list.service.js:38:49)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
worker-1 | at async MessagingGetMessageListService.getMessageLists (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/services/messaging-get-message-list.service.js:43:28)
worker-1 | at async MessagingMessageListFetchService.processMessageListFetch (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/services/messaging-message-list-fetch.service.js:42:34)
worker-1 | at async MessagingMessageListFetchJob.handle (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.js:73:21)
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapClientProvider] Error closing IMAP client: Connection not available
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM LOG [ImapGetMessageListService] Fetched 0 messages from Sent
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapGetMessageListService] Error fetching from mailbox Sent: Connection not available
worker-1 | Error: Connection not available
worker-1 | at ImapFlow.processLocks (/app/node_modules/imapflow/lib/imap-flow.js:3078:25)
worker-1 | at /app/node_modules/imapflow/lib/imap-flow.js:3176:18
worker-1 | at new Promise (<anonymous>)
worker-1 | at ImapFlow.getMailboxLock (/app/node_modules/imapflow/lib/imap-flow.js:3174:22)
worker-1 | at ImapGetMessageListService.getMessagesFromMailbox (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/drivers/imap/services/imap-get-message-list.service.js:79:33)
worker-1 | at ImapGetMessageListService.getMessageLists (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/drivers/imap/services/imap-get-message-list.service.js:38:49)
worker-1 | at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
worker-1 | at async MessagingGetMessageListService.getMessageLists (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/services/messaging-get-message-list.service.js:43:28)
worker-1 | at async MessagingMessageListFetchService.processMessageListFetch (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/services/messaging-message-list-fetch.service.js:42:34)
worker-1 | at async MessagingMessageListFetchJob.handle (/app/packages/twenty-server/dist/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.js:73:21)
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM ERROR [ImapClientProvider] Error closing IMAP client: Connection not available
worker-1 | [Nest] 34 - 07/31/2025, 10:20:04 AM LOG [ImapGetMessageListService] Fetched 0 messages from Sent
Huzef
Huzefβ€’5mo ago
Do you know what kind of mail server are you using? Is it a self hosted one? Would help a lot in reproducing the issue
deurk
deurkOPβ€’5mo ago
Unfortunately not hosted, no. I could try with one if you'd like.

Did you find this page helpful?