Actions6
- Mailbox Actions
- Email Actions
Overview
The IMAP node for n8n allows you to interact with email mailboxes using the IMAP protocol. Specifically, the Mailbox → Get Status operation retrieves status information about a selected mailbox (such as "INBOX"). This is useful for automating workflows that need to check mailbox statistics or state before performing further actions.
Common scenarios:
- Monitoring the number of unread emails in a mailbox.
- Checking if a mailbox exists and is accessible.
- Triggering downstream processes based on mailbox status (e.g., archiving, notifications).
Practical example:
You could use this node to periodically check the "INBOX" for new messages and trigger an alert if the unread count exceeds a threshold.
Properties
| Name | Type | Meaning |
|---|---|---|
| Credential Type | options | Selects which set of credentials to use for connecting to the IMAP server. Options include using credentials defined in this node or reusing those from an existing n8n IMAP Trigger node. |
| Mailbox | resourceLocator | Specifies the mailbox to check. You can select from a list or enter the full path manually. Required field. |
Output
The output will be a JSON object containing the status details of the specified mailbox. While the exact structure depends on the IMAP server and implementation, typical fields may include:
{
"mailbox": "INBOX",
"exists": 42,
"recent": 2,
"unseen": 5,
"uidNext": 12345,
"uidValidity": 67890,
// ...other status fields depending on the server
}
- mailbox: The name/path of the mailbox checked.
- exists: Total number of messages in the mailbox.
- recent: Number of recent messages.
- unseen: Number of unseen (unread) messages.
- uidNext: The next unique identifier value.
- uidValidity: The unique identifier validity value.
Note: The actual fields may vary depending on the IMAP server's response.
Dependencies
- IMAP Server: Requires access to a compatible IMAP email server.
- Credentials: Must provide valid IMAP credentials, either directly in the node or by referencing an existing n8n IMAP Trigger node.
- n8n Configuration: No special environment variables are required unless custom logging is needed (
N8N_LOG_LEVEL=debugfor verbose logs).
Troubleshooting
Common issues:
- Authentication errors: Invalid username/password or incorrect credential type selection.
- Mailbox not found: Specified mailbox path does not exist or is misspelled.
- Connection failures: Network issues or incorrect IMAP server address/port.
Error messages and resolutions:
"Connection failed: ...": Check your IMAP server address, port, and credentials."Unknown operation \"getMailboxStatus\" for resource \"mailbox\"": Ensure you have selected the correct operation and resource."IMAP server reported errors: ...": Review the error details; it may indicate permission issues or server-side problems."Operation ... returned no data": The mailbox may be empty or inaccessible.