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

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 [email protected]. 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:

<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), 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.

curl -u [email protected] -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 [email protected]
/files/example.org/user/… (no @ anywhere in the path) yes every entry [email protected]
/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

--- 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.

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.

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