summaryrefslogtreecommitdiff
path: root/network/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'network/postfix')
-rw-r--r--network/postfix/README66
-rw-r--r--network/postfix/doinst.sh18
-rw-r--r--network/postfix/patches/postconf.diff31
-rw-r--r--network/postfix/postfix.SlackBuild139
-rw-r--r--network/postfix/postfix.info10
5 files changed, 128 insertions, 136 deletions
diff --git a/network/postfix/README b/network/postfix/README
index 1004bc808c..c5eada0ee6 100644
--- a/network/postfix/README
+++ b/network/postfix/README
@@ -1,33 +1,33 @@
-What is Postfix? It is Wietse Venema's mailer that started life as an
-alternative to the widely-used Sendmail program.
-
-Postfix attempts to be fast, easy to administer, and secure, while at
-the same time, being sendmail compatible enough to not upset existing
-users. Thus, the outside has a sendmail-ish flavor, but the inside is
-completely different.
-
-This script builds postfix with support for Dovecot SASL but does not
-include any support for Cyrus-SASL. If you need to enable support for
-Cyrus see SASL_README in the source code. You can also enable support
-for MySQL and Postgres. This script should find support for BerkleyDB
-and PCRE automagically, so no special options are required. Further,
-this script builds postfix with TLS support and requires that openssl
-be installed. openssl-solibs is not enough. You can find a SlackBuild
-script for Dovecot at http://www.SlackBuilds.org/ but you do not need
-to install it to use this package without SASL.
-
-A couple things to remember about postfix:
- - this script doesn't add the necessary postfix user and postdrop
- group, but exits if they do not exist. Add these before running
- this script. They should have no special permission and postfix
- should NOT be a member of the postdrop group. The script *WILL*
- offer some sane defaults that won't conflict with the canonical
- users and groups, and shouldn't conflict with any other scripts
- downloaded from SlackBuilds.org that require their own uids and
- gids
- - many of the utilities in postfix have multiple manpages such as
- postconf(5) and postconf(8). Use man -k to find them.
- - subscribe to the postfix-users mailing list
-
-If you have any questions or comments about this script, you are free
-to contact me via e-mail at <alan@lizella.net>. Thanks!
+Postfix is Wietse Venema's mailer that started life as an alternative to the
+widely-used Sendmail program. It attempts to be fast, easy to administer, and
+secure, while at the same time, being sendmail compatible enough to not upset
+existing users. Thus, the outside has a sendmail-ish flavor, but the inside is
+completely different.
+
+This script builds postfix with optional support for Dovecot SASL, Cyrus SASL
+can be enabled with:
+
+ SASL=cyrus ./postfix.SlackBuild
+
+You can also enable support for MySQL:
+
+ DATABASE=mysql ./postfix.SlackBuild
+
+This script will find support for BerkleyDB and PCRE automagically; TLS support
+requires openssl package, openssl-solibs alone is not enough. Additionally, this
+script doesn't add postfix user and groups, instead it offers sane defaults that
+won't conflict with system users and groups, and other scripts from the SBo.
+
+Package created with this script will conflict with stock sendmail package, you
+*should* remove sendmail before installing postfix, otherwise sendmail updates
+could break your postfix instance.
+
+When upgrading from an older postfix version, make sure the variables such as
+html_directory and readme_directory in /etc/postfix/main.cf point to the new
+location. These can also be fixed later, afterwards make sure to run:
+
+ postfix set-permissions
+
+Furthermore, many of the utilities in postfix have multiple manpages such as
+postconf(5) and postconf(8). Use man -k to find them, and don't forget to
+subscribe to the postfix-users mailing list!
diff --git a/network/postfix/doinst.sh b/network/postfix/doinst.sh
index 88fe4d3932..97e6510432 100644
--- a/network/postfix/doinst.sh
+++ b/network/postfix/doinst.sh
@@ -6,7 +6,8 @@ config() {
# 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
+ 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...
@@ -23,19 +24,8 @@ preserve_perms() {
config $NEW
}
-config etc/postfix/access.new
-config etc/postfix/aliases.new
-config etc/postfix/canonical.new
-config etc/postfix/generic.new
-config etc/postfix/header_checks.new
-config etc/postfix/main.cf.default.new
-config etc/postfix/main.cf.new
-config etc/postfix/makedefs.out.new
-config etc/postfix/master.cf.new
-config etc/postfix/relocated.new
-config etc/postfix/transport.new
-config etc/postfix/virtual.new
-config etc/rc.d/rc.postfix.new
+find etc/postfix -type f -name '*.new' \
+ | while read new ; do config $new ; done
preserve_perms etc/rc.d/rc.postfix.new
diff --git a/network/postfix/patches/postconf.diff b/network/postfix/patches/postconf.diff
new file mode 100644
index 0000000000..c51c1822fe
--- /dev/null
+++ b/network/postfix/patches/postconf.diff
@@ -0,0 +1,31 @@
+--- postfix-3.0.3/postfix-install.orig 2015-01-29 23:15:30.000000000 +0100
++++ postfix-3.0.3/postfix-install 2015-10-17 03:57:42.269896095 +0200
+@@ -248,7 +248,7 @@
+ case "$junk" in
+ *MAIL_VERSION*)
+ case "$mail_version" in
+- "") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++ "") mail_version="`bin/postconf -c conf -dhx mail_version`" || exit 1
+ esac
+ val=`echo "$junk" | sed 's/MAIL_VERSION$/'"$mail_version/g"` || exit 1
+ case "$val" in
+@@ -810,7 +810,7 @@
+ # the wrong place when Postfix is being upgraded.
+
+ case "$mail_version" in
+-"") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++"") mail_version="`bin/postconf -c conf -dhx mail_version`" || exit 1
+ esac
+
+ # Undo MAIL_VERSION expansion at the end of a parameter value. If
+--- postfix-3.0.3/Makefile.in.orig 2014-09-25 21:16:29.000000000 +0200
++++ postfix-3.0.3/Makefile.in 2015-10-17 04:01:27.170920308 +0200
+@@ -20,7 +20,7 @@
+ EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \
+ -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);"
+ SHLIB_DIR_OVERRIDE = \
+- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`}
++ $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -c conf -dhx shlib_directory`}
+
+ default: update
+
diff --git a/network/postfix/postfix.SlackBuild b/network/postfix/postfix.SlackBuild
index 011a5f2def..fede621f0a 100644
--- a/network/postfix/postfix.SlackBuild
+++ b/network/postfix/postfix.SlackBuild
@@ -1,6 +1,7 @@
#!/bin/sh
#
-# Copyright 2006, 2011 Alan Hicks, Lizella, GA
+# Copyright 2006, 2011 Alan Hicks, Lizella, GA
+# Copyright 2010, 2011, 2013, 2014, 2015 Mario Preksavec, Zagreb, Croatia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,10 +21,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Modified by Mario Preksavec <mario@slackware.hr>
-
PRGNAM=postfix
-VERSION=${VERSION:-2.11.4}
+VERSION=${VERSION:-3.0.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -37,7 +36,7 @@ fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
-PKG="$TMP/package-$PRGNAM"
+PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
@@ -54,7 +53,7 @@ else
LIBDIRSUFFIX=""
fi
-# Build with dovecot sasl by default, cyrus/dovecot are supported
+# Build with dovecot sasl support by default
SASL=${SASL:-dovecot}
case "$SASL" in
dovecot) SASLARGS="-DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
@@ -95,26 +94,10 @@ cat << EOF
# mv /usr/include/mysql/events.h /usr/include/mysql/events.h.bak
EOF
+
exit
fi
-set -e
-
-CFLAGS=${CFLAGS:-$SLKCFLAGS}
-
-config_directory=/etc/postfix
-daemon_directory=/usr/libexec/postfix
-command_directory=/usr/sbin
-queue_directory=/var/spool/postfix
-sendmail_path=/usr/sbin/sendmail
-newaliases_path=/usr/bin/newaliases
-mailq_path=/usr/bin/mailq
-html_directory=/usr/doc/$PRGNAM-$VERSION/html
-manpage_directory=/usr/man
-readme_directory=/usr/doc/$PRGNAM-$VERSION/README_FILES
-mail_owner=postfix
-setgid_group=postdrop
-
# Bail if user or group isn't valid on your system
if ! grep ^postfix: /etc/passwd 2>&1 > /dev/null; then
@@ -141,82 +124,70 @@ EOF
exit
fi
-rm -fr $PKG $TMP/$PRGNAM-$VERSION
+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 {} \;
+
+# Use config files from build tree, not system ones
+# This should probably go to upstream...
+patch -p1 <$CWD/patches/postconf.diff
-# TLS, and SASL support
-# Postfix unfortunately does not use a handy ./configure script so you
-# must generate the makefiles using (what else?) "make makefiles". The
-# following includes support for TLS, SASL and MYSQL if you setup your
-# variables properly (see the README file). It should
-# automatically find PCRE and DB3 support. The docs have information
-# for adding additional support such as LDAP.
+# Postfix does not use a ./configure script
-make makefiles \
+make makefiles shared=yes \
CCARGS="-DUSE_SASL_AUTH -DUSE_TLS $SASLARGS $DBARGS $LDAPARGS" \
AUXLIBS="-lssl -lcrypto $SASLLIBS $DBLIBS $LDAPLIBS" \
OPT="$SLKCFLAGS" DEBUG=""
-make
-
make non-interactive-package \
install_root=$PKG \
tempdir=$TMP/$PRGNAM-temp \
- config_directory=$config_directory \
- daemon_directory=$daemon_directory \
- command_directory=$command_directory \
- queue_directory=$queue_directory \
- sendmail_path=$sendmail_path \
- newaliases_path=$newaliases \
- mailq_path=$mailq_path \
- mail_owner=$mail_owner \
- setgid_group=$setgid_group \
- html_directory=$html_directory \
- manpage_directory=$manpage_directory \
- readme_directory=$readme_directory
-
-mkdir -p $PKG/install $PKG/etc/rc.d $PKG/usr/doc/$PRGNAM-$VERSION
-
-cp -r AAAREADME COMPATIBILITY COPYRIGHT HISTORY IPv6-ChangeLog LICENSE \
- PORTING RELEASE_NOTES TLS_ACKNOWLEDGEMENTS TLS_CHANGES TLS_LICENSE \
- US_PATENT_6321267 implementation-notes examples \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/postfix.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/postfix.SlackBuild
-
-install -m 0644 $CWD/rc.postfix $PKG/etc/rc.d/rc.postfix.new
+ config_directory=/etc/postfix \
+ daemon_directory=/usr/libexec/postfix \
+ command_directory=/usr/sbin \
+ queue_directory=/var/spool/postfix \
+ sendmail_path=/usr/sbin/sendmail \
+ newaliases_path=/usr/bin/newaliases \
+ mailq_path=/usr/bin/mailq \
+ mail_owner=postfix \
+ setgid_group=postdrop \
+ html_directory=/usr/doc/$PRGNAM-$VERSION/html \
+ manpage_directory=/usr/man \
+ readme_directory=/usr/doc/$PRGNAM-$VERSION/README_FILES
+
+install -D -m 0644 -oroot -groot $CWD/rc.postfix $PKG/etc/rc.d/rc.postfix.new
+find $PKG/etc/postfix -type f ! -name "*.default" ! -name "*.proto" ! -name "*.out" \
+ ! -name "postfix-files" -exec mv {} {}.new \;
+
+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
+
+sed -i 's#\($manpage_directory/man[158]/.\+\.[158]\)\(:.*\)#\1.gz\2#' \
+ $PKG/etc/postfix/postfix-files
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AAAREADME COMPATIBILITY COPYRIGHT HISTORY IPv6-ChangeLog LICENSE PORTING \
+ RELEASE_NOTES TLS_ACKNOWLEDGEMENTS TLS_CHANGES TLS_LICENSE US_PATENT_6321267 \
+ examples implementation-notes $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
-find $PKG -type f | \
- ( while read LINE; do
- if file $LINE | egrep "ELF.*(executable|shared object).*not stripped" \
- &> /dev/null; then
- strip $LINE
- fi
- done )
-
-gzip -9 $PKG/usr/man/*/*
-
-cd $PKG/etc/postfix
-# Since we gzip the manpages, let's fix the postfix-files to reflect that
-# so it won't throw errors during post-install
-( cd $PKG/usr/libexec/postfix
-grep manpage postfix-files | while read line;
-do MANPAGE="$(echo "$line" | cut -d: -f1)"
- sed -i s#"$MANPAGE"#"$MANPAGE.gz"# postfix-files ;
-done
-)
-
-# Create .new files
-for i in \
- access aliases canonical generic header_checks main.cf main.cf.default \
- makedefs.out master.cf relocated transport virtual ;
-do \
- mv $i $i.new ;
-done
-
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/postfix/postfix.info b/network/postfix/postfix.info
index e08598f42a..bad4531276 100644
--- a/network/postfix/postfix.info
+++ b/network/postfix/postfix.info
@@ -1,10 +1,10 @@
PRGNAM="postfix"
-VERSION="2.11.4"
+VERSION="3.0.3"
HOMEPAGE="http://www.postfix.org/"
-DOWNLOAD="http://postfix.cs.utah.edu/source/official/postfix-2.11.4.tar.gz"
-MD5SUM="7f1f67b205992f3e8acc98d597a4deef"
+DOWNLOAD="http://de.postfix.org/ftpmirror/official/postfix-3.0.3.tar.gz"
+MD5SUM="61caffae689c11d09b4c972a394ae3b1"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Alan Hicks"
-EMAIL="alan@lizella.net"
+MAINTAINER="Mario Preksavec"
+EMAIL="mario at slackware dot hr"