From owner-svn-ports-all@freebsd.org Tue Apr 3 16:52:58 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A9BF6DF7B; Tue, 3 Apr 2018 16:52:58 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D89FB87048; Tue, 3 Apr 2018 16:52:57 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B95AA27333; Tue, 3 Apr 2018 16:52:57 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33GqvWh027913; Tue, 3 Apr 2018 16:52:57 GMT (envelope-from mandree@FreeBSD.org) Received: (from mandree@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33GqvY5027900; Tue, 3 Apr 2018 16:52:57 GMT (envelope-from mandree@FreeBSD.org) Message-Id: <201804031652.w33GqvY5027900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mandree set sender to mandree@FreeBSD.org using -f From: Matthias Andree Date: Tue, 3 Apr 2018 16:52:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r466364 - in head/mail: . ratelimit-policyd ratelimit-policyd/files X-SVN-Group: ports-head X-SVN-Commit-Author: mandree X-SVN-Commit-Paths: in head/mail: . ratelimit-policyd ratelimit-policyd/files X-SVN-Commit-Revision: 466364 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 16:52:58 -0000 Author: mandree Date: Tue Apr 3 16:52:56 2018 New Revision: 466364 URL: https://svnweb.freebsd.org/changeset/ports/466364 Log: Add new port mail/ratelimit-policyd. This rearranges a few things in the Makefile, such as reordering of USES= and USE... options, and uses PORTDOCS for README.md. I have also revised pkg-message.in and pkg-descr for grammar and consistency (trailing colons) and added a "postfix reload" line. PR: 226795 Submitted by: Miroslav Lachman Added: head/mail/ratelimit-policyd/ head/mail/ratelimit-policyd/Makefile (contents, props changed) head/mail/ratelimit-policyd/distinfo (contents, props changed) head/mail/ratelimit-policyd/files/ head/mail/ratelimit-policyd/files/pkg-message.in (contents, props changed) head/mail/ratelimit-policyd/pkg-descr (contents, props changed) Modified: head/mail/Makefile Modified: head/mail/Makefile ============================================================================== --- head/mail/Makefile Tue Apr 3 16:19:16 2018 (r466363) +++ head/mail/Makefile Tue Apr 3 16:52:56 2018 (r466364) @@ -584,6 +584,7 @@ SUBDIR += queue-repair SUBDIR += rainloop SUBDIR += rainloop-community + SUBDIR += ratelimit-policyd SUBDIR += raysfilter SUBDIR += razor-agents SUBDIR += rbl-milter Added: head/mail/ratelimit-policyd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/ratelimit-policyd/Makefile Tue Apr 3 16:52:56 2018 (r466364) @@ -0,0 +1,63 @@ +# Created by: Miroslav Lachman +# $FreeBSD$ + +PORTNAME= ratelimit-policyd +PORTVERSION= 1.0.1 +CATEGORIES= mail +MASTER_SITES= GH + +MAINTAINER= 000.fbsd@quip.cz +COMMENT= Sender rate limit policy daemon for Postfix + +LICENSE= NONE + +USES+= perl5 shebangfix + +USE_GITHUB= yes +GH_ACCOUNT= MirLach +GH_PROJECT= ratelimit-policyd +#GH_TAGNAME= 65154a2 + +RUN_DEPENDS+= p5-DBD-mysql>=0:databases/p5-DBD-mysql + +SHEBANG_FILES= ratelimit-policyd.pl + +NO_BUILD= yes + +SUB_FILES= pkg-message + +PERIODIC_DAILY= etc/periodic/daily + +PLIST_FILES= bin/ratelimit-policyd.pl \ + etc/rc.d/ratelimit-policyd \ + etc/ratelimit-policyd.cfg.sample \ + ${PERIODIC_DAILY}/535.ratelimit-policyd + +PORTDATA= mysql-schema.sql +PORTDOCS= README.md + +post-patch: + ${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/rc.d/ratelimit-policyd + ${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/ratelimit-policyd.pl + ${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" \ + ${WRKSRC}/periodic/daily/535.ratelimit-policyd + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/ratelimit-policyd.pl ${STAGEDIR}${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/ratelimit-policyd ${STAGEDIR}${PREFIX}/etc/rc.d + ${INSTALL_DATA} ${WRKSRC}/ratelimit-policyd.cfg \ + ${STAGEDIR}${PREFIX}/etc/ratelimit-policyd.cfg.sample + + @${MKDIR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/mysql-schema.sql ${STAGEDIR}${DATADIR} + + @${MKDIR} ${STAGEDIR}${DOCSDIR} +.for i in ${PORTDOCS} + ${INSTALL_MAN} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/ +.endfor + + @${MKDIR} ${STAGEDIR}${PREFIX}/${PERIODIC_DAILY} + ${INSTALL_SCRIPT} ${WRKSRC}/periodic/daily/535.ratelimit-policyd \ + ${STAGEDIR}${PREFIX}/${PERIODIC_DAILY} + +.include Added: head/mail/ratelimit-policyd/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/ratelimit-policyd/distinfo Tue Apr 3 16:52:56 2018 (r466364) @@ -0,0 +1,3 @@ +TIMESTAMP = 1522007262 +SHA256 (MirLach-ratelimit-policyd-1.0.1_GH0.tar.gz) = 14a3785dff86b0cf58e57220f79551ba159ee184bbb21f462c019675675d775b +SIZE (MirLach-ratelimit-policyd-1.0.1_GH0.tar.gz) = 11218 Added: head/mail/ratelimit-policyd/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/ratelimit-policyd/files/pkg-message.in Tue Apr 3 16:52:56 2018 (r466364) @@ -0,0 +1,37 @@ +This package must be integrated with Postfix to be effective: + + * Add a new MySQL user account for ratelimit-policyd with the + following permissions: + + GRANT USAGE ON *.* TO 'policyd'@'localhost' IDENTIFIED BY ''; + GRANT SELECT, INSERT, UPDATE, DELETE ON `policyd`.* TO 'policyd'@'localhost'; + + * Create a database 'policyd' and a table 'ratelimit': + + mysql -u root -p < %%LOCALBASE%%/share/ratelimit-policyd/mysql-schema.sql + + * Edit the configuration in %%LOCALBASE%%/etc/ratelimit-policyd.cfg + + * Enable the ratelimit-policyd service in rc.conf: + + sysrc ratelimit_policyd_enable="YES" + + * Start the service: + + service ratelimit-policyd start + + * Add or modify the postfix data restriction class + 'smtpd_sender_restrictions' in main.cf: + + smtpd_sender_restrictions = + check_sender_access mysql:%%LOCALBASE%%/etc/postfix/clients.cf, + check_policy_service inet:127.0.0.1:10032 + + check_policy_service must be after check_sender_access (if you are using it) + + * Reload Postfix: + + postfix reload + + * See the documentation in %%LOCALBASE%%/share/ratelimit-policyd/README.md + or visit https://github.com/MirLach/ratelimit-policyd Added: head/mail/ratelimit-policyd/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/ratelimit-policyd/pkg-descr Tue Apr 3 16:52:56 2018 (r466364) @@ -0,0 +1,4 @@ +A sender rate limit policy daemon for Postfix written in Perl. +Customised to work with a modern Perl version on FreeBSD. + +WWW: https://github.com/MirLach/ratelimit-policyd