Welcome to My Verizon Web Space

Just publishing some web content to a website.

DKIM Proxy Init Script
17th August 2009
#!/bin/sh
#
# Copyright (C) 2005 Messiah College.
# Copyright (C) 2008 Thomas Goirand 

### BEGIN INIT INFO
# Provides:		dkimproxy
# Required-Start:	$local_fs $remote_fs
# Required-Stop:	$local_fs $remote_fs
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description:	Domain key filter init script
# Description:		dkimproxy is an SMTP-proxy designed for Postfix. It
#                       implements DKIM message signing and verification.
#                       It comprises two separate filters, an "outbound" filter
#                       for signing outgoing email, and an "inbound" filter for
#                       verifying signatures of incoming email. The filters can
#                       operate as either Before-Queue or After-Queue Postfix
#                       content filters.
### END INIT INFO

. /lib/lsb/init-functions

DKIMPROXYUSER=dkimproxy
DKIMPROXYGROUP=dkimproxy
DKIMPROXY_OUT_PRIVKEY="/var/lib/dkimproxy/private.key"

DKIM_HOSTNAME=`hostname -f`

# Get the host domains dynamically. You can change this to the location where
# you have your virtual table here, or best: ehance this script to support more
# situations with packages others than DTC
HOST_DOMAIN=`hostname -d`
if [ -f /var/lib/dtc/etc/local_domains ] ; then
	DTC_DOMAIN=`cat /var/lib/dtc/etc/local_domains | tr \\\r\\\n ,,`
	DTC_DOMAIN=`echo ${DTC_DOMAIN} | grep -v ^${HOST_DOMAIN}`
else
	DTC_DOMAIN=""
fi
DOMAIN=${DTC_DOMAIN}${HOST_DOMAIN}

DKIMPROXY_IN_ARGS="--hostname=${DKIM_HOSTNAME} --conf_file /etc/dkimproxy/dkimproxy_in.conf --user=${DKIMPROXYUSER} --group=${DKIMPROXYGROUP}"
#DKIMPROXY_OUT_ARGS="--domain=${DOMAIN} --method=simple --conf_file /etc/dkimproxy/dkimproxy_out.conf --user=${DKIMPROXYUSER} --group=${DKIMPROXYGROUP}"
DKIMPROXY_OUT_ARGS="--method=simple --conf_file /etc/dkimproxy/dkimproxy_out.conf --user=${DKIMPROXYUSER} --group=${DKIMPROXYGROUP}"

DKIMPROXY_IN_BIN="/usr/sbin/dkimproxy.in"
DKIMPROXY_OUT_BIN="/usr/sbin/dkimproxy.out"
PIDDKIMPROXY_IN="/var/run/dkimproxy.in"
PIDDKIMPROXY_OUT="/var/run/dkimproxy.out"

if [ -x /sbin/start-stop-daemon ] ; then
	STRT_STP_DMN=/sbin/start-stop-daemon
else
	STRT_STP_DMN=`which start-stop-daemon`
fi
if [ -z "${STRT_STP_DMN}" ] ; then
	echo "Can't find the start-stop-daemon binary"
fi

case "$1" in
	start)
#		log_daemon_msg "Starting inbound DomainKeys-filter" "dkimproxy.in"
#		${STRT_STP_DMN} --background --make-pidfile --start -p ${PIDDKIMPROXY_IN} -u ${DKIMPROXYUSER} -g ${DKIMPROXYGROUP} -x ${DKIMPROXY_IN_BIN} -- ${DKIMPROXY_IN_ARGS}
#		RETVAL=$?
#		START_ERROR=${RETVAL}
#		log_end_msg ${RETVAL}
#		if ! [ "${RETVAL}" -eq 0 ] ; then
#			exit ${RETVAL}
#		fi
		log_daemon_msg "Starting outbound DomainKeys-filter" "dkimproxy.out"
		${STRT_STP_DMN} --background --make-pidfile --start -p ${PIDDKIMPROXY_OUT} -u ${DKIMPROXYUSER} -g ${DKIMPROXYGROUP} -x ${DKIMPROXY_OUT_BIN} -- ${DKIMPROXY_OUT_ARGS}
		RETVAL=$?
        START_ERROR=${RETVAL}
		log_end_msg ${RETVAL}
		if ! [ "${RETVAL}" -eq 0 -a "${START_ERROR}" -eq 0 ] ; then
			#if ! [ ${RETVAL} -eq 0 ] ; then
			#	echo "Error ${RETVAL} when starting ${DKIMPROXY_IN_BIN}"
			#fi
			if ! [ "${START_ERROR}" -eq 0 ] ; then
				echo "Error ${START_ERROR} when starting ${DKIMPROXY_OUT_BIN}"
			fi
		fi
		;;

	stop)
#		log_daemon_msg "Shutting down inbound DomainKeys-filter" "dkimproxy.in"
#		${STRT_STP_DMN} --stop -p ${PIDDKIMPROXY_IN}
#		RETVALIN=$?
#		log_end_msg ${RETVALIN}
		log_daemon_msg "Shutting down outbound DomainKeys-filter" "dkimproxy.out"
		${STRT_STP_DMN} --stop -p ${PIDDKIMPROXY_OUT}
		RETVALOUT=$?
		log_end_msg ${RETVALOUT}
		if ! [ ${RETVALOUT} -eq 0 ]; then
#			if ! [ ${RETVALIN} -eq 0 ] ; then
#				echo "Error ${RETVALIN} when shutting down ${PIDDKIMPROXY_IN}"
#			fi
			if ! [ "${RETVALOUT}" -eq 0 ] ; then
				echo "Error ${RETVALOUT} when shutting down ${PIDDKIMPROXY_OUT}"
			fi
		fi
		;;
	force-reload)
		$0 stop
		sleep 1
		$0 start
		;;
	reload)
		$0 stop
		sleep 1
		$0 start
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	*)
		echo "Usage: $0 {start|stop|restart|reload|force-reload}"
		exit 1
		;;
esac

exit 0
No tags
Dexter
24th July 2009

Dexter the TV Show

This show is very good! Its a little bit darker than the usual police / crime show, and it has a very good twist.

I thought it was going to be a cheesy extension to the crime dramas out there, but I gave it a chance on this review of Dexter Season 4.

Tags: television.
Traveling to California
24th July 2009

California Here I Come

I'm really looking forward to a nice trip west. First to Los Angeles, then on to San Francisco!

Tags: travel.
Notebook Memory
2nd April 2009

Notebook Memory

Recently my notebook (ACER 5620Z) had a RAM chip go bad, so I was running the machine with only 1GB of RAM for several weeks. Then I remembered that a notebook I only use as a development server had an extra chip so I swapped it out and am now running with 2GB again. Nice!

Tags: blog.
Chronicle Review
27th March 2009

Chronicle is nice and simple

One thing I really like about Chronicle: the way I have it setup is such that if I go several months without using it, its simple enough that I don't forget how to use it. That is awesome.

Tags: blog.
Chronicle Dates
21st November 2008

How do dates work in Chronicle?

I'm getting the feeling that dates are simply regarded as text, which doesn't make much sense to me. However, Chronicle is still a new blogging engine, so perhaps its something which will get improved over time.

Tags: blog.
Another blog post
13th November 2008

So far I'm really liking the Chronicle blog compiler.

Tags: blog.
What's this then?
13th November 2008

Informed Banking

This is just my first post to this blog.

Tags: blog.

RSS feed

My Verizon DSL Blog