adding msmtp-queue-handler depending on off/on status; make msmtp-queue paths configurable; reset counter when queue=0
This commit is contained in:
@@ -17,13 +17,15 @@ function isonline {
|
||||
|
||||
# NUMBER OF UNSENT EMAILS
|
||||
function check_mailqueue {
|
||||
QUEUE=$(msmtp-listqueue.sh | grep -o "^From: " | wc -l)
|
||||
QUEUE=$($MSMTP_LIST | grep -o "^From: " | wc -l)
|
||||
OUT="$OUT;mq=$QUEUE"
|
||||
TOOL="$TOOL;conn=$var_conn"
|
||||
|
||||
# If $QUEUE > 0 and >10 runs, show notification
|
||||
if [ "$QUEUE" -gt 0 ]; then
|
||||
var_mailqueue_runs=$(($var_mailqueue_runs + 1))
|
||||
else
|
||||
var_mailqueue_runs=0 # reset counter if queue is empty again
|
||||
fi
|
||||
if [ "$QUEUE" -gt 0 ] && [ "$var_mailqueue_runs" -gt 9 ]; then
|
||||
notify-send "There are mails in the mailqueue. Remember sending them manually or switch online status."
|
||||
|
||||
Reference in New Issue
Block a user