Actions9
Overview
This node connects to an IMAP email server to manage emails and mailboxes. Specifically, the "Move Email" operation allows users to move a single email from one folder to another within their mailbox. This is useful for organizing emails automatically, such as moving processed or categorized emails into specific folders like "Sent," "Archive," or custom folders.
Practical examples:
- Automatically move incoming support emails from the inbox to a "Support Tickets" folder after processing.
- Organize newsletters by moving them from the inbox to a "Newsletters" folder.
- Archive old emails by moving them to an "Archive" folder based on certain criteria.
Properties
| Name | Meaning |
|---|---|
| Folder | The source email folder containing the email to move. Options: select from list or enter folder name manually (e.g., INBOX). |
| Email UID | The unique identifier of the email to be moved. This is required to specify which email to move. |
| Target Folder | The destination folder where the email will be moved. Options: select from list or enter folder name manually (e.g., Sent). |
Output
The output is an array of JSON objects representing the result of the move operation. Each item corresponds to an email that was processed. The exact structure of the JSON output depends on the underlying IMAP library's response but generally includes details about the moved email or confirmation of success.
No binary data output is produced by this operation.
Dependencies
- Requires connection credentials to an IMAP server: host, port, security settings, username, and password.
- Uses the
imapflowlibrary to interact with the IMAP server. - Requires proper configuration of the IMAP credentials in n8n to authenticate and connect successfully.
Troubleshooting
- Connection issues: Errors connecting to the IMAP server may occur if credentials are incorrect, the server is unreachable, or network/firewall restrictions exist. Verify credentials and network access.
- Invalid folder names: If the specified source or target folder does not exist or is misspelled, the operation will fail. Use the folder list mode to select valid folders or ensure correct folder names.
- Email UID not found: Providing an incorrect or non-existent email UID will cause the move operation to fail. Confirm the UID corresponds to an existing email in the source folder.
- Timeouts during logout: The node attempts to logout gracefully but has a timeout fallback. If logout errors appear, they usually do not affect the move operation but indicate connection cleanup issues.
- Continue on Fail: If enabled, the node will continue processing other items even if one fails, returning error messages in the output JSON.
Links and References
- IMAP RFC 3501 – Protocol specification for IMAP.
- imapflow GitHub repository – The IMAP client library used internally.
- n8n documentation on Email nodes (general guidance on IMAP usage).