# SliTaz package receipt.

PACKAGE="postgrey"
VERSION="1.32"
CATEGORY="network"
SHORT_DESC="Postfix policy server implementing greylisting."
MAINTAINER="pascal.bellard@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://postgrey.schweikert.ch/"
WGET_URL="$WEB_SITE/pub/$TARBALL"
CONFIG_FILES="/etc/postgrey"
DEPENDS="postfix perl db perl-net-server perl-io-multiplex perl-berkeleydb"


# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/bin $fs/etc/postfix $fs/var/spool/postfix/postgrey
	cp $src/contrib/postgreyreport $src/postgrey $fs/usr/bin
	cp $src/postgrey_whitelist* $fs/etc/postfix
	cp -a stuff/etc $fs
}

# Pre and post install commands for Tazpkg.
post_install()
{
	chroot $1/ chown postfix /var/spool/postfix/postgrey
	cat <<EOF
----
To use $PACKAGE with postfix, add check_policy_service inet:127.0.0.1:60000 in
smtpd_recipient_restrictions of /etc/postfix/main.cf, i.e:

    smtpd_recipient_restrictions =
	....
	check_policy_service inet:127.0.0.1:60000,
	permit
	
To start $PACKAGE server you can run :

    /etc/init.d/$PACKAGE start

Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
----
EOF
}