Added cron.daily file
authorNeil Smith <neil.git@njae.me.uk>
Mon, 9 Jan 2017 10:45:10 +0000 (10:45 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Mon, 9 Jan 2017 10:45:10 +0000 (10:45 +0000)
etc/cron.daily/opendmarc_report [new file with mode: 0755]
etc/opendmarc/ignore.hosts [new file with mode: 0644]

diff --git a/etc/cron.daily/opendmarc_report b/etc/cron.daily/opendmarc_report
new file mode 100755 (executable)
index 0000000..6cd7157
--- /dev/null
@@ -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 (file)
index 0000000..4e1b39d
--- /dev/null
@@ -0,0 +1,2 @@
+localhost
+192.168.1.0/24
\ No newline at end of file