Просмотр исходного кода

[Fix] Explicitly disable cron reports

Currently missing MAILTO variable defaults user@hostname and floods the email server in case of errors, reaching exim ratelimits

ref: https://manpages.ubuntu.com/manpages/bionic/man5/crontab.5.html
Robert Zollner 4 лет назад
Родитель
Сommit
0943c4bb99
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      func/main.sh

+ 2 - 0
func/main.sh

@@ -622,6 +622,8 @@ sync_cron_jobs() {
     if [ "$CRON_REPORTS" = 'yes' ]; then
         echo "MAILTO=$CONTACT" > $crontab
         echo 'CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab
+    else
+        echo 'MAILTO=""' > $crontab
     fi
     
     while read line; do