# Copyright 1999-2004 Gentoo Foundation# Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils S="${WORKDIR}/${P}" DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting" SRC_URI="http://isg.ee.ethz.ch/tools/${PN}/pub/old/${P}.tar.gz http://isg.ee.ethz.ch/tools/${PN}/pub/${P}.tar.gz" HOMEPAGE="http://isg.ee.ethz.ch/tools/postgrey/" LICENSE="GPL-2" IUSE="" DEPEND="" RDEPEND=">=dev-lang/perl-5.6.0 dev-perl/net-server dev-perl/IO-Multiplex dev-perl/BerkeleyDB >=sys-libs/db-4.1 >=mail-mta/postfix-2.1.0" KEYWORDS="~x86 ~amd64" pkg_setup() { id postgrey 2>/dev/null || enewgroup postgrey id postgrey 2>/dev/null || enewuser postgrey -1 /bin/false /dev/null postgrey } src_compile() { :; } src_install () { cd ${S} || die "changing to ${S} failed" # postgrey data/DB in /var diropts -m0770 -o postgrey -g postgrey dodir /var/spool/postfix/postgrey keepdir /var/spool/postfix/postgrey fowners postgrey:postgrey /var/spool/postfix/postgrey fperms 0770 /var/spool/postfix/postgrey # postgrey binary dosbin postgrey || die "installing postgrey binary failed" dosbin contrib/postgreyreport || die "installing postgreyreport failed" # postgrey data in /etc/postfix insinto /etc/postfix insopts -o root -g postgrey -m 0640 for foo in postgrey_whitelist_clients postgrey_whitelist_recipients do newins ${S}/${foo} ${foo} || die "installing ${foo} failed" done if [ ! -f "${ROOT}/etc/postfix/postgrey_whitelist_clients.local" ] then touch ${T}/postgrey_whitelist_clients.local newins ${T}/postgrey_whitelist_clients.local postgrey_whitelist_clients.local fi # documentation dodoc Changes COPYING README # postgrey init script exeinto /etc/init.d newexe ${FILESDIR}/postgrey.rc postgrey || die "installing init.d script postgrey failed" # postgrey config for gentoo insinto /etc/conf.d newins ${FILESDIR}/postgrey.conf postgrey || die "installing conf.d configuration for postgrey failed" } pkg_postinst() { echo einfo "To make use of greylisting, please update your postfix config." einfo einfo "Put something like this in /etc/postfix/main.cf:" einfo " smtpd_recipient_restrictions =" einfo " ..." einfo " check_policy_service inet:127.0.0.1:10030" einfo einfo "Remember to restart Postfix after that change. Also remember to" einfo "make the daemon start durig boot:" einfo " rc-update add postgrey default" einfo einfo "Postgrey whitelists follow similar syntax rules as Postfix access" einfo "tables. The following can be specified for recipient addresses:" einfo einfo "domain.addr" einfo " \"domain.addr\" domain and subdomains." einfo einfo "name@" einfo " \"name@.*\" and extended addresses \"name+blabla@.*\"." einfo einfo "name@domain.addr" einfo " \"name@domain.addr\" and extended addresses." einfo einfo "/regexp/" einfo " anything that matches \"regexp\" (the full address is matched)." einfo einfo einfo "The following can be specified for client addresses:" einfo einfo "domain.addr" einfo " \"domain.addr\" domain and subdomains." einfo einfo "IP1.IP2.IP3.IP4" einfo " IP address IP1.IP2.IP3.IP4. You can also leave off one number," einfo " in which case only the first specified numbers will be checked." einfo einfo "/regexp/" einfo " anything that matches \"regexp\" (the full address is matched)." echo ewarn "Read the documentation for more info (perldoc postgrey)" echo }