Tune user’s crontab files

Сrontab adding MAILTO into user's files to prevent mail sending

cd /var/spool/cron && for i in `ls *[a-z]*`; do if ! grep "MAILTO" $i; then sed -i -e '1 s/^/MAILTO=""\n/;' $i; else echo "MAILTO is exist for $i"; fi; done

Remove not existent email address from user crontab to prevent bounces

sed -i -e 's/MAILTO\=.*/MAILTO\=""/g' /var/spool/cron/USERNAME

Similar Posts:

Leave a Reply

Your email address will not be published.