---
title: "move messages · RUAL Documentation"
description: "Moves messages by UID into another mailbox : the usual way to file what a flow has processed so the next poll does not see it again. A RUAL imap block."
canonical: https://docs.rual.nl/block-types/imap/imapconnection_move
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# move messages

This block is part of the [`imap`](https://docs.rual.nl/block-types/imap) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Moves messages by UID into another mailbox : the usual way to file what a flow has processed so the next poll does not see it again.

- flow `flow`

- connection required `imapconnection`

- mailbox `value` Mailbox the uids belong to. Defaults to `INBOX`.

Default `INBOX`

- uids `array` UIDs to move.

- uid `number` A single UID, added to `uids`.

- destination mailbox required `value` Exact name of the mailbox to move into.

- allow mailbox-wide expunge `condition` On a server with neither MOVE nor UIDPLUS, finishing the move takes an EXPUNGE of the whole mailbox : every message any client flagged `\Deleted` goes with it. Off (default) refuses the move there; on accepts that.

Default `false`

- flow `flow`

- connection `imapconnection`

- success `condition`

- error `value`

- count `number`

- destination uids `array`

Moves the uids from mailbox (default INBOX) to destination. Uses MOVE when the server offers it, otherwise COPY + \\Deleted + expunge; either way the messages are gone from the source on success. destination_uids holds the new uids when the server reported them (UIDPLUS/MOVE) and is [] otherwise. On a server with neither MOVE nor UIDPLUS the only way to finish is a mailbox-wide EXPUNGE, which also removes every message any client has flagged \Deleted, so the move is REFUSED (nothing copied, nothing flagged) unless allow_mailbox_expunge=true : set it only when this flow owns the mailbox. Find the destination's exact name with imap list mailboxes : folder names are server-specific ('INBOX/Processed', 'Archive', '[Gmail]/All Mail'). Suppressed in a simulation.

| `archive email` |
| --- |
| `file email` |
| `imap move` |

A typical wiring for [move messages](https://docs.rual.nl/block-types/imap/imapconnection_move): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [move messages](https://docs.rual.nl/block-types/imap/imapconnection_move) feeds the `connection` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `destination` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the move messages block: typical wiring for move messages.](https://docs.rual.nl/canvas-examples/imapconnection_move.png)](https://docs.rual.nl/canvas-examples/imapconnection_move.png?v=3)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [Back to `imap`](https://docs.rual.nl/block-types/imap): Return to the main group to view all sub-groups

- [Back to `imap`](https://docs.rual.nl/block-types/imap?group=imap): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
