Replies: 3 comments
-
Proposed code changes: // Always clear all authentication caches
self.inner
.data
.http_auth_cache
.retain(|_, id| id.item != account_id);
// Force clear access tokens
self.inner.data.access_tokens.remove(&account_id);
// Update permission cache if needed
if matches!(typ, Type::Role | Type::Tenant) {
self.inner.data.permissions.clear();
self.inner
.data
.permissions_version
.fetch_add(1, Ordering::Relaxed);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, you should increase the expiry timeout for the session cache. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Quick note. I am using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Password Update Synchronization Delay
Category: Q&A
Description
I've noticed a potential issue with password updates in the mail server. When users change their passwords, there seems to be a synchronization delay where:
Reproduction Steps
Code Investigation
Looking at crates/jmap/src/api/management/principal.rs, the cache invalidation logic appears to be conditional:
This might explain why the password changes aren't immediately effective across all authentication mechanisms.
Questions
Is this behavior intentional or a potential bug?
Would it be better to always clear all authentication caches when passwords are changed?
Are there any considerations about cache synchronization in distributed deployments?
Potential Solution
I have a proposed solution that involves:
Always clearing both HTTP auth cache and access tokens on password updates
Removing conditional cache invalidation
Forcing immediate re-authentication
Would love to get the community's thoughts on this approach before proceeding with a potential fix.
Environment
Latest version of Stalwart Mail Server
Deployment: Docker container
Authentication methods affected: Web interface, IMAP, SMTP
Additional Context
This behavior could potentially cause security issues in scenarios where immediate password invalidation is critical (e.g., security incidents, employee offboarding).
Looking forward to discussing this with the community and maintainers to determine the best path forward.
#944
Beta Was this translation helpful? Give feedback.
All reactions