mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2025-12-18 01:36:19 +00:00
Changed rejected email monitor while statement
This commit is contained in:
parent
5e833ed009
commit
b397b61348
2 changed files with 4 additions and 8 deletions
|
|
@ -24,7 +24,7 @@ RUN printf '%s\n' 'https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/' \
|
||||||
&& apk update \
|
&& apk update \
|
||||||
&& apk upgrade \
|
&& apk upgrade \
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
bash bash-completion ncurses at rsync \
|
bash bash-completion ncurses at rsync grep \
|
||||||
nginx \
|
nginx \
|
||||||
mariadb mariadb-client mariadb-server-utils \
|
mariadb mariadb-client mariadb-server-utils \
|
||||||
ca-certificates acl \
|
ca-certificates acl \
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,8 @@ done &
|
||||||
# Notify if rejected emails were found
|
# Notify if rejected emails were found
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
unset reject
|
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 $$ ;}'
|
||||||
reject=$(grep "NOQUEUE: reject" /var/log/mail/maillog* | grep -F -v -f /var/log/mail/reject.log)
|
echo "$(grep "NOQUEUE: reject" /var/log/mail/maillog* | grep -F -v -f /var/log/mail/reject.log)" >>/var/log/mail/reject.log
|
||||||
if [ ${reject} ]
|
|
||||||
then
|
|
||||||
echo "${reject}" >>/var/log/mail/reject.log
|
|
||||||
cat <<- mail | sendmail reject@${MYVEMAIL_DOMAIN}
|
cat <<- mail | sendmail reject@${MYVEMAIL_DOMAIN}
|
||||||
From: reject@${MYVEMAIL_DOMAIN}
|
From: reject@${MYVEMAIL_DOMAIN}
|
||||||
To: reject@${MYVEMAIL_DOMAIN}
|
To: reject@${MYVEMAIL_DOMAIN}
|
||||||
|
|
@ -39,10 +36,9 @@ do
|
||||||
|
|
||||||
$(tail -n 1 /var/log/mail/reject.log)
|
$(tail -n 1 /var/log/mail/reject.log)
|
||||||
mail
|
mail
|
||||||
fi
|
|
||||||
sleep 30
|
|
||||||
done &
|
done &
|
||||||
|
|
||||||
|
|
||||||
# # Refresh ssl keys daily
|
# # Refresh ssl keys daily
|
||||||
# # https://www.golinuxcloud.com/renew-self-signed-certificate-openssl/
|
# # https://www.golinuxcloud.com/renew-self-signed-certificate-openssl/
|
||||||
# while true
|
# while true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue