1

Topic: is there a script for password expiration notification?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: ubuntu14.0.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):Ldap
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====
i am looking for a script for password expires.
How can i search username and shadowLastChange in a certain OU using  ldapsearch

Also how can i update value of shadowLastChange for a username with command line interface ?
For example in case i need to force bulk users to change to their passwords

----

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

2

Re: is there a script for password expiration notification?

Unfortunately, no such script. You have to write your own one.

I have sample Python code to help you generate the value of shadowLastChange:

import datetime

def get_days_of_shadow_last_change(year=None, month=None, day=None):                                                           
    """Return number of days since 1970-01-01."""                                  
    today = datetime.date.today()                                                  
                                                                                   
    if not year:                                                                   
        year = today.year                                                          
                                                                                   
    if not month:                                                                  
        month = today.month                                                        
                                                                                   
    if not day:                                                                    
        day = today.day                                                            
                                                                                   
    try:                                                                           
        return (datetime.date(year, month, day) - datetime.date(1970, 1, 1)).days
    except:                                                                        
        return 0

== UPDATE ==

Are you willing to sponsor me to write one? If yes, contact me please: support <at> iredmail <dot> org.

3

Re: is there a script for password expiration notification?

I 'd like to but i am very novice at software.

ZhangHuangbin wrote:

Unfortunately, no such script. You have to write your own one.

I have sample Python code to help you generate the value of shadowLastChange:

import datetime

def get_days_of_shadow_last_change(year=None, month=None, day=None):                                                           
    """Return number of days since 1970-01-01."""                                  
    today = datetime.date.today()                                                  
                                                                                   
    if not year:                                                                   
        year = today.year                                                          
                                                                                   
    if not month:                                                                  
        month = today.month                                                        
                                                                                   
    if not day:                                                                    
        day = today.day                                                            
                                                                                   
    try:                                                                           
        return (datetime.date(year, month, day) - datetime.date(1970, 1, 1)).days
    except:                                                                        
        return 0

== UPDATE ==

Are you willing to sponsor me to write one? If yes, contact me please: support <at> iredmail <dot> org.

4

Re: is there a script for password expiration notification?

I will implement this in future release.

5

Re: is there a script for password expiration notification?

ZhangHuangbin wrote:

I will implement this in future release.

Greate,  well  how can i update value of shadowLastChange using cli, because i need password never expire  for some users?

i use ldap backend.

6

Re: is there a script for password expiration notification?

Try to set it to a very large number (the days since 1970-01-01).

7

Re: is there a script for password expiration notification?

i can set using phpldapadmin but,

how can i set it with a script for every month ?

because when the user change password  the value of the large number resets.

ZhangHuangbin wrote:

Try to set it to a very large number (the days since 1970-01-01).

8

Re: is there a script for password expiration notification?

You need to write the script yourself. Or, paid some developer to do this.
We offer paid support if you want:
http://www.iredmail.org/support.html