From: Christian Heller Date: Mon, 3 Dec 2018 17:48:35 +0000 (+0100) Subject: Handle mailbox files instead of maildirs too. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/test?a=commitdiff_plain;h=14dfa8853e4014e8d01e6f8ab595bf64a7ec861c;p=pingmail.git Handle mailbox files instead of maildirs too. --- diff --git a/README b/README index 5908bcd..9ce6207 100644 --- a/README +++ b/README @@ -1,5 +1,14 @@ Small shell script to regularly check a target person's responsiveness via mail. +When run as "pingmail check", tries to derive the last time a person sent a +mail to the local system by either a) searching a maildir for the most recent +file matching a regex pattern (such as a "From: " field matching the target +person), and looking at thta file's modification time, or b) checking the +modification time of a defined mailbox file. If that point in time is too +distant, sends an e-mail to the target person requesting some sign of life. +After some more wait time without a sign of life, sends a warning message to +another mail address that target person is unresponsive. + When run as "pingmail check", searches a maildir for the most recent file matching a regex pattern (such as a "From: " field matching the target person), and if the most recent file is too old, sends an e-mail to the target person diff --git a/pingmail b/pingmail index b59fa49..f40eb0f 100755 --- a/pingmail +++ b/pingmail @@ -28,19 +28,23 @@ if [ -f $ping_touch ]; then modtime_pingfile=`stat $ping_touch --format=%Y` fi -# search maildir for last life sign datetime +# search mailbox or maildir for last life sign datetime modtime_mails=0 -while read file; do - if [ -z $file ]; then - break - fi - modtime=`stat $file --format=%Y` - if [ "$modtime" -gt "$modtime_mails" ]; then - modtime_mails=$modtime - fi -done <