Skip to content

Commit d46ae0d

Browse files
author
Murray S. Kucherawy
committed
Add opendmarc-importstats
1 parent fd6439a commit d46ae0d

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

RELEASE_NOTES

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ release, and a summary of the changes in that release.
66
1.0.0 2012/07/??
77
Initial release.
88

9-
0.1.9 2012/08/??
9+
0.2.0 2012/08/??
1010
Don't apply a default IgnoreHosts list in test mode. Problem noted
1111
by Marcos Digirati.
12+
REPORTING: Add opendmarc-importstats.
1213

1314
0.1.8 2012/07/30
1415
Fix Linux build issue.

reports/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ AUTOMAKE_OPTIONS = foreign
44

55
dist_doc_DATA = README
66

7-
dist_bin_SCRIPTS = opendmarc-expire opendmarc-import opendmarc-reports
7+
dist_bin_SCRIPTS = opendmarc-expire opendmarc-import opendmarc-importstats \
8+
opendmarc-reports
89

910
dist_man_MANS = opendmarc-expire.8 opendmarc-import.8 opendmarc-reports.8

reports/opendmarc-importstats

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
##
3+
## Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
4+
##
5+
## opendmarc-importstats -- import opendmarc output to MySQL
6+
##
7+
## This is intended to be used via a crontab. If import is successful,
8+
## this code exits quietly so there's no output. If it fails, it does
9+
## "ls -l" on the temporary file, so that cron generates mail to whever
10+
## ran the job.
11+
12+
## setup
13+
statsdb="/var/tmp/dmarc.dat"
14+
# OPENDMARC_PASSWORD="password"; export OPENDMARC_PASSWORD
15+
16+
if [ -s $statsdb ]
17+
then
18+
mv $statsdb ${statsdb}.OLD.$$
19+
20+
if opendmarc-import < ${statsdb}.OLD.$$
21+
then
22+
rm ${statsdb}.OLD.$$
23+
else
24+
ls -l ${statsdb}.OLD.$$
25+
fi
26+
fi

0 commit comments

Comments
 (0)