# WebDAV allprop returns DAV:current-user-principal, so Windows Explorer names every file after the account

**URL:** https://support.stalw.art/t/webdav-allprop-returns-dav-current-user-principal-so-windows-explorer-names-every-file-after-the-account/1929
**Category:** Issues
**Created:** [October 13, 2026, 1:20pm UTC](https://support.stalw.art/t/webdav-allprop-returns-dav-current-user-principal-so-windows-explorer-names-every-file-after-the-account/1929 "2026-10-13T13:20:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chrisschaetzlein](https://support.stalw.art/user_avatar/support.stalw.art/chrisschaetzlein/32/1057_2.png) [@chrisschaetzlein](https://support.stalw.art/u/chrisschaetzlein)
#### Post date: [October 13, 2026, 1:20pm UTC](https://support.stalw.art/t/webdav-allprop-returns-dav-current-user-principal-so-windows-explorer-names-every-file-after-the-account/1929/1 "2026-10-13T13:20:47Z")

</div>

**Version / platform:** Stalwart v0.16.20 (official `stalwart-foundationdb` release binary, Kubernetes, FoundationDB + S3). The code in question is unchanged in v0.16.26 and on `main` (18f4e95, 2026-10-11). Client: Windows 11 26H2 (build 26300), WebClient service, Explorer “Map network drive”.

### What happens

Mapping the file store as a network drive in Windows Explorer (`https://mail.example.org/dav/file/user%40example.org/`) connects fine, and sizes and dates are correct, but **every file and folder is named `user@example.org`**. Files show up with the type “DE file” because Explorer reads the TLD as the extension. macOS Finder shows the same folder correctly.

Windows’ WebDAV redirector always sends `PROPFIND` with an empty body, i.e. `allprop`. Stalwart answers `allprop` with the properties in `DavProperty::ALL_PROPS` (`crates/dav-proto/src/schema/property.rs`). That list includes `DAV:current-user-principal`, so every `<D:response>` carries a second href:

```xml
<D:response>
  <D:href>/dav/file/user%40example.org/Gartenplan%202026.png</D:href>
  <D:propstat><D:prop>
    …
    <D:current-user-principal><D:href>/dav/pal/user%40example.org/</D:href></D:current-user-principal>
    …

```

The redirector builds the display name from the nested `DAV:href` instead of the response’s own href. This is a long-known redirector quirk (“custom-and-href” on greenbytes’ list: [WebDAV Mini-Redirector (MRXDAV.SYS) Versions and Issues List](https://greenbytes.de/tech/webdav/webdav-redirector-list.html)), and Windows 11 still has it.

This is worth fixing in Stalwart rather than just blaming Windows: RFC 4918 §9.1 / §14.2 limits `allprop` to dead properties plus the live properties defined in RFC 4918. `current-user-principal` comes from RFC 5397, so it should only be returned when it is asked for by name. The rest of `ALL_PROPS` already matches RFC 4918.

GitHub #1657 (“folder appears as a file named info” on Windows) may have had the same cause.

### Steps to reproduce

1. Windows 10/11 with the WebClient service running.
2. Explorer → “Map network drive” → `https://<host>/dav/file/<account>/`, sign in.
3. Every entry shows the account name.

Without Windows: a `PROPFIND` with `Depth: 1` and no body returns `current-user-principal` on every child.

```auto
curl -u user@example.org -X PROPFIND -H 'Depth: 1' https://<host>/dav/file/user%40example.org/

```

We isolated the cause by replaying Stalwart’s responses from a small test server to Windows 11 26H2, changing one thing at a time:

| hrefs | `current-user-principal` in allprop | Explorer / `dir` |
| --- | --- | --- |
| `/dav/file/user%40example.org/…` | yes (as Stalwart) | every entry `user@example.org` |
| `/files/example.org/user/…` (no `@` anywhere in the path) | yes | every entry `user@example.org` |
| `/dav/file/user%40example.org/…` | no | correct names |
| `/files/example.org/user/…` | no | correct names |

The `@` in the path and the `%40` encoding make no difference. Windows sends `%40` itself, and every request body it sent was empty.

### Expected vs. actual

- **Expected:** `PROPFIND` with `allprop` returns RFC 4918 live properties plus dead properties. Clients that want `current-user-principal` (CalDAV/CardDAV discovery always asks for it by name) still get it.
- **Actual:** `current-user-principal` is part of every `allprop` response, and Windows Explorer names every entry after the principal.

### Logs

No trace log attached: there is no error involved. The server returns `207` with the body shown above; the problem is in the response content.

### Proposed fix

```diff
--- a/crates/dav-proto/src/schema/property.rs
+++ b/crates/dav-proto/src/schema/property.rs
@@ impl DavProperty {
- pub const ALL_PROPS: [DavProperty; 11] = [
+ pub const ALL_PROPS: [DavProperty; 10] = [
         DavProperty::WebDav(WebDavProperty::CreationDate),
         DavProperty::WebDav(WebDavProperty::DisplayName),
         DavProperty::WebDav(WebDavProperty::GetETag),
         DavProperty::WebDav(WebDavProperty::GetLastModified),
         DavProperty::WebDav(WebDavProperty::ResourceType),
         DavProperty::WebDav(WebDavProperty::LockDiscovery),
         DavProperty::WebDav(WebDavProperty::SupportedLock),
- DavProperty::WebDav(WebDavProperty::CurrentUserPrincipal),
         DavProperty::WebDav(WebDavProperty::GetContentLanguage),
         DavProperty::WebDav(WebDavProperty::GetContentLength),
         DavProperty::WebDav(WebDavProperty::GetContentType),
     ];
@@ pub fn is_all_prop(&self) -> bool {
                 | DavProperty::WebDav(WebDavProperty::SupportedLock)
- | DavProperty::WebDav(WebDavProperty::CurrentUserPrincipal)
                 | DavProperty::WebDav(WebDavProperty::GetContentLanguage)

```

`is_all_prop` has to change too. Otherwise `<allprop/><include><current-user-principal/></include>` would filter the requested property out (`propfind.rs`, `PropFind::AllProp` branch). Not compiled on our side.

---

<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: [October 13, 2026, 1:20pm UTC](https://support.stalw.art/t/webdav-allprop-returns-dav-current-user-principal-so-windows-explorer-names-every-file-after-the-account/1929/2 "2026-10-13T13:20:58Z")

</div>

This is a well-reasoned bug report with a specific, scoped fix proposal (and it already confirms the fix isn’t yet applied in the current source, since `ALL_PROPS` still includes `CurrentUserPrincipal`). This is a genuine behavior report rather than a documentation question, so I should confirm the current state and respond accordingly rather than claim it’s fixed or unfixed without basis.

This confirms the bug exactly as described: `DavProperty::ALL_PROPS` and `is_all_prop()` both include `WebDavProperty::CurrentUserPrincipal`, so an `allprop` PROPFIND always returns `DAV:current-user-principal` alongside every resource, which is what trips up Windows’ WebDAV redirector when building display names.

This is a code-level bug report with a well-isolated repro and a correct proposed fix, not a documentation/configuration question, so I can’t resolve it here — it needs to go to the people who maintain the `dav-proto` crate.

I don’t have a mechanism to file this upstream myself, but your report is detailed enough (RFC citations, bisected table, concrete diff) that a maintainer should be able to act on it directly.

This isn’t covered in the current docs. A community member or staff member will follow up.

_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: [October 15, 2026, 4:45pm UTC](https://support.stalw.art/t/webdav-allprop-returns-dav-current-user-principal-so-windows-explorer-names-every-file-after-the-account/1929/3 "2026-10-15T16:45:43Z")

</div>

Fixed in v0.16.27 (yet to be released).
