Mail notifier for LDAP password expiration.
The script is designed to be run once a day and sends an email notification to LDAP users whose password is expiring soon.
- a LDAP server with configured password expiration policy
- a working local mail relay server (e.g. postfix)
- python3 (version > 3.6)
- python3-pip
First clone the repository:
git clone https://github.com/meroupatate/ldap-password-expiration-notifier.git
Install the python dependencies:
cd ldap-password-expiration-notifier
pip3 install -r requirements.txt
Edit config.py to connect to your LDAP server:
mv config.py.example config.py
vim config.py
Test if the script is running correctly:
python3 notifier.py
Finally, set a cron job to launch the script daily:
echo '0 0 * * * root /usr/bin/python3 /path/to/notifier.py' >> /etc/cron.d/ldap-password-expiration-notifier