summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Andrew Clemons2017-02-24 17:52:01 +0100
committer Willy Sudiarto Raharjo2017-02-24 17:52:01 +0100
commita8a54eb166c2cf2a71e66fbafde625623f3f2bf7 (patch)
tree04c0bfb0767d86b28a1c82d3157412179382554c
parentf6010a25674d9f56e32b89f976af64432da404b9 (diff)
downloadslackbuilds-a8a54eb166c2cf2a71e66fbafde625623f3f2bf7.tar.gz
network/emailrelay: Added (SMTP proxy and store-and-forward MTA).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/emailrelay/README6
-rw-r--r--network/emailrelay/doinst.sh19
-rw-r--r--network/emailrelay/emailrelay.SlackBuild119
-rw-r--r--network/emailrelay/emailrelay.info10
-rw-r--r--network/emailrelay/patches/a9dcd228875a40ef2b475ff6f328332bd6f6e4f6.patch31
-rw-r--r--network/emailrelay/patches/b79f2cb7c70d7c311162cb9d38b3921b76ddae3d.patch26
-rw-r--r--network/emailrelay/slack-desc19
7 files changed, 230 insertions, 0 deletions
diff --git a/network/emailrelay/README b/network/emailrelay/README
new file mode 100644
index 0000000000..47e94fa533
--- /dev/null
+++ b/network/emailrelay/README
@@ -0,0 +1,6 @@
+E-MailRelay is a simple SMTP proxy and store-and-forward message transfer agent
+(MTA). When running as a proxy all e-mail messages can be passed through a
+user-defined program, such as a spam filter, which can drop, re-address or edit
+messages as they pass through. When running as a store-and-forward MTA incoming
+messages are stored in a local spool directory, and then forwarded to the next
+SMTP server on request.
diff --git a/network/emailrelay/doinst.sh b/network/emailrelay/doinst.sh
new file mode 100644
index 0000000000..a7d81dcee6
--- /dev/null
+++ b/network/emailrelay/doinst.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+spool="var/spool/emailrelay"
+submit="usr/sbin/emailrelay-submit"
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+fix_permissions
+
+config etc/rc.d/rc.emailrelay.new
+config etc/emailrelay.conf.new
diff --git a/network/emailrelay/emailrelay.SlackBuild b/network/emailrelay/emailrelay.SlackBuild
new file mode 100644
index 0000000000..31389f8a62
--- /dev/null
+++ b/network/emailrelay/emailrelay.SlackBuild
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+# Slackware build script for emailrelay
+
+# Copyright 2011,2013 Andrew Clemons, Wellington, New Zealand
+# Copyright 2016-2017 Andrew Clemons, Wellington, New Zealand
+# 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=emailrelay
+VERSION=${VERSION:-1.9}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$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
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz
+cd $PRGNAM-$VERSION
+
+for sha1 in b79f2cb7c70d7c311162cb9d38b3921b76ddae3d a9dcd228875a40ef2b475ff6f328332bd6f6e4f6 ; do
+ patch -p1 < "$CWD/patches/$sha1.patch"
+done
+
+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 {} \;
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --disable-gui \
+ --with-openssl \
+ --disable-install-hook \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+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
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/etc/rc.d/
+mv $PKG/usr/libexec/emailrelay/init/emailrelay $PKG/etc/rc.d/rc.emailrelay.new
+mv $PKG/etc/emailrelay.conf $PKG/etc/emailrelay.conf.new
+
+rm -rf $PKG/usr/libexec/emailrelay/init/
+rm -rf $PKG/etc/pam.d
+
+chgrp daemon $PKG/var/spool/emailrelay && chmod 775 $PKG/var/spool/emailrelay
+chgrp daemon $PKG/usr/sbin/emailrelay-submit && chmod g+s $PKG/usr/sbin/emailrelay-submit
+
+mkdir -p $PKG/install
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/emailrelay/emailrelay.info b/network/emailrelay/emailrelay.info
new file mode 100644
index 0000000000..b503e5c584
--- /dev/null
+++ b/network/emailrelay/emailrelay.info
@@ -0,0 +1,10 @@
+PRGNAM="emailrelay"
+VERSION="1.9"
+HOMEPAGE="http://emailrelay.sourceforge.net/"
+DOWNLOAD="http://sourceforge.net/projects/emailrelay/files/emailrelay/1.9/emailrelay-1.9-src.tar.gz"
+MD5SUM="0892fbf993407c6b5a16f96e23299b62"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Andrew Clemons"
+EMAIL="andrew.clemons@gmail.com"
diff --git a/network/emailrelay/patches/a9dcd228875a40ef2b475ff6f328332bd6f6e4f6.patch b/network/emailrelay/patches/a9dcd228875a40ef2b475ff6f328332bd6f6e4f6.patch
new file mode 100644
index 0000000000..e6e15147f0
--- /dev/null
+++ b/network/emailrelay/patches/a9dcd228875a40ef2b475ff6f328332bd6f6e4f6.patch
@@ -0,0 +1,31 @@
+From a9dcd228875a40ef2b475ff6f328332bd6f6e4f6 Mon Sep 17 00:00:00 2001
+From: Andrew Clemons <andrew.clemons@gmail.com>
+Date: Thu, 5 May 2016 12:56:52 +1200
+Subject: [PATCH] --tls-config 3 only enabled SSLv3
+
+This flag is meant to enable SSLv3 and any later protocol but actually
+only enabled SSLv3.
+
+https://www.openssl.org/docs/man1.0.1/ssl/SSLv3_method.html
+---
+ src/gssl/gssl_openssl.cpp | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/gssl/gssl_openssl.cpp b/src/gssl/gssl_openssl.cpp
+index f64ad94..f8a225f 100644
+--- a/src/gssl/gssl_openssl.cpp
++++ b/src/gssl/gssl_openssl.cpp
+@@ -292,9 +292,10 @@ GSsl::Context::Context( const std::string & pem_file , unsigned int flags )
+ {
+ if( (flags&3U) == 2U )
+ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
+- else if( (flags&3U) == 3U )
+- m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ;
+- else {
++ else if( (flags&3U) == 3U ) {
++ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
++ SSL_CTX_set_options(m_ssl_ctx, SSL_OP_NO_SSLv2) ;
++ } else {
+ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
+ SSL_CTX_set_options(m_ssl_ctx, SSL_OP_NO_SSLv2| SSL_OP_NO_SSLv3) ;
+ }
diff --git a/network/emailrelay/patches/b79f2cb7c70d7c311162cb9d38b3921b76ddae3d.patch b/network/emailrelay/patches/b79f2cb7c70d7c311162cb9d38b3921b76ddae3d.patch
new file mode 100644
index 0000000000..3e0f6f2115
--- /dev/null
+++ b/network/emailrelay/patches/b79f2cb7c70d7c311162cb9d38b3921b76ddae3d.patch
@@ -0,0 +1,26 @@
+From b79f2cb7c70d7c311162cb9d38b3921b76ddae3d Mon Sep 17 00:00:00 2001
+From: Andrew Clemons <andrew.clemons@gmail.com>
+Date: Thu, 5 May 2016 12:55:02 +1200
+Subject: [PATCH] Use TLS1.1 and TLS1.2 if openssl supports it
+
+---
+ src/gssl/gssl_openssl.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/gssl/gssl_openssl.cpp b/src/gssl/gssl_openssl.cpp
+index 34af44f..f64ad94 100644
+--- a/src/gssl/gssl_openssl.cpp
++++ b/src/gssl/gssl_openssl.cpp
+@@ -294,8 +294,10 @@ GSsl::Context::Context( const std::string & pem_file , unsigned int flags )
+ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
+ else if( (flags&3U) == 3U )
+ m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ;
+- else
+- m_ssl_ctx = SSL_CTX_new(TLSv1_method()) ;
++ else {
++ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
++ SSL_CTX_set_options(m_ssl_ctx, SSL_OP_NO_SSLv2| SSL_OP_NO_SSLv3) ;
++ }
+
+ if( m_ssl_ctx == NULL )
+ throw Error( "SSL_CTX_new" , ERR_get_error() ) ;
diff --git a/network/emailrelay/slack-desc b/network/emailrelay/slack-desc
new file mode 100644
index 0000000000..8f22802191
--- /dev/null
+++ b/network/emailrelay/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------------------------------------------------------|
+emailrelay: emailrelay (SMTP proxy and store-and-forward MTA)
+emailrelay:
+emailrelay: E-MailRelay is a simple SMTP proxy and store-and-forward message
+emailrelay: transfer agent (MTA). When running as a proxy all e-mail messages
+emailrelay: can be passed through a user-defined program, such as a spam
+emailrelay: filter, which can drop, re-address or edit messages as they pass
+emailrelay: through. When running as a store-and-forward MTA incoming messages
+emailrelay: are stored in a local spool directory, and then forwarded to the
+emailrelay: next SMTP server on request.
+emailrelay:
+emailrelay: