# Misleading error message and architectural limitations in JMAP FileNode/copy (same-account & recursive directory copy)

**URL:** https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184
**Category:** Issues
**Created:** [November 3, 2026, 2:45am UTC](https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184 "2026-11-03T02:45:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Chris\_Nguyen](https://support.stalw.art/user_avatar/support.stalw.art/chris_nguyen/32/248_2.png) [@Chris\_Nguyen](https://support.stalw.art/u/Chris_Nguyen)
#### Post date: [November 3, 2026, 2:45am UTC](https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184/1 "2026-11-03T02:45:47Z")

</div>

### Issue Description

When invoking FileNode/copy, if account\_id equals from\_account\_id, the server rejects the request with the error detail:  
“From accountId is equal to fromAccountId”.

### Expected Behavior

A clearer error message

### Stalwart Version

v1.x

### Installation Method

Binary (Linux)

### Database Backend

RocksDB

### Blob Storage

S3-compatible

### Search Engine

Internal

### Directory Backend

Internal

### Additional Context

Can FileNode/copy be extended to support intra-account copies, or is this restricted by design? FileNode/set is not good for copying folders (with recursive tree)

### I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

### I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

### I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

---

<div class="post-metadata">

### Author: ![helpbot](https://support.stalw.art/user_avatar/support.stalw.art/helpbot/32/13_2.png) [@helpbot](https://support.stalw.art/u/helpbot)
#### Post date: [November 3, 2026, 2:45am UTC](https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184/2 "2026-11-03T02:45:57Z")

</div>

Your reading of the code is right. `FileNode/copy` rejects a request when `accountId` equals `fromAccountId`, and this is deliberate.

I found the check in `crates/jmap/src/file/copy.rs`. It returns an `invalidArguments` error with the detail “From accountId is equal to fromAccountId”. The `Email/copy`, `ContactCard/copy` and `CalendarEvent/copy` handlers have the same check and the same message. This matches the JMAP core `/copy` definition, which is meant for copying between different accounts. A same-account copy isn’t supported through this method.

The message itself is worded badly, since it names the same field twice. Something like “accountId must differ from fromAccountId” would be clearer. I can’t promise a change to either the message or the behaviour. I also found nothing in the docs or source about recursive same-account folder copy. Whether `FileNode/copy` will be extended to cover it is for a maintainer to answer.

A client can copy a folder inside one account by calling `FileNode/set` to create the new folder node. It then has to walk the source tree and create each child with `parentId` pointing at the new parent. It can reuse the existing `blobId` for each file, so the file content isn’t re-uploaded. This is done client-side, and the server doesn’t do it for you.

_This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong._

---

<div class="post-metadata">

### Author: ![stalwart](https://support.stalw.art/user_avatar/support.stalw.art/stalwart/32/12_2.png) [@stalwart](https://support.stalw.art/u/stalwart)
#### Post date: [November 3, 2026, 1:05pm UTC](https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184/3 "2026-11-03T13:05:13Z")

</div>

Hi Chris,

Rejecting same-account copies is intentional. In JMAP, `Foo/copy` exists to move records between two different accounts (RFC 8620, [section 5.4](https://www.rfc-editor.org/rfc/rfc8620#section-5.4)), and FileNode/copy follows that.

To copy inside one account, use `FileNode/set` with `create` and reuse the existing `blobId` of each file, so nothing is uploaded or stored twice. A whole folder tree fits in one `FileNode/set` call: create the directories first and point the children at them with creation id references in `parentId`:

```json
["FileNode/set", {
  "accountId": "A1",
  "create": {
    "d1": { "name": "Reports copy", "parentId": "<target dir id>" },
    "d2": { "name": "2026", "parentId": "#d1" },
    "f1": { "name": "q1.pdf", "parentId": "#d2", "blobId": "<existing blobId>" }
  }
}, "0"]

```

The client still has to walk the source tree (one `FileNode/query` or `FileNode/get` gives you the nodes and their blobIds), but it’s a single write. A server-side recursive copy would be a new method beyond the spec; if you’d like to see one, please post it in [Feature Ideas](https://support.stalw.art/c/feature-ideas/8).

---

<div class="post-metadata">

### Author: ![stalwart](https://support.stalw.art/user_avatar/support.stalw.art/stalwart/32/12_2.png) [@stalwart](https://support.stalw.art/u/stalwart)
#### Post date: [November 3, 2026, 2:13pm UTC](https://support.stalw.art/t/misleading-error-message-and-architectural-limitations-in-jmap-filenode-copy-same-account-recursive-directory-copy/2184/4 "2026-11-03T14:13:07Z")

</div>

The error text is now “accountId must differ from fromAccountId”, and the same wording is used for Email/copy, ContactCard/copy and CalendarEvent/copy. That change ships in next week’s Stalwart release.
