mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2025-12-17 23:56:19 +00:00
Moved reject tracker out of function
This commit is contained in:
parent
008d6ac4ad
commit
d1b726ab48
1 changed files with 12 additions and 17 deletions
|
|
@ -1,11 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
# Notify if rejected emails were found
|
||||
function monitor-rejects
|
||||
{
|
||||
while true
|
||||
do
|
||||
while true
|
||||
do
|
||||
bash -c 'tail -n +0 --pid=$$ -f /var/log/mail/maillog* | grep --line-buffered -F -v -f /var/log/mail/reject.log | { sed "/NOQUEUE: reject/q" && kill $$ ;}'
|
||||
local reject="$(grep "NOQUEUE: reject" /var/log/mail/maillog* | grep -F -v -f /var/log/mail/reject.log)"
|
||||
reject="$(grep "NOQUEUE: reject" /var/log/mail/maillog* | grep -F -v -f /var/log/mail/reject.log)"
|
||||
echo ${reject} >>/var/log/mail/reject.log
|
||||
cat <<- mail | sendmail reject@${MYVEMAIL_DOMAIN}
|
||||
From: reject@${MYVEMAIL_DOMAIN}
|
||||
|
|
@ -14,7 +12,4 @@ function monitor-rejects
|
|||
|
||||
${reject}
|
||||
mail
|
||||
done
|
||||
}
|
||||
|
||||
monitor-rejects &
|
||||
done &
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue