Open zuehls opened 1 year ago
I've improved this by counting the number of lines in the EMAIL_LOG_HEADER and using it's value as the number of lines to add to the sendDelay function.
sendDelay() {
EMAIL_LINES_TO_DELAY=$(cat "${EMAIL_LOG_HEADER}" | wc -l)
c=0
while read L; do
#[ $c -lt 4 ] && sleep ${EMAIL_DELAY_INTERVAL}
[ $c -lt "${EMAIL_LINES_TO_DELAY}" ] && sleep ${EMAIL_DELAY_INTERVAL}
c=$((c+1))
echo $L
done
}
Email functionality was not working. Discovered the following pull request was completed a while back but the value that was set '4' does not provide enough lines of delay for my SMTP relay to work correctly (subject includes error). I changed the senddelay from '4' to '5' or higher and now email log is successfully sent.
https://github.com/lamw/ghettoVCB/pull/75