From: Christian Heller Date: Thu, 24 Dec 2015 14:53:17 +0000 (+0100) Subject: Lessen mutt dependency. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/template?a=commitdiff_plain;h=9f8ae1a3603fc36b53132563fab11cd86631562e;p=pingmail.git Lessen mutt dependency. --- diff --git a/README b/README index dfe8255..24f1892 100644 --- a/README +++ b/README @@ -1,7 +1,5 @@ Small shell script to regularly check a target person's responsiveness via mail. -Expects mutt to be usable for sending mails via command line. - 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 5d97605..b59fa49 100755 --- a/pingmail +++ b/pingmail @@ -58,7 +58,7 @@ echo "Wait time since last life sign or ping sent: "$delta" seconds." # if delta > wait time, send reminder to person to check with, start reminder # mail timer if not in existence, re-touch ping wait file if [ "$delta" -gt "$wait_time" ]; then - echo $msg2checked | mutt -s "$subj2checked" $checked_address + echo $msg2checked | $mailclient_s "$subj2checked" $checked_address echo "Sending ping message." touch $ping_touch if [ ! -f "$reminder_touch" ]; then @@ -78,7 +78,7 @@ if [ -f "$reminder_touch" ]; then else delta=`expr $now - $modtime_reminder` if [ "$delta" -gt "$wait_time" ]; then - echo $msg2checker | mutt -s "$subj2checker" $checker_address + echo $msg2checker | $mailclient_s "$subj2checker" $checker_address echo "Sending reminder message." rm $reminder_touch echo "Deleting reminder message wait time file." diff --git a/pingmailrc.example b/pingmailrc.example index 6ac22bd..97a9de0 100644 --- a/pingmailrc.example +++ b/pingmailrc.example @@ -34,6 +34,9 @@ msg2checker='pingmail reporting in:\n \nNo life signs from '$id_target' for the last '$reminder_time' seconds. \nMaybe you should give them a call to check if they are okay.' +# mail client command reading message body from stdin and subject from parameter +mailclient_s='mutt -s' + # pattern to search $maildir for recursively for lifesigns checked_address_escaped=`echo $checked_address | sed 's/\./\\./g'` matchstring='^From: .*('$checked_address_escaped'|alternate@example\.org)'