1

Topic: Delete inactive users

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? Downloadable 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? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Is it possible to query the last date a user logged in?   I'm considering using iRedMail as a replacement for an existing server.  On the existing server I query users who haven't logged within 365 days and delete them.   Is this possible with iRedMail?

Thanks,
Bob

----

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

2

Re: Delete inactive users

I'd love this also

3

Re: Delete inactive users

FYI: https://docs.iredmail.org/track.user.last.login.html

4

Re: Delete inactive users

Zhang,

Thanks for the information.   I'm happy to see it's so easy to track a user's last login date.   With this information it will be trivial to write code to delete inactive users!!!

Thanks again,
Bob

5

Re: Delete inactive users

I just put this in place, and it works great. I have a question.

The doc page (https://docs.iredmail.org/track.user.last.login.html) contains this line:
"For OpenLDAP backend, since it doesn't have vmail SQL database, so we create it in iredadmin instead, it will be easier for iRedAdmin(-Pro) to read this info."

I use LDAP, and the info is being recorded in the iredadmin->last_login table just fine.

Does this mean there is a way to see that info in the iRedAdmin Pro front end?
Thanks.

6

Re: Delete inactive users

Got this working. But under the database entry named "last_login" it is an odd format I am not used to. For example 1554391952. What kind of time stamp is this format?

7

Re: Delete inactive users

It's a standard UNIX timestamp.

The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).


For instance 1554391952 translates to GMT: Thursday, April 4, 2019 3:32:32 PM
There are PHP functions to convert both ways:
echo date('m/d/Y', 1554391952);
and
strtotime ( string $time [, int $now = time() ] ) : int

8

Re: Delete inactive users

jstewart wrote:

Does this mean there is a way to see that info in the iRedAdmin Pro front end?

The latest iRedAdmin-Pro release doesn't support this yet (because this doc was published AFTER the iRedAdmin-Pro release), but i will make it happen in next release.

9

Re: Delete inactive users

jstewart wrote:

I use LDAP, and the info is being recorded in the iredadmin->last_login table just fine.

Does this mean there is a way to see that info in the iRedAdmin Pro front end?
Thanks.

Dear jstewart,

Last login date will be displayed on user list page and profile page, it's implemented in development edition of iRedAdmin-Pro, will be available in upcoming release.