IMAP Move
IMAP Move
Section titled “IMAP Move”Type: imap-move · Package: SMTP / IMAP Email Activities v1.0.5
Moves an email from one IMAP folder to another. The way to organize the mailbox after processing: take what was handled to a “Processed” folder, archive, or classify by type.
How it works
Section titled “How it works”Given the mailId (from IMAP Read), it moves the email from its source folder (folder, INBOX by default) to targetFolder.
- The target folder must exist on the server: the activity does not create it.
INBOXis accepted case-insensitively; others need the name and separator the server uses ("Processed","INBOX/Processed"or"INBOX.Processed"). - In the target folder the email gets a new UID: the previous
.Idno longer works. Run the other actions (attachments, mark) before moving it.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
host | string | — | IMAP server. |
username | string | — | Username. |
password | credential | — | Password or App Password. Use credential("name")["password"]. |
mailId | string | — | Email UID (from email.Id). Must be numeric. |
targetFolder | string | — | Target folder (e.g. "Processed", "Archive"). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
port | int | 993 | IMAP port. |
folder | string | "INBOX" | Source folder (the same the email was read from). |
security | string | "ssl" | Encryption: auto, none, ssl or starttls. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Invalid 'mailId'. It must be the numeric UID returned by imap-read. | mailId is not a number. Pass email.Id from IMAP Read. |
'mailId' is required. / 'targetFolder' is required. | The parameter is missing or the expression returned null. |
| Folder not found error | folder or targetFolder does not exist on the server. Create it from your mail client or fix the name. |
| Authentication or connection error | Same as in IMAP Read. |
Example
Section titled “Example”For Each items = emails itemVariable = email └─ activities: ... process ... IMAP Move host = "imap.gmail.com" username = credential("mail-bot")["user"] password = credential("mail-bot")["password"] mailId = email.Id targetFolder = "Processed"Related activities
Section titled “Related activities”- IMAP Mark Read — mark as read.
- IMAP Delete — delete instead of archiving.