1

Topic: Sort all users by last login

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
revisiting this one:

Just wondering if this may be implemented at some point:

I can sort by last logged in date, but only per page. Is there any way to configure it like the quota sort, so that it sorts all users?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Sort all users by last login

Currently it logs last login time of IMAP/POP3, also the time of last email deliver (LMTP/LDA). Which one would you like to sort?

3

Re: Sort all users by last login

ZhangHuangbin wrote:

Currently it logs last login time of IMAP/POP3, also the time of last email deliver (LMTP/LDA). Which one would you like to sort?

I'm thinking IMAP/POP3. What I'm looking for is inactive users who have not logged on recently.

4

Re: Sort all users by last login

jstewart wrote:

I'm thinking IMAP/POP3. What I'm looking for is inactive users who have not logged on recently.

Maybe you're looking for a separated web page ike "Inactive users in X days", and you don't need/want to sort last login date at all?

5

Re: Sort all users by last login

ZhangHuangbin wrote:
jstewart wrote:

I'm thinking IMAP/POP3. What I'm looking for is inactive users who have not logged on recently.

Maybe you're looking for a separated web page ike "Inactive users in X days", and you don't need/want to sort last login date at all?

If that is possible, that would be brilliant...

6

Re: Sort all users by last login

jstewart wrote:

If that is possible, that would be brilliant...

Added to my TODO list. Will try to implement it in future release.

7

Re: Sort all users by last login

ZhangHuangbin wrote:
jstewart wrote:

If that is possible, that would be brilliant...

Added to my TODO list. Will try to implement it in future release.

Hi Zhang.

Is this still a possibility that you will be able to do this?

Thanks.

8

Re: Sort all users by last login

Hi @jstewart,

- Is this what you're looking for?
- Any action you want to do on this page? Delete a user?
- Click column head to sort.

https://i.imgur.com/yuvzfMZ.png

9

Re: Sort all users by last login

ZhangHuangbin wrote:

Hi @jstewart,

- Is this what you're looking for?
- Any action you want to do on this page? Delete a user?
- Click column head to sort.

https://i.imgur.com/yuvzfMZ.png

That would be perfect - and yes, delete user would be very helpful.

Thanks.

10

Re: Sort all users by last login

jstewart wrote:

That would be perfect - and yes, delete user would be very helpful.

Will offer 3 operations in next iRedAdmin-Pro release:

- disable the user account (if it's currently active)
- delete the account
- cleanup the last login info

11

Re: Sort all users by last login

ZhangHuangbin wrote:
jstewart wrote:

That would be perfect - and yes, delete user would be very helpful.

Will offer 3 operations in next iRedAdmin-Pro release:

- disable the user account (if it's currently active)
- delete the account
- cleanup the last login info

That sounds perfect. It will save a lot of time for me.

12

Re: Sort all users by last login

Implemented the "Disable user" feature, but i hesitate to implement the "Delete account" feature.
Do you think is it enough to have just "Disable user" feature? Or even simpler, no any actions allowed to take on this page, just click link to go to user profile page?

https://i.imgur.com/EuqpEwa.png

13 (edited by jstewart 2021-07-06 04:26:19)

Re: Sort all users by last login

ZhangHuangbin wrote:

Implemented the "Disable user" feature, but i hesitate to implement the "Delete account" feature.
Do you think is it enough to have just "Disable user" feature? Or even simpler, no any actions allowed to take on this page, just click link to go to user profile page?

https://i.imgur.com/EuqpEwa.png

Yes, thinking about it, best just to have the disable function. I think it would still be more efficient to have it on this page rather than just linking to the account. If there are a bunch of accounts that haven't accessed, much easier to do it here, then use the disabled accounts filter on the users page do either re-enable if done my mistake, or delete the accounts from there it that is what is wanted. With that in mind, I am also wondering if the default action on delete could be to NOT keep mailbox forever - sometimes easy to just choose the default which then leaves the mail on the server for accounts that are deleted, and after the fact there is no easy way to see which deleted accounts are still taking up space on the server. Also perhaps it could add users deleted with the "keep forever" choice to the deleted users table with a date way in the future, so we can change the date in the database to remove the files if needed.

Would it be possible in that list to indicate if the account if forwarded, the same way as the users page? We do have a few accounts that are forwards only and never log in, so I wouldn't want to disable those by mistake.

14

Re: Sort all users by last login

jstewart wrote:

I am also wondering if the default action on delete could be to NOT keep mailbox forever - sometimes easy to just choose the default which then leaves the mail on the server for accounts that are deleted, and after the fact there is no easy way to see which deleted accounts are still taking up space on the server.

Sure. in libs/default_settings.py, you can find parameters DAYS_TO_KEEP_REMOVED_MAILBOX and DAYS_TO_KEEP_REMOVED_MAILBOX_FOR_GLOBAL_ADMIN defined as below:

# How many days the normal domain admin can choose to keep the mailbox after
# account removal.
# To make it simpler, we use 30 days for one month, 365 days for one year.
DAYS_TO_KEEP_REMOVED_MAILBOX = [1, 7, 14, 21, 30, 60, 90, 180, 365]

# How many days the global domain admin can choose to keep the mailbox after
# account removal.
# To make it simpler, we use 30 days for one month, 365 days for one year.
# 0 means keeping forever.
DAYS_TO_KEEP_REMOVED_MAILBOX_FOR_GLOBAL_ADMIN = [
    0,
    1,
    7,
    14,
    21,
    30,
    60,
    90,
    180,
    365,
    730,
    1095,
]

Feel free to change the order or even remove some values by COPYING the parameter to /opt/www/iredadmin/settings.py and set your own values. DO NOT MODIFY libs/default_settings.py.

jstewart wrote:

Also perhaps it could add users deleted with the "keep forever" choice to the deleted users table with a date way in the future, so we can change the date in the database to remove the files if needed.

This is a good idea, put on my TODO list now. Thanks for the suggestion. smile

jstewart wrote:

Would it be possible in that list to indicate if the account if forwarded, the same way as the users page? We do have a few accounts that are forwards only and never log in, so I wouldn't want to disable those by mistake.

Will give it a try. Stay tuned.

15

Re: Sort all users by last login

ZhangHuangbin wrote:
jstewart wrote:

I am also wondering if the default action on delete could be to NOT keep mailbox forever - sometimes easy to just choose the default which then leaves the mail on the server for accounts that are deleted, and after the fact there is no easy way to see which deleted accounts are still taking up space on the server.

Sure. in libs/default_settings.py, you can find parameters DAYS_TO_KEEP_REMOVED_MAILBOX and DAYS_TO_KEEP_REMOVED_MAILBOX_FOR_GLOBAL_ADMIN defined as below:

# How many days the normal domain admin can choose to keep the mailbox after
# account removal.
# To make it simpler, we use 30 days for one month, 365 days for one year.
DAYS_TO_KEEP_REMOVED_MAILBOX = [1, 7, 14, 21, 30, 60, 90, 180, 365]

# How many days the global domain admin can choose to keep the mailbox after
# account removal.
# To make it simpler, we use 30 days for one month, 365 days for one year.
# 0 means keeping forever.
DAYS_TO_KEEP_REMOVED_MAILBOX_FOR_GLOBAL_ADMIN = [
    0,
    1,
    7,
    14,
    21,
    30,
    60,
    90,
    180,
    365,
    730,
    1095,
]

Feel free to change the order or even remove some values by COPYING the parameter to /opt/www/iredadmin/settings.py and set your own values. DO NOT MODIFY libs/default_settings.py.

jstewart wrote:

Also perhaps it could add users deleted with the "keep forever" choice to the deleted users table with a date way in the future, so we can change the date in the database to remove the files if needed.

This is a good idea, put on my TODO list now. Thanks for the suggestion. smile

jstewart wrote:

Would it be possible in that list to indicate if the account if forwarded, the same way as the users page? We do have a few accounts that are forwards only and never log in, so I wouldn't want to disable those by mistake.

Will give it a try. Stay tuned.

So if I add that to iredadmin/settings.py for the days to keep it will survive an upgrade, correct?

For the keep forever, perhaps rather than a date in the future, a new field could be added as flag to indicate it was a "keep forever". That would mean a database alteration, so I don't know which would be better.

Thanks for all your work, iredmail is an incredible product.

16

Re: Sort all users by last login

jstewart wrote:

So if I add that to iredadmin/settings.py for the days to keep it will survive an upgrade, correct?

Yes. this "settings.py" will be copied during upgrading iRedAdmin(-Pro), but not "libs/default_settings.py" (the file name contains "default_" which means it just contains default settings and should not be used for custom settings. and we mentioned this at the beginning comment lines in libs/default_settings.py).

17

Re: Sort all users by last login

A quick follow up to this improvement - it would be nice to see the quota info on that all users sort by last login page. Any chance that could be implemented? My thoughts on this are that I'd like to see if any users with large and growing mailboxes haven't logged in to check mail recently.

18

Re: Sort all users by last login

jstewart wrote:

A quick follow up to this improvement - it would be nice to see the quota info on that all users sort by last login page. Any chance that could be implemented? My thoughts on this are that I'd like to see if any users with large and growing mailboxes haven't logged in to check mail recently.

Will try to implement this in future release. Thanks for the feedback. smile