Actions12
- Mailbox Actions
- Email Actions
Overview
This node connects to an IMAP email server to perform various email-related operations. Specifically, the Set Flags operation allows users to modify the status flags of one or more emails within a specified mailbox. This is useful for marking emails as read/unread, flagged, deleted, answered, or draft.
Common scenarios include:
- Automatically marking emails as read after processing them.
- Flagging important emails based on certain criteria.
- Deleting emails programmatically by setting the deleted flag.
- Managing email states in bulk using UIDs.
For example, you could use this node to mark all emails with a specific subject as "Seen" and "Flagged" after they have been processed by your workflow.
Properties
| Name | Meaning |
|---|---|
| Credential Type | Choose which credentials to use for connecting to the IMAP server: - IMAP (use credentials from this node) - N8N IMAP Trigger Node (reuse credentials from an existing IMAP trigger node) |
| Mailbox | Select the mailbox folder where the target emails reside. You can either select from a list of mailboxes or specify the full path manually. |
| Email UID | The unique identifier(s) of the email(s) to set flags on. Multiple UIDs can be provided as a comma-separated list. |
| Flags | Specify which flags to set on the selected emails. Options include: - Answered - Deleted - Draft - Flagged - Seen |
Output
The node outputs JSON data representing the result of the flag-setting operation. Typically, this will confirm which emails were updated and what flags were applied. The exact structure depends on the underlying IMAP library's response but generally includes success confirmation per email UID.
No binary data output is produced by this operation.
Dependencies
- Requires connection to an IMAP email server.
- Needs valid IMAP credentials, which can be provided directly in the node or reused from an existing IMAP trigger node.
- Environment variable
N8N_LOG_LEVELcan influence logging verbosity (e.g., debug mode).
Troubleshooting
- Connection failed: Usually caused by incorrect credentials, wrong server address, or network issues. Verify your IMAP credentials and server settings.
- Unknown operation or resource: Ensure that the Resource is set to "Email" and Operation to "Set Flags".
- No data returned: If no emails match the provided UIDs or mailbox path, no flags will be set. Double-check the mailbox name and email UIDs.
- Error messages from IMAP server: These might indicate permission issues or invalid flags. Confirm that the flags used are supported by your email server.
- Timeouts or disconnects: Could be due to network instability or server limits. Try increasing timeout settings if available or check server health.
Links and References
If you need further details about other operations or resources, feel free to ask!