IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node interacts with an IMAP email server to manage mailboxes and emails. Specifically, the Mailbox - Create operation allows users to create a new mailbox (folder) on their IMAP server. This is useful for organizing emails into custom folders beyond the default ones like INBOX.

Common scenarios include:

  • Automatically creating project-specific or client-specific mailboxes when onboarding new clients.
  • Organizing incoming emails by creating dedicated mailboxes for different categories or departments.
  • Setting up mailbox structures programmatically as part of email management workflows.

Example: A user can create a mailbox named "Invoices" under the top-level or inside another mailbox to store all invoice-related emails separately.

Properties

Name Meaning
Credential Type Choose which credentials to use for connecting to the IMAP server:
- IMAP (credentials from this node)
- N8N IMAP Trigger Node (reuse existing credentials from an IMAP trigger node)
Top Level Mailbox Boolean flag indicating if the mailbox to create is a top-level mailbox (true) or a child mailbox (false).
Mailbox When creating a child mailbox (Top Level Mailbox = false), specify the parent mailbox here. Can be selected from a list or entered as a full path string.
Mailbox Name The name of the new mailbox to create. This is required and defines the folder name on the IMAP server.

Output

The node outputs JSON data representing the result of the mailbox creation operation. Typically, this includes confirmation details such as the created mailbox's path or status messages.

If the node supports binary data output (not indicated in the provided code), it would represent attachments or email content, but for mailbox creation, the output is purely JSON confirming the action.

Dependencies

  • Requires valid IMAP server credentials, either provided directly in the node or reused from an existing IMAP trigger node.
  • The node depends on an IMAP client library internally to connect and perform mailbox operations.
  • Environment variable N8N_LOG_LEVEL can influence logging verbosity (e.g., debug mode).

Troubleshooting

  • Connection failed: Indicates issues connecting to the IMAP server. Check credentials, server address, port, and network connectivity.
  • Unknown operation or resource: Occurs if the specified resource or operation is not recognized. Ensure "Mailbox" resource and "Create" operation are correctly selected.
  • Permission denied or mailbox creation failed: The IMAP user may lack permissions to create mailboxes. Verify user rights on the IMAP server.
  • Empty or no data returned: If the operation returns no data, verify that the mailbox name is valid and the parent mailbox exists if creating a child mailbox.

To resolve errors:

  • Double-check authentication credentials.
  • Confirm mailbox paths and names conform to the IMAP server's expected format.
  • Review logs for detailed error messages; enable debug logging via N8N_LOG_LEVEL=debug if needed.

Links and References

Discussion