diff options
author | Gerardo Zamudio <gerardo.zamudio@linux.com> | 2015-04-17 08:32:13 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-04-17 08:32:13 +0700 |
commit | 704db805e92f721d264ed9f47ebcebe410cfb74e (patch) | |
tree | de60de48049501f87e0608bcced1e01b17b09f68 /network | |
parent | ca15bbaee69c2629f344af9aac24da3658111b8d (diff) | |
download | slackbuilds-704db805e92f721d264ed9f47ebcebe410cfb74e.tar.gz |
network/OpenDKIM: Added (A DKIM milter).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/OpenDKIM/OpenDKIM.SlackBuild | 148 | ||||
-rw-r--r-- | network/OpenDKIM/OpenDKIM.info | 10 | ||||
-rw-r--r-- | network/OpenDKIM/README | 33 | ||||
-rw-r--r-- | network/OpenDKIM/doinst.sh | 26 | ||||
-rw-r--r-- | network/OpenDKIM/rc.opendkim | 77 | ||||
-rw-r--r-- | network/OpenDKIM/slack-desc | 19 |
6 files changed, 313 insertions, 0 deletions
diff --git a/network/OpenDKIM/OpenDKIM.SlackBuild b/network/OpenDKIM/OpenDKIM.SlackBuild new file mode 100644 index 0000000000..5dbf17019e --- /dev/null +++ b/network/OpenDKIM/OpenDKIM.SlackBuild @@ -0,0 +1,148 @@ +#!/bin/sh + +# Slackware build script for OpenDKIM + +# Copyright 2015 Gerardo Zamudio <gerardo.zamudio@linux.com> Mexico City, Mexico +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=opendkim +VERSION=${VERSION:-2.10.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +DKUSER=${DKUSER:-opendkim} +DKGROUP=${DKGROUP:-opendkim} + +# Check the system user and group for opendkim: +if ! grep -q ^"$DKGROUP": /etc/group ; then + echo " You will need a dedicated group to run opendkim" + echo " # groupadd -g 305 $DKGROUP" + echo " should do the job." + exit 1 +fi + +if ! grep -q ^"$DKUSER": /etc/passwd ; then + echo " You will need a dedicated user to run opendkim, something like" + echo " # useradd -r -u 305 -g $DKGROUP -d /var/run/opendkim/ -s /sbin/nologin -c 'OpenDKIM Milter' $DKUSER" + exit 1 +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +if [ "${USE_MYSQL:-no}" == "yes" ]; then + MYSQL="--with-sql-backend" +else + MYSQL="" +fi + +if [ "${USE_UNBOUND:-no}" == "yes" ]; then + UNBOUND="--with-libevent --with-ldns --with-unbound" +else + UNBOUND="" +fi + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --enable-static=no \ + --with-openssl \ + --with-libcurl \ + --build=$ARCH-slackware-linux \ + $MYSQL \ + $UNBOUND + +make +make install-strip DESTDIR=$PKG + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a FEATURES INSTALL KNOWNBUGS LICENSE* README* RELEASE_NOTES* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/OpenDKIM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/OpenDKIM.SlackBuild + +mkdir -p $PKG/var/run/opendkim +chown $USER:$GROUP $PKG/var/run/opendkim/ +install -m 0640 -D $PRGNAM/opendkim.conf.simple $PKG/etc/opendkim.conf.new +install -m 0755 -D $CWD/rc.opendkim $PKG/etc/rc.d/rc.opendkim.new + +# Change KeyFile to match rc.opendkim +sed -i 's|^KeyFile.*|KeyFile /etc/opendkim/keys/default.private|' $PKG/etc/opendkim.conf.new + +echo "UserID $DKUSER:$DKGROUP" >> $PKG/etc/opendkim.conf.new + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/OpenDKIM/OpenDKIM.info b/network/OpenDKIM/OpenDKIM.info new file mode 100644 index 0000000000..28ec5427b5 --- /dev/null +++ b/network/OpenDKIM/OpenDKIM.info @@ -0,0 +1,10 @@ +PRGNAM="OpenDKIM" +VERSION="2.10.1" +HOMEPAGE="http://opendkim.org/" +DOWNLOAD="http://iweb.dl.sourceforge.net/project/opendkim/opendkim-2.10.1.tar.gz" +MD5SUM="e75c2944634f875a301d85ab30c2d094" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libbsd" +MAINTAINER="Gerardo Zamudio" +EMAIL="gerardo.zamudio@linux.com" diff --git a/network/OpenDKIM/README b/network/OpenDKIM/README new file mode 100644 index 0000000000..72784778c8 --- /dev/null +++ b/network/OpenDKIM/README @@ -0,0 +1,33 @@ +OpenDKIM is an open source implementation of the DKIM +(Domain Keys Identified Mail) sender authentication system proposed by +the E-mail Signing Technology Group (ESTG), now standardized by the IETF +(RFC6376). It also includes implementations of the RFC5617) Vouch By +Reference (VBR, RFC5518) proposed standard and the experimental +Authorized Third Party Signatures protocol (ATPS, RFC6541). + +The OpenDKIM package consists of a library that implements the DKIM +service and a milter-based filter application that can plug in to any +milter-aware MTA to provide that service to sufficiently recent +sendmail MTAs and other MTAs that support the milter protocol. + +A user and group are needed in order to run opendkim: + +groupadd -g 305 opendkim +useradd -r -u 305 -g opendkim -d /var/run/opendkim/ -s /sbin/nologin \ + -c "OpenDKIM Milter" opendkim + +You may specify alternate values if desired: + +DKUSER=nobody DKGROUP=nobody ./OpenDKIM.SlackBuild + +A sample config file has been placed in /etc/opendkim.conf + +The rc.opendkim script will automatically create keys for your machine's +domain name in /etc/opendkim/keys. Set AUTOCREATE_DKIM_KEYS=no there to +disable this behavior. + +Optional MySQL and Unbound support is provided. To enable: + +USE_MYSQL=yes USE_UNBOUND=yes ./OpenDKIM.SlackBuild + +Unbound will require the unbound package which is available in SlackBuilds. diff --git a/network/OpenDKIM/doinst.sh b/network/OpenDKIM/doinst.sh new file mode 100644 index 0000000000..cb643e67ad --- /dev/null +++ b/network/OpenDKIM/doinst.sh @@ -0,0 +1,26 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.opendkim.new +config etc/opendkim.conf.new diff --git a/network/OpenDKIM/rc.opendkim b/network/OpenDKIM/rc.opendkim new file mode 100644 index 0000000000..ae30ca7dea --- /dev/null +++ b/network/OpenDKIM/rc.opendkim @@ -0,0 +1,77 @@ +#!/bin/bash +# +# opendkim Start and stop OpenDKIM. + +# OpenDKIM startup script for Slackware 14.1 by Gerardo Zamudio +# Modified from the script by Steve Jenkins (SteveJenkins.com) - 10-29-2012 +# Based on a script by Andrew Colin Kissa (TopDog) for dkim-milter - 05-28-2009 + +USER="opendkim" +PROGRAM=/usr/sbin/opendkim +CONF_FILE=/etc/opendkim.conf +PID_FILE=/var/run/opendkim/opendkim.pid +KEYGEN=/usr/sbin/opendkim-genkey +DKIM_KEYDIR=/etc/opendkim/keys +DKIM_SELECTOR=default +AUTOCREATE_DKIM_KEYS=yes + +do_dkim_keygen() { + if [ ! -s $DKIM_KEYDIR/$DKIM_SELECTOR.private ]; then + echo -n $"Generating default DKIM keys: " + if [ "x$(hostname -d)" = "x" ]; then + echo $"Cannot determine host's domain name, so skipping default key generation." + else + mkdir -p $DKIM_KEYDIR + $KEYGEN -b 2048 -D $DKIM_KEYDIR -s $DKIM_SELECTOR -d "$(hostname -d)" + chown root:$USER $DKIM_KEYDIR + chown $USER:$USER $DKIM_KEYDIR/$DKIM_SELECTOR.{private,txt} + chmod 600 $DKIM_KEYDIR/$DKIM_SELECTOR.private + chmod 644 $DKIM_KEYDIR/$DKIM_SELECTOR.txt + echo + echo Default DKIM keys for "$(hostname -d)" created in $DKIM_KEYDIR. + fi + fi +} + +case "$1" in + start) + # Create keys if necessary + if [ "x${AUTOCREATE_DKIM_KEYS}" != xNO ]; then + do_dkim_keygen + fi + + echo -n $"Starting OpenDKIM Milter... " + echo + if [ -f $PID_FILE ]; then + PID=$(cat $PID_FILE) + echo OpenDKIM already running as pid "$PID" + exit 2; + else + $PROGRAM -l -x $CONF_FILE -P $PID_FILE + fi + ;; + stop) + echo -n $"Stopping OpenDKIM Milter... " + echo + if [ ! -f $PID_FILE ]; then + echo OpenDKIM is not running! + exit 2; + else + kill -TERM "$(cat $PID_FILE)" && rm -rf /var/run/opendkim.pid + fi + ;; + status) + if [ -f $PID_FILE ]; then + PID=$(cat $PID_FILE) + echo OpenDKIM already running as pid "$PID" + exit 2; + else + echo OpenDKIM is not running! + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|}" + exit 1 +esac + +exit $? diff --git a/network/OpenDKIM/slack-desc b/network/OpenDKIM/slack-desc new file mode 100644 index 0000000000..d75975a9bd --- /dev/null +++ b/network/OpenDKIM/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +opendkim: OpenDKIM (A DKIM milter to sign and/or verify mail) +opendkim: +opendkim: OpenDKIM is a community effort to develop and maintain a C library +opendkim: for producing DKIM-aware applications and an open source milter for +opendkim: providing DKIM service. +opendkim: +opendkim: The project started from a code fork of version 2.8.3 of the open +opendkim: source dkim-milter package developed and maintained by Sendmail, Inc. +opendkim: +opendkim: Homepage: http://opendkim.org/ +opendkim: |