RFC 6851: The IMAP MOVE Extension

Defines the MOVE command for atomically moving messages between IMAP folders without a COPY+EXPUNGE sequence.
Alaa
By Alaa
SMTPedia documents email infrastructure end to end: SMTP standards from the RFC archive, delivera...
7 min read Updated Jul 22, 2026 55 views
RFC 6851
The IMAP MOVE Extension
Current standard
Domain
IMAP
Published
January 2013
Supersedes
First in series
SMTP relevance
Low
↗ Read on rfc-editor.org

What this RFC defines

RFC 6851 defines the MOVE command for IMAP, which atomically moves one or more messages from one folder to another in a single operation. Before MOVE, clients had to perform a COPY followed by a STORE Deleted and EXPUNGE sequence, which was not atomic and could leave messages in an inconsistent state if the connection dropped mid-operation.

Where you see it in practice

When you drag an email from your Inbox to an Archive folder in a modern email client and it completes instantly and reliably even on an unstable connection, the client is using the IMAP MOVE command from RFC 6851. Without it, a folder move requires multiple round-trips and can result in duplicate messages or incomplete moves if the connection is interrupted between the COPY and EXPUNGE steps.

How it connects to other RFCs

RFC 6851 extends RFC 9051 (IMAP). It works alongside RFC 4551 (CONDSTORE) and RFC 2177 (IDLE) as part of the modern IMAP extension set. The MOVE command is advertised in the CAPABILITY response so clients can detect server support before attempting to use it.

Current status

RFC 6851 is a current standard, published January 2013. IMAP MOVE is supported by Dovecot, Cyrus, and Exchange. Most modern email clients use it when available and fall back to COPY+EXPUNGE on servers that do not support it, making it a significant reliability improvement for mobile clients on unstable connections.

The MOVE extension

RFC 6851 added the MOVE command to IMAP in January 2013. Before MOVE, moving a message between folders required a client to issue COPY (to the destination), then STORE with the Deleted flag on the source, then EXPUNGE to remove it. This three-step sequence was error-prone: if the network dropped between COPY and EXPUNGE, the message could end up in both folders or neither. MOVE performs all three steps atomically on the server, guaranteeing that the message ends up in exactly one location.

Why atomicity matters

The pre-MOVE workaround (COPY plus STORE plus EXPUNGE) is why some older mail clients occasionally showed duplicate messages after network hiccups or crashes. If the client crashed after COPY but before EXPUNGE, the original message remained in the source folder while a copy sat in the destination. MOVE eliminates this class of bug by making the operation atomic at the server. It also reduces bandwidth: the message is not re-fetched by the client between the COPY and EXPUNGE steps.

Adoption in modern clients

Every major IMAP client (Apple Mail, Thunderbird, Gmail IMAP, Outlook) supports MOVE and prefers it over the three-step workaround when the server advertises the MOVE capability. Dovecot has supported MOVE since 2013; Cyrus and other major servers followed. If you drag a message between folders in a modern client, MOVE is what actually happens under the covers, assuming both the client and server support it.

Quick Reference

RFC 6851 (January 2013) defines the IMAP MOVE extension: an atomic operation that moves messages between mailboxes in a single command. Replaces the classic COPY-STORE-EXPUNGE pattern (copy to target, flag original as deleted, expunge). MOVE is atomic (all or nothing), efficient (one round-trip), and immediately consistent. Advertised as MOVE in CAPABILITY. Widely supported by Gmail, Microsoft 365, Dovecot, Cyrus. Foundation for every “drag a message between folders” operation in modern mail clients.

RFC 6851 at a glance

AspectDetail
PurposeAtomic move of messages between IMAP mailboxes
Advertised asMOVE in IMAP CAPABILITY
CommandMOVE seq-set target-mailbox
UID variantUID MOVE uid-set target-mailbox
ReplacesCOPY + STORE +FLAGS \Deleted + EXPUNGE pattern
PublishedJanuary 2013

MOVE vs classic COPY+STORE+EXPUNGE pattern

AspectClassic patternMOVE
Commands3 (COPY, STORE, EXPUNGE)1 (MOVE)
Round-trips31
AtomicityNot atomic (partial failure possible)Atomic (all or nothing)
Race windowMessage present in both source and target for a momentNone (immediate transition)
Failure handlingComplex (need to detect partial state)Simple (single response)
Server loadHigher (three operations)Lower (single operation with efficient backend)

MOVE dialogue example

MOVE vs classic pattern comparison Classic COPY+STORE+EXPUNGE pattern: C: A001 COPY 5 “Archive” S: A001 OK [COPYUID 1234 5 3421] COPY completed C: A002 STORE 5 +FLAGS (\Deleted) S: * 5 FETCH (FLAGS (\Deleted)) S: A002 OK STORE completed C: A003 EXPUNGE S: * 5 EXPUNGE S: A003 OK EXPUNGE completedDownsides: – 3 round-trips – Message exists in both mailboxes briefly (after COPY, before EXPUNGE) – If EXPUNGE fails, original still existsMOVE (RFC 6851) equivalent: C: A001 MOVE 5 “Archive” S: * OK [COPYUID 1234 5 3421] Backup UID S: * 5 EXPUNGE S: A001 OK MOVE completedAdvantages: – 1 round-trip – Atomic (either succeeds fully or fails fully) – Server-side optimization (no actual copy, just update index) – COPYUID response gives new UID in target mailboxUID variant: C: A002 UID MOVE 234 “Archive” (uses UIDs instead of sequence numbers; safer across expunges)

Common MOVE mistakes

Falling back to COPY+STORE+EXPUNGE when MOVE is available. Legacy client code paths that predate MOVE support. Check CAPABILITY for MOVE; use it when available. The classic pattern is a fallback for servers lacking MOVE, not the default.
Not handling partial MOVE failures. MOVE can fail if the target mailbox does not exist, is over quota, or the client lacks permission. The response is a failure code and no partial state (unlike classic pattern where COPY could succeed and EXPUNGE fail). Handle the failure and communicate to the user; the messages remain in the source mailbox.
Using sequence numbers when UID MOVE is safer. Sequence numbers can shift due to concurrent operations (other clients expunging, IDLE notifications). UID MOVE uses persistent UIDs and is not affected by sequence number changes. For any move that spans a delay (interactive UI where user picks target then confirms), use UID MOVE.
Not tracking COPYUID response. MOVE returns COPYUID with the new UID in the target mailbox. Clients that need to reference the message after MOVE (immediate follow-up operations, UI state) must capture this UID. Ignoring COPYUID means re-fetching the target mailbox to find the moved message.
Not checking target mailbox exists before MOVE. MOVE against a non-existent target returns an error, but a smoother user experience is to check with LIST first (or create the mailbox first if intent is “move to a new folder I’m creating”). Reduces user-facing errors from typos.
IMAP extension ecosystem
  • RFC 3501: IMAP4rev1 (base protocol)
  • RFC 9051: IMAP4rev2 (2021 update; MOVE integrated)
  • RFC 4315: UIDPLUS (COPYUID response format)
  • RFC 4551: CONDSTORE (incremental sync)
  • RFC 2177: IDLE (real-time notifications)
  • RFC 5256: SORT and THREAD
SMTPedia companion guides

Frequently asked questions

Should I use MOVE or the classic COPY+STORE+EXPUNGE pattern?

MOVE when available. Advantages: atomic (no race window), fewer round-trips (1 vs 3), lower server load (backend can optimize as index update rather than data copy). Check CAPABILITY for MOVE; use classic pattern only as fallback for legacy servers lacking support.

What is COPYUID in MOVE response?

The UID assigned to the message in the target mailbox. Format: [COPYUID UIDVALIDITY source-uids target-uids]. Clients that need to reference the message immediately after MOVE (for follow-up operations, UI updates) should capture COPYUID. Without capturing, the client must re-fetch the target mailbox to find the moved message.

What happens if MOVE fails?

Depends on when in the operation. Target mailbox does not exist: OKfailure response, source unchanged. Target over quota: failure response, source unchanged. Partial failure (some messages moved, some not): rare; RFC 6851 MOVE is designed as atomic all-or-nothing. If the server returns partial success, treat it as failure and re-sync source mailbox state to determine actual outcome.

Do all IMAP servers support MOVE?

Most modern ones. Gmail, Microsoft 365, Yahoo, iCloud, Dovecot, Cyrus, Fastmail all support MOVE. Older on-premises Exchange or minimal custom servers may lack support. Check CAPABILITY for MOVE; if absent, fall back to COPY+STORE+EXPUNGE. Client libraries handle detection and fallback automatically.

Is MOVE part of IMAP4rev2?

Yes. RFC 9051 (IMAP4rev2, 2021) folds MOVE into the base protocol; no separate CAPABILITY advertisement needed for IMAP4rev2 servers. RFC 6851 remains the reference for MOVE semantics on IMAP4rev1 servers, which remain dominant in 2026.


About the Author

Alaa - SMTPedia author

Alaa · LinkedIn

Email infrastructure specialist with 8+ years of hands-on experience in SMTP, deliverability, and email verification. I’ve configured and troubleshot mail systems across Postfix, Exchange, and cloud relays, managed IP reputation and warmup campaigns, and built verification pipelines processing millions of addresses. My work spans DNS authentication (SPF, DKIM, DMARC, BIMI), bounce handling, blocklist monitoring, and compliance frameworks including CAN-SPAM and GDPR. I write every article on SMTPedia to give email professionals, developers, and marketers the accurate, RFC-grounded reference they need.


About SMTPedia

SMTPedia is an independent email industry reference covering SMTP, IMAP, POP3, email deliverability, marketing platforms, DNS authentication, and email verification. Every article is researched from official provider documentation, IETF RFCs, and industry best practices. Settings and configurations are verified quarterly.

We are cited as a source by ChatGPT, Microsoft Copilot, and thousands of email professionals worldwide. Learn more about our editorial process.