Move Mail
Moves an email from the specified From Folder to To Folder in the email mailbox. The email message is identified by its unique id set to Email Unique ID (Uid).
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Client Id - The id of the email client to use. The ID is created by the Connect node.
- From Folder - The name of the folder to move the email from.
- Email Unique ID (Uid) - The unique id of the email to move.
- To Folder - The destination folder name to move the email to.
Options
- Credentials - The login credentials for the email client. Required if there is no Client Id.
How It Works
The Move Mail node transfers an email from one folder to another using IMAP MOVE command. Here's the process:
- Authentication - Uses Client ID or direct credentials
- Source Folder Selection - Selects the "From Folder"
- UID Validation - Validates the Email Unique ID
- IMAP MOVE - Executes MOVE command to transfer email
- Automatic Deletion - Source email is removed after successful move
Requirements
- Client ID from Connect node OR Credentials from vault
- From Folder - Source folder containing the email
- Email Unique ID (Uid) - UID of email to move (over 0)
- To Folder - Destination folder (must exist)
Error Handling
| Error Code | Description | Resolution |
|---|---|---|
| Core.Mail.Move.ErrOnCreate | Config parse error | Check node configuration |
| Core.Mail.Move.ErrCredentials | Invalid credentials | Verify vault credentials |
| Core.Mail.Move.ErrFolder | Folder name is empty | Provide From Folder and To Folder |
| Core.Mail.Move.ErrTop | Invalid Email UID | Provide valid UID (over 0) |
| Core.Mail.Move.ErrClientId | Client ID not found | Ensure Connect node executed |
| Core.Mail.Move.ErrSelect | Cannot select folder | Verify From Folder exists |
| Core.Mail.Move.ErrMove | Move operation failed | Verify To Folder exists and has write permissions |
| Core.Mail.ErrConn | Connection missing | Ensure Connect executed |
Usage Examples
Example 1: Move Email to Archive
{
"client_id": "{{client_id}}",
"from_folder": "INBOX",
"email_uid": 12345,
"to_folder": "Archive"
}
// Moves email UID 12345 from INBOX to Archive
Example 2: Organize Emails by Sender
// Search for emails from specific sender
var emails = {{search_results}};
// Move each to dedicated folder
for (var email of emails) {
// Use Move Mail: INBOX -> Vendors
}
Example 3: Move Processed Emails
// Get unread emails
var emails = {{messages}};
// Process each email
for (var email of emails) {
// Process email...
// After processing, move to "Processed" folder
// Use email.uid as Email Unique ID
}
Usage Notes
- Atomic Operation: Move is atomic (all-or-nothing)
- UID Changes: UID may change after move (depends on server)
- Folder Must Exist: Create destination folder first with Create Folder node
- Case Sensitivity: Folder names are case-sensitive
- Subfolder Syntax: Use "/" for subfolders (e.g., "Archive/2024")
Tips
- Create Folders First: Use List Folders to verify destination exists
- Archive Strategy: Move old emails to Archive for better performance
- Workflow Organization: Move emails through folders as workflow progresses
- Error Recovery: Use Try-Catch to handle move failures
Related Nodes
- Create Folder - Create destination folder
- List Folders - Check available folders
- Get Mail - Get UIDs to move
- Search Mail - Find emails to move