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
- Windows 10/11 with the WebClient service running.
- Explorer → “Map network drive” →
https://<host>/dav/file/<account>/, sign in. - 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:
PROPFINDwithallpropreturns RFC 4918 live properties plus dead properties. Clients that wantcurrent-user-principal(CalDAV/CardDAV discovery always asks for it by name) still get it. - Actual:
current-user-principalis part of everyallpropresponse, 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.