mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2025-12-17 21:26:19 +00:00
Re-instated reject mail logger
This commit is contained in:
parent
64f2cdaf40
commit
0e3e68dace
3 changed files with 17 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ do
|
|||
touch ${log}
|
||||
fi
|
||||
done
|
||||
syslogd -O /var/log/mail/maillog -s 2000000 -b 10
|
||||
syslogd -O /var/log/mail/maillog -s ${MYVEMAIL_LOG_SIZE:-2000000} -b 10
|
||||
|
||||
# Run all scripts in init folder
|
||||
for file in /docker-entrypoint/init.d/*.sh
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ addmx=(${MYVEMAIL_DOMAIN})
|
|||
addmx+=(${MYVEMAIL_ADDMX//,/ })
|
||||
echo -n | tee /etc/postfix/{helo_access,{whitelisted,blacklisted}_{domains,emails}} >/dev/null
|
||||
|
||||
echo "/\.outbound\.protection\.outlook\.com$/ OK Outlook services" >/etc/postfix/helo_access
|
||||
# echo "/\.outbound\.protection\.outlook\.com$/ OK Outlook services" >/etc/postfix/helo_access
|
||||
|
||||
for domain in ${addmx[@]}
|
||||
do
|
||||
|
|
@ -106,4 +106,4 @@ postmap /etc/postfix/helo_access \
|
|||
/etc/postfix/smtp_header_checks /etc/postfix/header_checks \
|
||||
/etc/postfix/body_checks \
|
||||
/etc/postfix/postscreen_access.cidr \
|
||||
/etc/postfix/{whitelisted,blacklisted}_{domains,emails}
|
||||
/etc/postfix/{whitelisted,blacklisted}_{domains,emails}
|
||||
|
|
|
|||
14
build/run/docker-entrypoint/init.d/70-reject.sh
Executable file
14
build/run/docker-entrypoint/init.d/70-reject.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
# Notify if rejected emails were found
|
||||
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 $$ ;}'
|
||||
grep -h "NOQUEUE: reject" /var/log/mail/maillog* | grep -F -v -f /var/log/mail/reject.log >>/var/log/mail/reject.log
|
||||
cat <<- mail | sendmail reject@${MYVEMAIL_DOMAIN}
|
||||
From: reject@${MYVEMAIL_DOMAIN}
|
||||
To: reject@${MYVEMAIL_DOMAIN}
|
||||
Subject: Rejected email found
|
||||
|
||||
$(tail -n 1 /var/log/mail/reject.log)
|
||||
mail
|
||||
done &
|
||||
Loading…
Add table
Add a link
Reference in a new issue