Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inactive Users] Redis configuration for user's login activity record #1361

Open
Arsnael opened this issue Dec 4, 2024 · 0 comments
Open

Comments

@Arsnael
Copy link
Member

Arsnael commented Dec 4, 2024

cf EPIC for context

For reporting a list of inactive users on the mail platform, we need to be able to record user's login activity somewhere.

Redis has been chosen as the most suitable storage for this need: famous for session data use case, fast write, AOF seems reasonable for data backup (could accept a bit of data lag for user activity use case).

regarding the way of storing data structure:

  • the key can be something like: last-login:<username> where username is the actual user's last login info
  • the value: a JSON that would have the last connection date, ip and user agent registered per protocol (imap, smtp). We would use Redis JSON.SET command

Example of the JSON value:

{
 "imap": {
   "lastConnectionDate": "XXXX",
   "ipAddress": "XXX",
   "userAgent": "XXX"
 },
 "smtp": {
   "lastConnectionDate": "XXXX",
   "ipAddress": "XXX",
   "userAgent": "XXX"
 }
}

Maybe create a new module under tmail-backend for this, like user-login-redis? (can discuss the name)

DoD

  • Unit tests
@Arsnael Arsnael transferred this issue from linagora/james-project Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant