Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 2014 15:10:01 GMT
From:      Keith Gaughan <k@stereochro.me>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/188319: Update: mail/greyfix to 0.4.0
Message-ID:  <201404261510.s3QFA1NN030803@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/188319; it has been noted by GNATS.

From: Keith Gaughan <k@stereochro.me>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/188319: Update: mail/greyfix to 0.4.0
Date: Sat, 26 Apr 2014 16:00:00 +0100

 --IpbVkmxF4tDyP/Kb
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Further improvements. I've created a basic man page, which I intend on
 submitting upstream, and have fixed an issue with the database directory
 caused by permissions not being preserved when the package is built.
 
 --IpbVkmxF4tDyP/Kb
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="greyfix.diff"
 
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 352220)
 +++ Makefile	(working copy)
 @@ -2,9 +2,10 @@
  # $FreeBSD$
  
  PORTNAME=	greyfix
 -PORTVERSION=	0.3.9
 +PORTVERSION=	0.4.0
  CATEGORIES=	mail
 -MASTER_SITES=	http://www.kim-minh.com/pub/greyfix/
 +MASTER_SITES=	http://www.kim-minh.com/pub/greyfix/ \
 +		http://stereochro.me/distfiles/
  
  MAINTAINER=	k@stereochro.me
  COMMENT=	A greylisting policy daemon for Postfix
 @@ -11,19 +12,20 @@
  
  SUB_FILES=	pkg-message
  
 -USE_BDB=	yes
 +USE_BDB=	5+
  GNU_CONFIGURE=	yes
 -CONFIGURE_ARGS=	--with-berkeleydb-libdir=${BDB_LIB_DIR} \
 +CONFIGURE_ARGS+=--with-berkeleydb-libdir=${BDB_LIB_DIR} \
  		--with-berkeleydb-includedir=${BDB_INCLUDE_DIR} \
  		--localstatedir=/var
  
 +PLIST_SUB=	GREYFIXDBDIR=/var/db/${PORTNAME}
 +
  post-patch:
  	@${REINPLACE_CMD} 's|-ldb|-l${BDB_LIB_NAME}|g' ${WRKSRC}/configure
  	@${REINPLACE_CMD} 's|$$(localstatedir)/lib|$$(localstatedir)/db|' \
  		${WRKSRC}/Makefile.in
  
 -do-install:
 -	${INSTALL_PROGRAM} ${WRKSRC}/greyfix ${STAGEDIR}${PREFIX}/sbin
 -	${INSTALL} -o nobody -m 700 -d ${STAGEDIR}/var/db/greyfix
 +post-install:
 +	${INSTALL_MAN} ${FILESDIR}/greyfix.8 ${STAGEDIR}${MAN1PREFIX}/man/man8/
  
  .include <bsd.port.mk>
 Index: distinfo
 ===================================================================
 --- distinfo	(revision 352220)
 +++ distinfo	(working copy)
 @@ -1,2 +1,2 @@
 -SHA256 (greyfix-0.3.9.tar.gz) = dee4428aef9b248b68799a640a85b44ffee0e9a3b2d2f16eed1bb41edad5f204
 -SIZE (greyfix-0.3.9.tar.gz) = 79883
 +SHA256 (greyfix-0.4.0.tar.gz) = 26013edce3a38d586282bfc22eb91bd22df54e3558ea1b3dae54d3e7a769e4fe
 +SIZE (greyfix-0.4.0.tar.gz) = 98051
 Index: files/greyfix.8
 ===================================================================
 --- files/greyfix.8	(revision 0)
 +++ files/greyfix.8	(working copy)
 @@ -0,0 +1,137 @@
 +.Dd April 26, 2014
 +.Dt GREYFIX 8
 +.Os
 +.Sh NAME
 +.Nm greyfix
 +.Nd "A greylisting policy daemon for Postfix"
 +.Sh SYNOPSIS
 +.Nm
 +.Op Fl Vvd
 +.Op Fl h Ar home_directory
 +.Op Fl g Ar delay_period
 +.Op Fl b Ar bloc_idle_period
 +.Op Fl p Ar pass_period
 +.Op Fl r Ar reject_action
 +.Op Fl G Ar greylist_action
 +.Op Fl / Ar prefix_size
 +.Op Fl 6 Ar prefix_size
 +.Op Fl -dump-triplets
 +.Op Fl -help
 +.Sh DESCRIPTION
 +.Nm
 +is a efficient greylisting policy daemon for Postfix.
 +.Pp
 +The options are:
 +.Bl -tag -width indent
 +.It Fl V , Fl -version
 +Show version information.
 +.It Fl v , Fl -verbose
 +Verbose logging.
 +.It Fl d , Fl -debug
 +Debug logging.
 +.It Fl -help
 +Show usage information.
 +.It Fl -dump-triplets
 +Dump the triplets database to stdout. Mostly for debugging purposes.
 +.It Fl b Ar seconds , Fl -bloc-max-idle Ar seconds
 +How many seconds of life are given to a record that is created from a new mail
 +.Em ( ip , from , to )
 +triplet. Note that the window created by this setting for passing mails is
 +reduced by the amount set for
 +.Fl -greylist-delay .
 +Also see
 +.Fl -pass-max-idle .
 +Defaults to 18000.
 +.It Fl g Ar seconds , Fl -greylist-delay Ar seconds
 +How many seconds we will block inbound mail that is from a previously unknown
 +.Em ( ip , from , to )
 +triplet. If it is set to zero, incoming mail association will be learned, but
 +no deliveries will be tempfailed. Use a setting of zero with caution, as it
 +will learn spammers as well as legitimate senders. Defaults to 3480.
 +.It Fl h Ar home_directory , Fl -home Ar home_directory
 +Location of the Berkeley DB environment home location. Defaults to
 +.Pa /var/db/greyfix .
 +.It Fl p Ar seconds , Fl -pass-max-idle Ar seconds
 +How long to give to a record we are updating from an allowed (passed) email.
 +.Pp
 +The default is 3110400, which should be enough to handle messages that may only
 +be sent once a month, or on things like the first monday of the month (which
 +sometimes means 5 weeks). Plus, we add a day for a delivery buffer.
 +.It Fl r Ar action , Fl -reject-action Ar action
 +The reject action directive that will be used.  See
 +.Xr access 5
 +for valid actions. The placeholder
 +.Em %d
 +expand to the number of seconds,
 +.Em %p
 +to the empty string if
 +.Em %d
 +expands to 1 or
 +.Dq s
 +otherwise,
 +.Em %s
 +to a single space, and
 +.Em %%
 +to
 +.Dq % .
 +.Pp
 +The default is
 +.Dq DEFER_IF_PERMIT Greylisted by greyfix 0.4.0, try again in %d second%p. See http://www.kim-minh.com/pub/greyfix/ for more information.
 +.It Fl G Ar action , Fl -greylisted-action Ar action
 +The action that will be used the first time a triplet passes greylisting. Same
 +expansion as for
 +.Fl -reject-action .
 +.Pp
 +The default is
 +.Dq PREPEND X-Greyfix: Greylisted by greyfix 0.4.0 for %d second%p. See http://www.kim-minh.com/pub/greyfix/ for more information.
 +.It Fl / Ar prefix_size , Fl -network-prefix Ar prefix_size
 +Only consider the first
 +.Ar prefix_size
 +bits of an IPv4 address. Defaults to 32, i.e., the whole address is
 +significant.
 +.It Fl 6 Ar prefix_size , Fl -network6-prefix Ar prefix_size
 +Only consider the first
 +.Ar prefix_size
 +bits of an IPv6 address. Defaults to 128, i.e., the whole address is
 +significant.
 +.El
 +.Sh USAGE
 +Edit Postfix's master configuration file,
 +.Pa /usr/local/etc/postfix/master.cf ,
 +and add the following:
 +.Bd -literal
 +greyfix    unix  -       n       n       -       -       spawn
 +  user=nobody argv=/usr/local/sbin/greyfix -/ 24 -6 56
 +.Ed
 +.Pp
 +Edit Postfix's main configuration file,
 +.Pa /etc/postfix/main.cf ,
 +and add the following:
 +.Bd -literal
 +smtpd_recipient_restrictions =
 +  permit_mynetworks,
 +  reject_unauth_destination,
 +  check_policy_service unix:private/greyfix
 +.Ed
 +.Pp
 +If there is already an
 +.Em smtpd_recipient_restrictions
 +configuration line, you should edit it rather than add a new one. The
 +important part for Greyfix is that you should add
 +.Em check_policy_service unix:private/greyfix
 +to it. Finally, have Postfix reload its configuration with
 +.Ic "postfix reload" .
 +.Sh NOTES
 +.Ss Logs
 +Greyfix logs to
 +.Xr syslog 3
 +with the
 +.Li LOG_MAIL
 +facility. As such, the log messages should appear along Postfix's.
 +.Sh ALSO SEE
 +.Xr access 5
 +.Sh AUTHORS
 +.Nm
 +was written by
 +.An Kim Minh Kaplan
 +.Aq http://www.kim-minh.com/ .
 
 Property changes on: files/greyfix.8
 ___________________________________________________________________
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Index: files/patch-sockets
 ===================================================================
 --- files/patch-sockets	(revision 0)
 +++ files/patch-sockets	(working copy)
 @@ -0,0 +1,11 @@
 +--- greyfix.c.orig        2014-04-06 16:23:26.000000000 +0100
 ++++ greyfix.c      2014-04-06 16:23:37.000000000 +0100
 +@@ -26,6 +26,8 @@
 + #include <syslog.h>
 + #include <sys/stat.h>
 + #include <arpa/inet.h>
 ++#include <netinet/in.h>
 ++#include <sys/socket.h>
 + 
 + #include <db.h>
 +
 
 Property changes on: files/patch-sockets
 ___________________________________________________________________
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 Index: pkg-plist
 ===================================================================
 --- pkg-plist	(revision 352220)
 +++ pkg-plist	(working copy)
 @@ -1,4 +1,4 @@
 -@exec mkdir -m 700 -p /var/db/greyfix && chown nobody /var/db/greyfix
 +man/man8/greyfix.8.gz
  sbin/greyfix
 -@cwd /
 -@dirrmtry /var/db/greyfix
 +@exec install -d -o nobody -g mail -m 770 %%GREYFIXDBDIR%%
 +@dirrmtry %%GREYFIXDBDIR%%
 
 --IpbVkmxF4tDyP/Kb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404261510.s3QFA1NN030803>