#!/bin/sh
# 
# Copyright (c) 2012, 2013, The Trusted Domain Project.  All rights reserved.
# 
# Configuration validity check

echo "*** configuration validity checks"

if [ x"$srcdir" = x"" ]
then
	srcdir=`pwd`
fi

if ../../miltertest/miltertest -s $srcdir/t-conf-check.lua > /dev/null 2>&1
then
	echo ERROR: opendkim started with a faulty configuration
	exit 1
fi

if ../../miltertest/miltertest -s $srcdir/t-conf-check2.lua > /dev/null 2>&1
then
	echo ERROR: opendkim started with a faulty configuration
	exit 1
fi

if ! ../opendkim -n -x $srcdir/t-largecomment.conf > /dev/null 2>&1
then 
	echo ERROR: opendkim failed using a configuration file with a large comment
	exit 1
fi

exit 0
