[27351] trunk/dports/mail

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 30 12:30:34 PDT 2007


Revision: 27351
          http://trac.macosforge.org/projects/macports/changeset/27351
Author:   markd at macports.org
Date:     2007-07-30 12:30:34 -0700 (Mon, 30 Jul 2007)

Log Message:
-----------
Closes #12101. New port.

Added Paths:
-----------
    trunk/dports/mail/postgrey/
    trunk/dports/mail/postgrey/Portfile
    trunk/dports/mail/postgrey/files/
    trunk/dports/mail/postgrey/files/postgrey.conf
    trunk/dports/mail/postgrey/files/postgrey.sh

Added: trunk/dports/mail/postgrey/Portfile
===================================================================
--- trunk/dports/mail/postgrey/Portfile	                        (rev 0)
+++ trunk/dports/mail/postgrey/Portfile	2007-07-30 19:30:34 UTC (rev 27351)
@@ -0,0 +1,106 @@
+PortSystem	 1.0
+name		 postgrey
+version		 1.29
+categories	 mail
+maintainers	 cbellot at sky.fr
+description	 Postfix policy server implementing greylisting 
+long_description When a request for delivery of a mail is received by \
+		 Postfix via SMTP, the triplet CLIENT_IP / SENDER / RECIPIENT \
+		 is built. If it is the first time that this triplet is seen, \
+		 or if the triplet was first seen, less than 5 minutes ago, \
+		 then the mail gets rejected with a temporary error. Hopefully\
+		 spammers or viruses will not try again later, as it is \
+		 however required per RFC.
+platforms	 darwin
+master_sites	 http://postgrey.schweikert.ch/pub \
+		 http://postgrey.schweikert.ch/pub/old
+checksums        md5 42d58fea95b173b9809c53c3bc232457
+
+build.target
+depends_lib-append	port:p5-io-multiplex \
+			port:p5-net-server \
+			port:p5-berkeley-db
+
+startupitem.create      yes
+startupitem.start       "${prefix}/share/postgrey/postgrey.sh start"
+startupitem.stop        "${prefix}/share/postgrey/postgrey.sh stop"
+
+use_configure    no
+build {}
+
+post-patch {
+  reinplace "s|/usr/bin/perl|${prefix}/bin/perl|g" \
+	${worksrcpath}/postgrey \
+	${worksrcpath}/contrib/postgreyreport
+  reinplace "s|/etc/postfix|${prefix}/etc/postgrey|g" \
+	${worksrcpath}/postgrey \
+	${worksrcpath}/postgrey_whitelist_clients \
+	${worksrcpath}/postgrey_whitelist_recipients \
+	${worksrcpath}/contrib/postgreyreport
+  reinplace "s|/etc/main.cf|postfix's main.cf|g" \
+	${worksrcpath}/postgrey
+  reinplace "s|/var/spool/postfix/postgrey|${prefix}/var/spool/postgrey|g" \
+	${worksrcpath}/postgrey \
+	${worksrcpath}/contrib/postgreyreport
+}
+
+destroot { 
+  adduser postgrey realname=Postgrey\ Server
+  addgroup postgrey
+  file mkdir ${destroot}${prefix}/etc/postgrey
+  file mkdir ${destroot}${prefix}/share/postgrey
+  file mkdir ${destroot}${prefix}/share/doc/postgrey
+  file mkdir ${destroot}${prefix}/share/man/man1
+  file mkdir ${destroot}${prefix}/share/man/man8
+  xinstall -d -o postgrey -g postgrey -m 750 \
+	${destroot}${prefix}/var/spool/postgrey
+  xinstall -d -o postgrey -g postgrey -m 750 \
+	${destroot}${prefix}/var/run/postgrey
+  destroot.keepdirs ${destroot}${prefix}/var/spool/postgrey \
+	${destroot}${prefix}/var/run/postgrey \
+	${destroot}${prefix}/etc/postgrey
+  system "pod2man --section=8 ${worksrcpath}/postgrey > \
+	${destroot}${prefix}/share/man/man8/postgrey.8"
+  system "pod2man --section=1 ${worksrcpath}/contrib/postgreyreport > \
+	${destroot}${prefix}/share/man/man1/postgreyreport.1"
+  xinstall -m 755 -c ${worksrcpath}/contrib/postgreyreport \
+	${destroot}${prefix}/bin/postgreyreport
+  xinstall -m 644 -W ${worksrcpath} README README.exim Changes COPYING \
+	${destroot}${prefix}/share/doc/postgrey
+  xinstall -m 644 ${portpath}/files/postgrey.conf \
+	${destroot}${prefix}/etc/postgrey/postgrey.conf.sample
+  xinstall -m 755 ${portpath}/files/postgrey.sh \
+	${destroot}${prefix}/share/postgrey
+  reinplace "s|__PREFIX|${prefix}|g" \
+	${destroot}${prefix}/share/postgrey/postgrey.sh
+  xinstall -m 4755 -o postgrey -g postgrey -c postgrey \
+	${destroot}${prefix}/sbin/postgrey
+  xinstall -m 644 ${worksrcpath}/postgrey_whitelist_clients \
+	${destroot}${prefix}/etc/postgrey
+  xinstall -m 644 ${worksrcpath}/postgrey_whitelist_recipients \
+	${destroot}${prefix}/etc/postgrey/postgrey_whitelist_recipients.default
+}
+
+post-install {
+ui_msg "\n
+Postgrey will be running with following default parameters:
+  user        : postgrey
+  group       : postgrey
+  tcp binding : localhost
+  tcp port    : 60000
+
+You will find configuration in ${prefix}/etc/postgrey
+  postgrey.conf                         : launch options
+  postgrey_whitelist_clients            : default clients whitelist
+  postgrey_whitelist_clients.local      : customisable clients whitelist
+  postgrey_whitelist_recipients         : customisable recipients whitelist
+  postgrey_whitelist_recipients.default : default recipients whitelist (unused)
+
+If you are using postfix, you should add to your main.cf a line:
+  check_policy_service inet:127.0.0.1:60000
+in the smtpd_recipient_restrictions configuration (after 
+reject_unauth_destination and other rules) and reload postfix daemon.
+
+\n"
+}
+


Property changes on: trunk/dports/mail/postgrey/Portfile
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/dports/mail/postgrey/files/postgrey.conf
===================================================================
--- trunk/dports/mail/postgrey/files/postgrey.conf	                        (rev 0)
+++ trunk/dports/mail/postgrey/files/postgrey.conf	2007-07-30 19:30:34 UTC (rev 27351)
@@ -0,0 +1,11 @@
+# postgrey startup options, created for Macports
+
+# -=- POSTGREY_OPTS -=-
+# You can specify any startup options here
+# Refer to the postgrey(8) manpage for complete list
+POSTGREY_OPTS="--inet=127.0.0.1:60000"
+
+# -=- POSTGREY_TEXT -=-
+# You can specify the rejection message here
+#POSTGREY_TEXT="Your customized rejection message here"
+

Added: trunk/dports/mail/postgrey/files/postgrey.sh
===================================================================
--- trunk/dports/mail/postgrey/files/postgrey.sh	                        (rev 0)
+++ trunk/dports/mail/postgrey/files/postgrey.sh	2007-07-30 19:30:34 UTC (rev 27351)
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Postgrey darwinports startup script
+
+# default values
+POSTGREY_OPTS="--inet=127.0.0.1:60000"
+USER_OPTS="--user=postgrey --group=postgrey"
+PIDFILE=__PREFIX/var/run/postgrey/postgrey.pid
+
+# create empty .local files if they don't exist
+if [ ! -r __PREFIX/etc/postgrey/postgrey_whitelist_clients.local ]
+then
+    touch __PREFIX/etc/postgrey/postgrey_whitelist_clients.local
+fi
+if [ ! -r __PREFIX/etc/postgrey/postgrey_whitelist_recipients ]
+then
+    cp __PREFIX/etc/postgrey/postgrey_whitelist_recipients.default \
+    touch __PREFIX/etc/postgrey/postgrey_whitelist_recipients
+fi
+
+# Read config file if it exists
+if [ -r __PREFIX/etc/postgrey/postgrey.conf ]
+then
+    . __PREFIX/etc/postgrey/postgrey.conf
+fi
+
+POSTGREY_OPTS="--pidfile=$PIDFILE --daemonize $POSTGREY_OPTS $USER_OPTS $WL_CLIENTS $WL_RECIPIENTS"
+if [ -z "$POSTGREY_TEXT" ]; then
+    POSTGREY_TEXT_OPT=""
+else
+    POSTGREY_TEXT_OPT="--greylist-text=$POSTGREY_TEXT"
+fi
+
+# Start or stop
+case "$1" in
+
+start)
+  echo "starting postgrey"
+  unset PATH
+  cd /
+  __PREFIX/sbin/postgrey $POSTGREY_OPTS "$POSTGREY_TEXT_OPT"
+  ;;
+
+stop)
+  echo "stopping postgrey"
+  if [ -r $PIDFILE ]
+  then
+    kill `cat $PIDFILE` 2> /dev/null
+  else
+    pid=`ps ax | awk '{if ($5=="__PREFIX/sbin/postgrey") print $1}'`
+    /bin/kill $pid 2> /dev/null
+  fi
+  ;;
+restart)
+  $0 stop
+  $0 start
+  ;;
+esac
+

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070730/5cd96967/attachment.html


More information about the macports-changes mailing list