summaryrefslogtreecommitdiffstats
path: root/opendkim-2.4.2-initscript.patch
diff options
context:
space:
mode:
Diffstat (limited to 'opendkim-2.4.2-initscript.patch')
-rw-r--r--opendkim-2.4.2-initscript.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/opendkim-2.4.2-initscript.patch b/opendkim-2.4.2-initscript.patch
new file mode 100644
index 0000000..1e3b82b
--- /dev/null
+++ b/opendkim-2.4.2-initscript.patch
@@ -0,0 +1,79 @@
+--- opendkim-2.4.2/contrib/init/redhat/opendkim.in 2011-08-05 21:09:35.000000000 -0700
++++ opendkim-2.4.2-patches/opendkim.in 2011-08-23 13:08:37.687460892 -0700
+@@ -2,7 +2,7 @@
+ #
+ # opendkim Start and stop OpenDKIM.
+
+-# chkconfig: 2345 41 61
++# chkconfig: - 41 61
+ # description: OpenDKIM implements the DomainKeys Identified Mail (DKIM)
+ # service and a milter-based filter application that can plug
+ # in to any milter-aware MTA.
+@@ -11,33 +11,58 @@
+
+ ### BEGIN INIT INFO
+ # Provides: opendkim
+-# Required-Start: opendkim
+-# Required-Stop: opendkim
+ # Short-Description: Start and stop OpenDKIM
+ # Description: OpenDKIM implements the DomainKeys Identified Mail
+ # (DKIM) service and a milter-based filter application
+ # that can plug in to any milter-aware MTA.
+ ### END INIT INFO
+
+-# OpenDKIM startup script v1.3 for RHEL/CentOS/Fedora
+-# by Steve Jenkins (SteveJenkins.com) - 02-15-2011
+-# Based on a script by Andrew Colin Kissa (TopDog) for dkim-milter - 28-05-2009
++# OpenDKIM startup script v1.4 for RHEL/CentOS/Fedora
++# by Steve Jenkins (SteveJenkins.com) - 08-22-2011
++# Based on a script by Andrew Colin Kissa (TopDog) for dkim-milter - 05-28-2009
+ # - Additional functionality to prevent multiple instances and a reload
+-# handler by Chris LaJoie - 11-01-2011
++# handler by Chris LaJoie - 01-11-2011
+ # - Added notification (along with with current PID) if "start" is issued when
+ # OpenDKIM is already running - 02-15-2011
++# - Added support to generate default keys on start - 08-22-2011
+
+ . /etc/rc.d/init.d/functions
+
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+
+-DAEMON=@sbindir@/opendkim
+-CONF_FILE=@sysconfdir@/opendkim.conf
+-PID_FILE=@localstatedir@/run/opendkim/opendkim.pid
+ RETVAL=0
++prog="opendkim"
++
++DAEMON=@sbindir@/$prog
++CONF_FILE=@sysconfdir@/$prog.conf
++PID_FILE=@localstatedir@/run/$prog/$prog.pid
++KEYGEN=@exec_prefix@/bin/opendkim-genkey
++DKIM_KEYDIR=@sysconfdir@/$prog/keys
++DKIM_SELECTOR=default
++
++do_dkim_keygen() {
++ if [ ! -s $DKIM_KEYDIR/$DKIM_SELECTOR.private ]; then
++ echo -n $"Generating default DKIM keys: "
++ if [ "x`hostname --domain`" = "x" ]; then
++ echo -n $"Cannot determine host's domain name, skipping default key generation."
++ else
++ mkdir -p $DKIM_KEYDIR
++ $KEYGEN -D $DKIM_KEYDIR -s $DKIM_SELECTOR -d `hostname --domain`
++ chown -R opendkim:opendkim $DKIM_KEYDIR
++ chmod 600 $DKIM_KEYDIR/$DKIM_SELECTOR.private
++ chmod 644 $DKIM_KEYDIR/$DKIM_SELECTOR.txt
++ echo -n $"Default DKIM keys generated."
++ fi
++ fi
++}
+
+ start() {
++ # Create keys if necessary
++ if [ "x${AUTOCREATE_DKIM_KEYS}" != xNO ]; then
++ do_dkim_keygen
++ fi
++
+ echo -n $"Starting OpenDKIM Milter: "
+ if [ -f $PID_FILE ]; then
+ PID=`cat $PID_FILE`