diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 1e06b907..28dbd422 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -1696,18 +1696,28 @@ function install_email { function remove_ip_addresses_from_email_logs { { echo '#!/bin/bash'; - echo 'if [ -f /var/log/exim4/mainlog ]; then'; - echo " if grep -q '\\[' /var/log/exim4/mainlog; then"; - echo " tail -n 50 /var/log/exim4/mainlog | sed 's/\\[[^][]*\\]//g' > /tmp/.exim4_mainlog"; - echo ' chown Debian-exim:adm /tmp/.exim4_mainlog'; - echo ' mv /tmp/.exim4_mainlog /var/log/exim4/mainlog'; + echo ''; + echo 'if grep -q "= /dev/null" /etc/php/7.0/fpm/php-fpm.conf; then'; + echo ' if [ -f /var/log/exim4/mainlog ]; then'; + echo ' rm /var/log/exim4/mainlog'; echo ' fi'; - echo 'fi'; - echo 'if [ -f /var/log/exim4/rejectlog ]; then'; - echo " if grep -q '\\[' /var/log/exim4/rejectlog; then"; - echo " tail -n 50 /var/log/exim4/rejectlog | sed 's/\\[[^][]*\\]//g' > /tmp/.exim4_rejectlog"; - echo ' chown Debian-exim:adm /tmp/.exim4_rejectlog'; - echo ' mv /tmp/.exim4_rejectlog /var/log/exim4/rejectlog'; + echo ' if [ -f /var/log/exim4/rejectlog ]; then'; + echo ' rm /var/log/exim4/rejectlog'; + echo ' fi'; + echo 'else'; + echo ' if [ -f /var/log/exim4/mainlog ]; then'; + echo " if grep -q '\\[' /var/log/exim4/mainlog; then"; + echo " tail -n 50 /var/log/exim4/mainlog | sed 's/\\[[^][]*\\]//g' > /tmp/.exim4_mainlog"; + echo ' chown Debian-exim:adm /tmp/.exim4_mainlog'; + echo ' mv /tmp/.exim4_mainlog /var/log/exim4/mainlog'; + echo ' fi'; + echo ' fi'; + echo ' if [ -f /var/log/exim4/rejectlog ]; then'; + echo " if grep -q '\\[' /var/log/exim4/rejectlog; then"; + echo " tail -n 50 /var/log/exim4/rejectlog | sed 's/\\[[^][]*\\]//g' > /tmp/.exim4_rejectlog"; + echo ' chown Debian-exim:adm /tmp/.exim4_rejectlog'; + echo ' mv /tmp/.exim4_rejectlog /var/log/exim4/rejectlog'; + echo ' fi'; echo ' fi'; echo 'fi'; } > /usr/bin/exim_log_tidy chmod +x /usr/bin/exim_log_tidy