To get automatic notifications of the first you would need to write an admin Zimlet to send an alert every time an account was marked locked. You could also look into writing something that watches /opt/zimbra/log/audit.log for lines showing an account status change. The line would look something like this:
Code:
2009-11-16 15:55:13,715 INFO [btpool0-767://email.domain.com:7071/service/admin/soap/ModifyAccountRequest] [name=admin@domain.com;mid=2;ip=192.168.1.244;ua=ZimbraWebClient - [unknown] (Win);] security - cmd=ModifyAccount; name=user1@domain.com; zimbraMailStatus=enabled; zimbraAccountStatus=locked;
As for the second of getting a notification of when an account has been inactive for a long period of time, your best bet would be to either use the built in "Inactive Accounts" searches for 30 or 90 days, or adding your own custom one following along the model of those two searches. You would need to add this via the command line though since you can't put in a dynamic search on the time stamp in the web UI. Here is an example for a 60 day search:
Code:
zmprov ma admin@domain.com +zimbraAdminSavedSearches "Inactive Accounts (60 days) : (zimbraLastLogonTimestamp<=###JSON:{func: ZaSearch.getTimestampByDays, args:[-60]}###)" But this isn't really a notification, if you specifically wanted a notification the only way that I could think of would be to write a script that parsed the output of
Code:
zmprov ga user1@domain.com | grep "zimbraLastLogonTimestamp:"
for every account and determined if it was past your threshold. Put this script in a cron job to run every week or so and email you the results.