I have a number of accounts on a Linux server that have filesystem quotas. I would like to email people only once for each of the following circumstances:
- The person goes over quota.
- The person's quota grace period ends.
- The person goes back under quota. (This one might be optional.)
In particular, I do not want a person who is over quota to get a new email every day until they go back under quota. They should get a maximum of three emails (one for each of the events above).
warnquota program, as far as I can tell, simply emails everyone that's over quota every time it's run. That has the potential to generate a lot of mail and does not fit my requirements.
Is there another program that will meet my needs, or will I have to write something myself?
My file server is running RHEL 5. If I really need, I could mount its filesystem via NFS on a RHEL6 or RHEL7 system and run the quota-warning program from the client.