From 6380f83b6aa3cdb85211e79686d719943661ca92 Mon Sep 17 00:00:00 2001 From: Pacho Ramos Date: Sat, 3 Oct 2015 14:24:59 +0200 Subject: mail-filter/postfwd: Install systemd unit file (#528034 by Stefan G. Weichinger) Package-Manager: portage-2.2.22 --- mail-filter/postfwd/files/postfwd.service | 11 ++++ mail-filter/postfwd/postfwd-1.35-r3.ebuild | 88 ++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 mail-filter/postfwd/files/postfwd.service create mode 100644 mail-filter/postfwd/postfwd-1.35-r3.ebuild (limited to 'mail-filter') diff --git a/mail-filter/postfwd/files/postfwd.service b/mail-filter/postfwd/files/postfwd.service new file mode 100644 index 000000000000..376e8d2da320 --- /dev/null +++ b/mail-filter/postfwd/files/postfwd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Postfix firewall daemon + +[Service] +Type=forking +ExecStart=/usr/sbin/postfwd2 --shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 --daemon --file=/etc/postfwd/postfwd.cf --interface=127.0.0.1 --port=10040 --pidfile=/var/run/postfwd.pid --user=postfwd --group=postfwd +ExecStop=/usr/sbin/postfwd2 --file=/etc/postfwd/postfwd.cf --pidfile=/var/run/postfwd.pid --kill +ExecReload=/usr/sbin/postfwd2 --file=/etc/postfwd/postfwd.cf --pidfile=/var/run/postfwd.pid --reload + +[Install] +WantedBy=multi-user.target diff --git a/mail-filter/postfwd/postfwd-1.35-r3.ebuild b/mail-filter/postfwd/postfwd-1.35-r3.ebuild new file mode 100644 index 000000000000..a35f89058fe8 --- /dev/null +++ b/mail-filter/postfwd/postfwd-1.35-r3.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils user systemd + +DESCRIPTION="Versatile Postfix policy server with a flexible ruleset based configuration" +HOMEPAGE="http://www.postfwd.org/" +SRC_URI="http://www.postfwd.org/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+tools" + +DEPEND="" +RDEPEND=">=dev-lang/perl-5.16.3 + virtual/perl-Sys-Syslog + dev-perl/Net-DNS + dev-perl/net-server +" + +pkg_setup() { + enewgroup postfwd + enewuser postfwd -1 -1 -1 postfwd +} + +src_install() { + local BIN="postfwd2" + # programs and tools + dosbin "${S}"/sbin/${BIN} + + # man pages and documentation + doman "${S}"/man/man8/${BIN}.8 + dodoc "${S}"/doc/{${BIN}.CHANGELOG,${BIN}.txt} + + # example configuration(s) + insinto /usr/share/doc/${PF}/examples + newins "${S}"/etc/${PN}.cf.sample ${PN}.cf.dist + + # plugins + dodoc -r "${S}"/plugins + + # tools + if use tools; then + dodoc -r "${S}"/tools + fi + + # start scripts script and respective configuration file + newinitd "${FILESDIR}"/${PN}.init ${PN} + newconfd "${FILESDIR}"/${PN}.conf ${PN} + systemd_dounit "${FILESDIR}"/${PN}.service +} + +pkg_postinst() { + einfo + einfo "${PN} has no default configuration for safety reasons. Every" + einfo "mail system is different, so you should craft a set of rules" + einfo "that is suitable for your environment and save it to:" + einfo " /etc/postfix/postfwd.cf" + einfo "You can find example configurations in:" + einfo " /usr/share/doc/${PF}/examples" + einfo + einfo "If you want ${PN} to start on system boot, you have to add it your" + einfo "default run level:" + einfo " # rc-update add postfwd default" + einfo "Also remember to edit /etc/conf.d/${PN} to your liking." + einfo + einfo "A plugins sampe folder has been placed under:" + einfo + einfo " /usr/share/doc/${PF}/plugins" + + if use tools; then + einfo + einfo "You can find additional tools for testing ${PN} in:" + einfo " /usr/share/doc/${PF}/tools" + fi + + ewarn + ewarn "Please read the documentation carefully and properly test new" + ewarn "rulesets before putting them into production use. Otherwise you" + ewarn "risk accidental mail loss or worse." + ewarn + ewarn "Visit http://www.postfwd.org/ for more information." + ewarn +} -- cgit v1.2.3-65-gdbad