diff options
author | Andrej Kacian <ticho@gentoo.org> | 2005-09-04 13:03:12 +0000 |
---|---|---|
committer | Andrej Kacian <ticho@gentoo.org> | 2005-09-04 13:03:12 +0000 |
commit | a8764087edd974a07850fe8b758961ced3430259 (patch) | |
tree | c3816cca9f8d46dcf487325bd133ef3068106d16 /mail-filter | |
parent | version bump (diff) | |
download | gentoo-2-a8764087edd974a07850fe8b758961ced3430259.tar.gz gentoo-2-a8764087edd974a07850fe8b758961ced3430259.tar.bz2 gentoo-2-a8764087edd974a07850fe8b758961ced3430259.zip |
Add support for UNIX socket listening. Patch provided by Arnaud Launay <asl at launay.org>, in bug #100733.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/postgrey/ChangeLog | 10 | ||||
-rw-r--r-- | mail-filter/postgrey/Manifest | 18 | ||||
-rw-r--r-- | mail-filter/postgrey/files/digest-postgrey-1.21-r1 | 1 | ||||
-rw-r--r-- | mail-filter/postgrey/files/postgrey.conf | 21 | ||||
-rw-r--r-- | mail-filter/postgrey/files/postgrey.conf.new | 51 | ||||
-rw-r--r-- | mail-filter/postgrey/files/postgrey.rc | 52 | ||||
-rw-r--r-- | mail-filter/postgrey/files/postgrey.rc.new | 75 | ||||
-rw-r--r-- | mail-filter/postgrey/postgrey-1.21-r1.ebuild | 74 |
8 files changed, 274 insertions, 28 deletions
diff --git a/mail-filter/postgrey/ChangeLog b/mail-filter/postgrey/ChangeLog index 0e4865322272..61bc1ec135f2 100644 --- a/mail-filter/postgrey/ChangeLog +++ b/mail-filter/postgrey/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for mail-filter/postgrey # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/ChangeLog,v 1.7 2005/08/23 13:13:34 ticho Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/ChangeLog,v 1.8 2005/09/04 13:03:12 ticho Exp $ + +*postgrey-1.21-r1 (04 Sep 2005) + + 04 Sep 2005; Andrej Kacian <ticho@gentoo.org> files/postgrey.conf, + +files/postgrey.conf.new, files/postgrey.rc, +files/postgrey.rc.new, + +postgrey-1.21-r1.ebuild: + Add support for UNIX socket listening. Patch provided by Arnaud Launay <asl + at launay.org>, in bug #100733. 23 Aug 2005; Andrej Kacian <ticho@gentoo.org> postgrey-1.21.ebuild: Use -1 for shell argument to enewuser. Bug #103421. diff --git a/mail-filter/postgrey/Manifest b/mail-filter/postgrey/Manifest index 6796e0d32f57..9743ca9f8782 100644 --- a/mail-filter/postgrey/Manifest +++ b/mail-filter/postgrey/Manifest @@ -1,16 +1,10 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - +MD5 87ce7504e63a7b8c0a11b3551246b109 postgrey-1.21-r1.ebuild 2009 MD5 3b4063c8e7db588b82423e6790a3d383 ChangeLog 1220 MD5 97640b63104544cebd37ca40384a056b metadata.xml 304 MD5 e55ff6309759aeea439124bf583fbda5 postgrey-1.21.ebuild 1925 -MD5 5370c321ee9c00814bce5054c6eabaa2 files/postgrey.rc 1113 +MD5 2197c50ab163af184389dbf781d6bc21 files/digest-postgrey-1.21-r1 64 +MD5 e283416417e7d517af44b20b0ab31e22 files/postgrey.rc 1903 MD5 2197c50ab163af184389dbf781d6bc21 files/digest-postgrey-1.21 64 -MD5 0a8923ebd6b1d2679cb9b1bf046da061 files/postgrey.conf 1625 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.2 (GNU/Linux) - -iD8DBQFDCyEiQlM6RnzZP+IRAuc5AJ0ZqKb7RB6rGSe3XFH40VL6V8dN/wCfRKCC -E/TDVfkraDGr4gFwEYMfBD8= -=/eBB ------END PGP SIGNATURE----- +MD5 e283416417e7d517af44b20b0ab31e22 files/postgrey.rc.new 1903 +MD5 ee7d9fc5263ec4abc981501f8e268eae files/postgrey.conf.new 2057 +MD5 ee7d9fc5263ec4abc981501f8e268eae files/postgrey.conf 2057 diff --git a/mail-filter/postgrey/files/digest-postgrey-1.21-r1 b/mail-filter/postgrey/files/digest-postgrey-1.21-r1 new file mode 100644 index 000000000000..7ecd83a4b1e7 --- /dev/null +++ b/mail-filter/postgrey/files/digest-postgrey-1.21-r1 @@ -0,0 +1 @@ +MD5 1274e073be5178445e0892a9dcc6fe98 postgrey-1.21.tar.gz 25934 diff --git a/mail-filter/postgrey/files/postgrey.conf b/mail-filter/postgrey/files/postgrey.conf index 09d7b7251d15..9881c2e71f05 100644 --- a/mail-filter/postgrey/files/postgrey.conf +++ b/mail-filter/postgrey/files/postgrey.conf @@ -1,26 +1,33 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.conf,v 1.1 2005/04/29 00:28:44 ticho Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.conf,v 1.2 2005/09/04 13:03:12 ticho Exp $ # Config file for /etc/init.d/postgrey +# LISTEN TYPE +# Set to 'inet' if you want to use a TCP socket. +# Set to 'unix' if you want to use an UNIX socket. +POSTGREY_TYPE="inet" # HOST -# What IP to listen to? -# Leave to localhost unless you know what you do. +# What IP should postgrey bind to? +# Leave unchanged unless you know what are you doing. +# (ignored if POSTGREY_TYPE is set to 'unix') POSTGREY_HOST="127.0.0.1" - # PORT -# What PORT to listen to? -# +# What TCP port should postgrey listen on? +# (ignored if POSTGREY_TYPE is set to 'unix') POSTGREY_PORT="10030" +# SOCKET +# Unix socket to listen on, if POSTGREY_TYPE is set to 'unix'. +# (ignored if POSTGREY_TYPE is set to 'inet') +POSTGREY_SOCKET="/var/spool/postfix/private/postgrey" # PID # Postgrey pid file. # Do not change, if you don't know what this is! -# POSTGREY_PID="/var/run/postgrey.pid" diff --git a/mail-filter/postgrey/files/postgrey.conf.new b/mail-filter/postgrey/files/postgrey.conf.new new file mode 100644 index 000000000000..ddcbc8d787bf --- /dev/null +++ b/mail-filter/postgrey/files/postgrey.conf.new @@ -0,0 +1,51 @@ +# Config file for /etc/init.d/postgrey + +# LISTEN TYPE +# Set to 'inet' if you want to use a TCP socket. +# Set to 'unix' if you want to use an UNIX socket. +POSTGREY_TYPE="inet" + +# HOST +# What IP should postgrey bind to? +# Leave unchanged unless you know what you are doing. +# (ignored if POSTGREY_TYPE is set to 'unix') +POSTGREY_HOST="127.0.0.1" + +# PORT +# What TCP port should postgrey listen on? +# (ignored if POSTGREY_TYPE is set to 'unix') +POSTGREY_PORT="10030" + +# SOCKET +# Unix socket to listen on, if POSTGREY_TYPE is set to 'unix'. +# Leave unchanged unless you know what you are doing. +# (ignored if POSTGREY_TYPE is set to 'inet') +POSTGREY_SOCKET="/var/spool/postfix/private/postgrey" + +# PID +# Postgrey pid file. +# Do not change, if you don't know what this is! +POSTGREY_PID="/var/run/postgrey.pid" + + +# Additional Postgrey options +# +# -v, --verbose increase verbosity level +# --delay=N greylist for N seconds (default: 300) +# --max-age=N delete entries older than N days since the last time +# that they have been seen (default: 30) +# --retry-window=N allow only N days for the first retrial (default: 2) +# append 'h' if you want to specify it in hours +# --greylist-action=A if greylisted, return A to Postfix (default: DEFER_IF_PERMIT) +# --greylist-text=TXT response when a mail is greylisted +# (default: Greylisted for %s seconds) +# --lookup-by-subnet strip the last 8 bits from IP addresses (default) +# --lookup-by-host do not strip the last 8 bits from IP addresses +# --whitelist-clients=FILE default: /etc/postfix/postgrey_whitelist_clients +# --whitelist-recipients=FILE default: /etc/postfix/postgrey_whitelist_recipients +# +# Note that the --whitelist-x options can be specified multiple times, and that +# per default /etc/postfix/postgrey_whitelist_clients.local is also read, so +# that you can put there local entries. +# +POSTGREY_OPTS="" diff --git a/mail-filter/postgrey/files/postgrey.rc b/mail-filter/postgrey/files/postgrey.rc index 1a4612d0c516..9d457f356994 100644 --- a/mail-filter/postgrey/files/postgrey.rc +++ b/mail-filter/postgrey/files/postgrey.rc @@ -1,7 +1,9 @@ #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.rc,v 1.4 2005/06/18 23:19:56 ticho Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.rc,v 1.5 2005/09/04 13:03:12 ticho Exp $ + +conf="/etc/conf.d/postgrey" depend() { need net @@ -9,23 +11,57 @@ depend() { provide postfix_greylist } +conf_error() { + eerror "You need to setup ${conf} first" + return 1 +} + checkconfig() { -if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ] || [ -z "${POSTGREY_PID}" ] +if [ -z "${POSTGREY_TYPE}" ] then - einfo "The following entries are missing in /etc/conf.d/postgrey:" - [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST" - [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT" + einfo "You need to choose the server type you want" + einfo "by setting the POSTGREY_TYPE variable in ${conf}." + else + if [ "x${POSTGREY_TYPE}" = "xinet" ] + then + if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ] + then + einfo "The following entries are missing in ${conf}:" + [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST" + [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT" + conf_error + fi + POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}" + else + if [ -z "${POSTGREY_SOCKET}" ] + then + einfo "The following entries are missing in ${conf}:" + [ -z "${POSTGREY_SOCKET}" ] && einfo " - POSTGREY_SOCKET" + conf_error + fi + POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}" + fi +fi + + if [ -z "${POSTGREY_PID}" ] + then + einfo "The following entries are missing in ${conf}:" [ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID" - eerror "You need to setup variables in /etc/conf.d/postgrey first" - return 1 + conf_error fi } + start() { checkconfig || return 1 ebegin "Starting Postgrey" + + # HACK -- start a subshell and corrects perms on the socket... + ( if [ "x${POSTGREY_TYPE}" = "xunix" ]; then + sleep 2 && chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) & + start-stop-daemon --start --quiet --background \ --exec /usr/sbin/postgrey -- \ - --inet=${POSTGREY_HOST}:${POSTGREY_PORT} \ + --${POSTGREY_ADDR} \ --daemonize \ --pidfile=${POSTGREY_PID} \ ${POSTGREY_OPTS} diff --git a/mail-filter/postgrey/files/postgrey.rc.new b/mail-filter/postgrey/files/postgrey.rc.new new file mode 100644 index 000000000000..ea384c058571 --- /dev/null +++ b/mail-filter/postgrey/files/postgrey.rc.new @@ -0,0 +1,75 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.rc.new,v 1.1 2005/09/04 13:03:12 ticho Exp $ + +conf="/etc/conf.d/postgrey" + +depend() { + need net + use postfix + provide postfix_greylist +} + +conf_error() { + eerror "You need to setup ${conf} first" + return 1 +} + +checkconfig() { +if [ -z "${POSTGREY_TYPE}" ] + then + einfo "You need to choose the server type you want" + einfo "by setting the POSTGREY_TYPE variable in ${conf}." + else + if [ "x${POSTGREY_TYPE}" = "xinet" ] + then + if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ] + then + einfo "The following entries are missing in ${conf}:" + [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST" + [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT" + conf_error + fi + POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}" + else + if [ -z "${POSTGREY_SOCKET}" ] + then + einfo "The following entries are missing in ${conf}:" + [ -z "${POSTGREY_SOCKET}" ] && einfo " - POSTGREY_SOCKET" + conf_error + fi + POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}" + fi +fi + + if [ -z "${POSTGREY_PID}" ] + then + einfo "The following entries are missing in ${conf}:" + [ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID" + conf_error + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting Postgrey" + + # HACK -- start a subshell and corrects perms on the socket... + ( if [ "x${POSTGREY_TYPE}" = "xunix" ]; then + sleep 2 && chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) & + + start-stop-daemon --start --quiet --background \ + --exec /usr/sbin/postgrey -- \ + --${POSTGREY_ADDR} \ + --daemonize \ + --pidfile=${POSTGREY_PID} \ + ${POSTGREY_OPTS} + eend ${?} +} + +stop() { + ebegin "Stopping Postgrey" + start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID} + eend ${?} +} diff --git a/mail-filter/postgrey/postgrey-1.21-r1.ebuild b/mail-filter/postgrey/postgrey-1.21-r1.ebuild new file mode 100644 index 000000000000..4e374af6a588 --- /dev/null +++ b/mail-filter/postgrey/postgrey-1.21-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/postgrey-1.21-r1.ebuild,v 1.1 2005/09/04 13:03:12 ticho Exp $ + +inherit eutils + +DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting" +SRC_URI="http://isg.ee.ethz.ch/tools/${PN}/pub/${P}.tar.gz + http://isg.ee.ethz.ch/tools/${PN}/pub/old/${P}.tar.gz" +HOMEPAGE="http://isg.ee.ethz.ch/tools/postgrey/" +LICENSE="GPL-2" +SLOT="0" +IUSE="" +DEPEND="" +RDEPEND=">=dev-lang/perl-5.6.0 + dev-perl/net-server + dev-perl/IO-Multiplex + dev-perl/BerkeleyDB + dev-perl/Net-DNS + >=sys-libs/db-4.1 + >=mail-mta/postfix-2.1.0" + +KEYWORDS="~alpha ~amd64 ~x86" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 /dev/null ${PN} +} + +src_install () { + cd ${S} + + # postgrey data/DB in /var + diropts -m0770 -o ${PN} -g ${PN} + dodir /var/spool/postfix/${PN} + keepdir /var/spool/postfix/${PN} + fowners postgrey:postgrey /var/spool/postfix/${PN} + fperms 0770 /var/spool/postfix/${PN} + + # postgrey binary + dosbin ${PN} + dosbin contrib/postgreyreport + + # postgrey data in /etc/postfix + insinto /etc/postfix + insopts -o root -g ${PN} -m 0640 + doins postgrey_whitelist_clients postgrey_whitelist_recipients + + # documentation + dodoc Changes COPYING README + + # init.d + conf.d files + newinitd ${FILESDIR}/${PN}.rc.new ${PN} + newconfd ${FILESDIR}/${PN}.conf.new ${PN} +} + +pkg_postinst() { + echo + einfo "To make use of greylisting, please update your postfix config:" + einfo + + einfo "In order to start using postgrey, edit /etc/conf.d/postgrey, add following lines" + einfo "to smtpd_recipient restrictions setting in your /etc/postfix/main.cf:" + einfo "\t\"check_policy_service inet:127.0.0.1:10030\", if you're using TCP socket" + einfo "\t\"check_policy_service unix:private/postgrey\", if you're using UNIX socket" + einfo "Then, start postgrey and restart postfix." + + einfo "Also remember to make the daemon start durig system boot:" + einfo " rc-update add postgrey default" + echo + ewarn "Read postgrey documentation for more info (perldoc postgrey)." + echo + epause 5 +} |