From 64ebc7e75dbe0e367107b3c5e764ba17cc6f9414 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 9 Jan 2017 10:45:10 +0000 Subject: [PATCH] Added cron.daily file --- etc/cron.daily/opendmarc_report | 20 ++++++++++++++++++++ etc/opendmarc/ignore.hosts | 2 ++ 2 files changed, 22 insertions(+) create mode 100755 etc/cron.daily/opendmarc_report create mode 100644 etc/opendmarc/ignore.hosts diff --git a/etc/cron.daily/opendmarc_report b/etc/cron.daily/opendmarc_report new file mode 100755 index 0000000..6cd7157 --- /dev/null +++ b/etc/cron.daily/opendmarc_report @@ -0,0 +1,20 @@ +#!/bin/bash + +SHELL_USER='opendmarc' +DB_SERVER='localhost' +DB_USER='opendmarc' +DB_PASS='*****' +DB_NAME='opendmarc' +WORK_DIR='/var/run/opendmarc' +REPORT_EMAIL='dmarc@*****' +REPORT_ORG='*****' +SMTP_SERVER='*****' + +mv ${WORK_DIR}/opendmarc.dat ${WORK_DIR}/opendmarc_import.dat -f +# cat /dev/null > ${WORK_DIR}/opendmarc.dat +sudo -u ${SHELL_USER} touch ${WORK_DIR}/opendmarc.dat +# chown opendmarc:opendmarc ${WORK_DIR}/opendmarc.dat + +/usr/sbin/opendmarc-import --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --verbose < ${WORK_DIR}/opendmarc_import.dat +/usr/sbin/opendmarc-reports --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --smtp-server=${SMTP_SERVER} --verbose --interval=86400 --report-email=${REPORT_EMAIL} --report-org=${REPORT_ORG} +/usr/sbin/opendmarc-expire --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --verbose diff --git a/etc/opendmarc/ignore.hosts b/etc/opendmarc/ignore.hosts new file mode 100644 index 0000000..4e1b39d --- /dev/null +++ b/etc/opendmarc/ignore.hosts @@ -0,0 +1,2 @@ +localhost +192.168.1.0/24 \ No newline at end of file -- 2.34.1