Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id E56BD7A2FB for ; Fri, 16 Dec 2016 15:56:06 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 8B331855A4; Fri, 16 Dec 2016 15:56:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1C29484CF5 for ; Fri, 16 Dec 2016 15:56:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id UVTTsjXGwXKT for ; Fri, 16 Dec 2016 15:56:05 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 66BBB84CBD for ; Fri, 16 Dec 2016 15:56:05 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 61D1EFBA6; Fri, 16 Dec 2016 15:56:05 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1481903765103930" MIME-Version: 1.0 Date: Fri, 16 Dec 2016 15:56:05 +0000 From: "Hans Rosenfeld" Subject: CVS commit: pkgsrc/mail/spamass-milter To: pkgsrc-changes@NetBSD.org Reply-To: hans@netbsd.org X-Mailer: log_accum Message-Id: <20161216155605.61D1EFBA6@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk This is a multi-part message in MIME format. --_----------=_1481903765103930 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: hans Date: Fri Dec 16 15:56:05 UTC 2016 Modified Files: pkgsrc/mail/spamass-milter: Makefile Added Files: pkgsrc/mail/spamass-milter/files/smf: manifest.xml spamass-milter.sh Log Message: Add SMF manifest and method. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 pkgsrc/mail/spamass-milter/Makefile cvs rdiff -u -r0 -r1.1 pkgsrc/mail/spamass-milter/files/smf/manifest.xml \ pkgsrc/mail/spamass-milter/files/smf/spamass-milter.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1481903765103930 Content-Disposition: inline Content-Length: 7322 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mail/spamass-milter/Makefile diff -u pkgsrc/mail/spamass-milter/Makefile:1.34 pkgsrc/mail/spamass-milter/Makefile:1.35 --- pkgsrc/mail/spamass-milter/Makefile:1.34 Wed Dec 7 00:36:24 2016 +++ pkgsrc/mail/spamass-milter/Makefile Fri Dec 16 15:56:05 2016 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.34 2016/12/07 00:36:24 wiedi Exp $ +# $NetBSD: Makefile,v 1.35 2016/12/16 15:56:05 hans Exp $ # DISTNAME= spamass-milter-0.4.0 +PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= http://savannah.nongnu.org/download/spamass-milt/ @@ -19,6 +20,7 @@ USE_LANGUAGES= c c++ CPPFLAGS.SunOS+= -Du_int8_t=uint8_t RCD_SCRIPTS= spamass-milter +SMF_METHODS= spamass-milter .include "../../mail/libmilter/buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" Added files: Index: pkgsrc/mail/spamass-milter/files/smf/manifest.xml diff -u /dev/null pkgsrc/mail/spamass-milter/files/smf/manifest.xml:1.1 --- /dev/null Fri Dec 16 15:56:05 2016 +++ pkgsrc/mail/spamass-milter/files/smf/manifest.xml Fri Dec 16 15:56:05 2016 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: pkgsrc/mail/spamass-milter/files/smf/spamass-milter.sh diff -u /dev/null pkgsrc/mail/spamass-milter/files/smf/spamass-milter.sh:1.1 --- /dev/null Fri Dec 16 15:56:05 2016 +++ pkgsrc/mail/spamass-milter/files/smf/spamass-milter.sh Fri Dec 16 15:56:05 2016 @@ -0,0 +1,86 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: spamass-milter.sh,v 1.1 2016/12/16 15:56:05 hans Exp $ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# Copyright 2016 Hans Rosenfeld +# + +# smf_method(5) start/stop script required for spamass-milter + +. /lib/svc/share/smf_include.sh + + +get_config () +{ + cmdopts="" + # spamc-flags must be last + properties="socket-path reject-code reject-text reject-threshold ignore-nets ignore-auth default-user lookup-users spamc-flags" + + for prop in $properties + do + value=`/usr/bin/svcprop -p options/${prop} ${SMF_FMRI}` + if [ -z "${value}" -o "${value}" = '""' ]; then + continue; + fi + + case $prop in + 'socket-path') + cmdopts="${cmdopts} -p ${value}" + ;; + 'reject-code') + cmdopts="${cmdopts} -C ${value}" + ;; + 'reject-text') + cmdopts="${cmdopts} -R ${value}" + ;; + 'reject-threshold') + if [ ${value} != "0" ]; then + cmdopts="${cmdopts} -r ${value}" + fi + ;; + 'ignore-nets') + cmdopts="${cmdopts} -i ${value}" + ;; + 'ignore-auth') + if [ ${value} = "true" ]; then + cmdopts="${cmdopts} -a" + fi + ;; + 'default-user') + cmdopts="${cmdopts} -u ${value}" + ;; + 'lookup-users') + if [ ${value} = "true" ]; then + cmdopts="${cmdopts} -x" + fi + ;; + 'spamc-flags') + value=`echo ${value} | sed -e 's/\\\\//g'` + cmdopts="${cmdopts} -- ${value}" + ;; + esac + done +} + +result=${SMF_EXIT_OK} + +# Set defaults; SMF_FMRI should have been set, but just in case. +if [ -z "$SMF_FMRI" ]; then + SMF_FMRI="svc:/@SMF_PREFIX@/@SMF_NAME@:${instance}" +fi + +get_config + +# Execute spamd with relevant command line options. +ppriv -s A-all -s A+basic,net_privaddr,file_dac_read,file_dac_search,sys_resource,proc_setid -e @PREFIX@/sbin/spamass-milter -f ${cmdopts} + +exit $? --_----------=_1481903765103930--