From 787f8442ce2a44eda880debe596d9260aca0e49b Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 30 Nov 2020 09:00:08 +0100 Subject: [PATCH] postfix-pgsql: Added --- postfix-pgsql/README | 25 ++++ postfix-pgsql/postfix-pgsql.SlackBuild | 115 ++++++++++++++++++ postfix-pgsql/postfix-pgsql.info | 10 ++ .../postfix.only.warn.regular.files.diff | 11 ++ .../postfix.script.starting.message.diff | 14 +++ postfix-pgsql/slack-desc | 19 +++ 6 files changed, 194 insertions(+) create mode 100644 postfix-pgsql/README create mode 100755 postfix-pgsql/postfix-pgsql.SlackBuild create mode 100644 postfix-pgsql/postfix-pgsql.info create mode 100644 postfix-pgsql/postfix.only.warn.regular.files.diff create mode 100644 postfix-pgsql/postfix.script.starting.message.diff create mode 100644 postfix-pgsql/slack-desc diff --git a/postfix-pgsql/README b/postfix-pgsql/README new file mode 100644 index 0000000..51f192d --- /dev/null +++ b/postfix-pgsql/README @@ -0,0 +1,25 @@ +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 support for Dovecot SASL, Cyrus SASL, and +TLS (using OpenSSL.) Support for Berkeley DB hash and btree maps, being a +Postfix requirement, is also detected and built. + +In addition database plugins are built for LDAP, MySQL, PCRE and sqlite3. To +add support for additional database plugins which are not provided in +Slackware, such as CDB or PostgreSQL, it is necessary to recompile this +package. See the comments in the SlackBuild script to get started. + +Postfix manual sections follow the BSD standard, where section 8 is only for +daemons, and all user commands, even root-user-only administrative commands +such as postfix(1), are in section 1. + +Postfix is exceptionally well documented. If you put a link to your +html_directory (/usr/doc/postfix/html) somewhere you can find it in your +favorite browser, all of this will be readily available to you. The place +to start is not with man pages, but with the various READMEs, all HTMLified +and with convenient hyperlinks to the relevant anchors in the HTML versions +of the manuals. diff --git a/postfix-pgsql/postfix-pgsql.SlackBuild b/postfix-pgsql/postfix-pgsql.SlackBuild new file mode 100755 index 0000000..dc2ab8b --- /dev/null +++ b/postfix-pgsql/postfix-pgsql.SlackBuild @@ -0,0 +1,115 @@ +#!/bin/sh +# +# Copyright 2006, 2011 Alan Hicks, Lizella, GA +# Copyright 2010, 2011, 2013, 2014, 2015, 2016, 2017 Mario Preksavec, Zagreb, Croatia +# Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, MN USA +# Copyright 2020 Eugen Wissner, Dachau, Germany +# 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=postfix-pgsql +VERSION=${VERSION:-3.5.7} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +SRCNAM=postfix + +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 # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz +cd $SRCNAM-$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 {} \+ + +# Fix postfix-script so that it won't think a symlink in /etc/postfix is +# group writable. Only warn about regular files there. +patch -p1 --verbose -i $CWD/postfix.only.warn.regular.files.diff + +# Make the postfix startup message look more like the other boot notices: +patch -p1 --verbose -i $CWD/postfix.script.starting.message.diff + +PGSQLARGS="-I/usr/include/postgresql -DHAS_PGSQL" + +### CHANGING BUILT-IN DOCUMENTATION PATH SETTINGS +# +# If we try to use postfix-$VERSION in any of these paths, we'll get a compile +# failure: "error: too many decimal points in number" +# So we're pretty much forced to leave things as postfix expects them. +PATHARGS="'-DDEF_HTML_DIR=\"/usr/doc/postfix/html\"' \ + '-DDEF_MANPAGE_DIR=\"/usr/man\"' \ + '-DDEF_README_DIR=\"/usr/doc/postfix/readme\"'" + +make makefiles dynamicmaps=yes pie=yes shared=yes \ + shlib_directory=/usr/lib${LIBDIRSUFFIX}/postfix/MAIL_VERSION \ + CCARGS="$PGSQLARGS $PATHARGS" \ + AUXLIBS_PGSQL="-L/usr/lib${LIBDIRSUFFIX}/postgresql/12/lib -lpq -lz -lm" \ + OPT="$SLKCFLAGS" DEBUG="" +make + +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/postfix/$VERSION +cp -a lib/postfix-pgsql.so $PKG/usr/lib${LIBDIRSUFFIX}/postfix/$VERSION/ + +strip --strip-unneeded $PKG/usr/lib${LIBDIRSUFFIX}/postfix/$VERSION/postfix-pgsql.so + +mkdir -p $PKG/etc/postfix/dynamicmaps.cf.d +echo "pgsql postfix-pgsql.so dict_pgsql_open" > $PKG/etc/postfix/dynamicmaps.cf.d/pgsql.cf + +mkdir -p $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 + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/postfix-pgsql/postfix-pgsql.info b/postfix-pgsql/postfix-pgsql.info new file mode 100644 index 0000000..64a4190 --- /dev/null +++ b/postfix-pgsql/postfix-pgsql.info @@ -0,0 +1,10 @@ +PRGNAM="postfix-pgsql" +VERSION="3.5.7" +HOMEPAGE="http://www.postfix.org/" +DOWNLOAD="http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.5.7.tar.gz" +MD5SUM="cc727f7a332765199ce67bf14753ff08" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="postgresql" +MAINTAINER="Eugene Wissner" +EMAIL="belka@caraus.de" diff --git a/postfix-pgsql/postfix.only.warn.regular.files.diff b/postfix-pgsql/postfix.only.warn.regular.files.diff new file mode 100644 index 0000000..2b6b788 --- /dev/null +++ b/postfix-pgsql/postfix.only.warn.regular.files.diff @@ -0,0 +1,11 @@ +--- ./conf/postfix-script.orig 2016-01-31 15:05:46.000000000 -0600 ++++ ./conf/postfix-script 2017-11-05 15:09:40.838097647 -0600 +@@ -275,7 +275,7 @@ + find $todo ! -user root \ + -exec $WARN not owned by root: {} \; + +- find $todo \( -perm -020 -o -perm -002 \) \ ++ find $todo -type f \( -perm -020 -o -perm -002 \) \ + -exec $WARN group or other writable: {} \; + + # Check Postfix mail_owner-owned directory tree owner/permissions. diff --git a/postfix-pgsql/postfix.script.starting.message.diff b/postfix-pgsql/postfix.script.starting.message.diff new file mode 100644 index 0000000..c32a953 --- /dev/null +++ b/postfix-pgsql/postfix.script.starting.message.diff @@ -0,0 +1,14 @@ +--- ./conf/postfix-script.orig 2019-02-28 13:02:24.783759137 -0600 ++++ ./conf/postfix-script 2019-02-28 13:05:25.516761071 -0600 +@@ -139,7 +139,10 @@ + # Foreground this so it can be stopped. All inodes are cached. + $daemon_directory/postfix-script check-warn + fi +- $INFO starting the Postfix mail system || exit 1 ++ $INFO starting the Postfix mail system > /dev/null 2> /dev/null || exit 1 ++ # Because this is called during Slackware init, let's make it look ++ # similar to everything else printed on the screen: ++ echo "Starting the Postfix mail system: $command_directory/postfix start" + case $1 in + start) + # NOTE: wait in foreground process to get the initialization status. diff --git a/postfix-pgsql/slack-desc b/postfix-pgsql/slack-desc new file mode 100644 index 0000000..0717ed7 --- /dev/null +++ b/postfix-pgsql/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------------------------------------------------------| +postfix-pgsql: postfix (mail transport and submission agent) +postfix-pgsql: +postfix-pgsql: Postfix attempts to be fast, easy to administer, and secure, while at +postfix-pgsql: the same time being sendmail compatible enough to not upset existing +postfix-pgsql: users. Thus, the outside has a sendmail-ish flavor, but the inside is +postfix-pgsql: completely different. +postfix-pgsql: +postfix-pgsql: Homepage: http://www.postfix.org +postfix-pgsql: +postfix-pgsql: +postfix-pgsql: