diff options
author | gdt <gdt@pkgsrc.org> | 2014-12-01 13:58:15 +0000 |
---|---|---|
committer | gdt <gdt@pkgsrc.org> | 2014-12-01 13:58:15 +0000 |
commit | 9ae259b9f6935cbd4e7b411d170d14ff8420ceb2 (patch) | |
tree | d18ff8447fba44cf2bac39f719ced1600281972b /mail/mopher | |
parent | 8dce29b1d7f3159dcc611fde4c4b8c31428931aa (diff) | |
download | pkgsrc-9ae259b9f6935cbd4e7b411d170d14ff8420ceb2.tar.gz |
Import mopher-0.5.1 as mail/mopher.
Packaged in wip by Petar Bogdanovic.
The mail gopher (mopher) is an extension to all mail transfer agents
that implement the Sendmail Milter API. It reads a list of rules and
acts on each incoming mail delivery attempt based on various criteria
and existing states.
Mopher supports indiscriminate and selective grey- and whitelisting of
either individual addresses or whole domains (based on reverse lookups
and rules provided by Mozilla's Public Suffix List). Access to tables
and state-related data passes through a generic interface and is then
translated by one of the available backend drivers.
Diffstat (limited to 'mail/mopher')
-rw-r--r-- | mail/mopher/DESCR | 10 | ||||
-rw-r--r-- | mail/mopher/Makefile | 70 | ||||
-rw-r--r-- | mail/mopher/PLIST | 24 | ||||
-rw-r--r-- | mail/mopher/distinfo | 5 | ||||
-rw-r--r-- | mail/mopher/files/mopherd.acl | 7 | ||||
-rw-r--r-- | mail/mopher/files/mopherd.conf | 35 | ||||
-rw-r--r-- | mail/mopher/files/mopherd.sh | 25 | ||||
-rw-r--r-- | mail/mopher/options.mk | 32 |
8 files changed, 208 insertions, 0 deletions
diff --git a/mail/mopher/DESCR b/mail/mopher/DESCR new file mode 100644 index 00000000000..eea1ec6efe4 --- /dev/null +++ b/mail/mopher/DESCR @@ -0,0 +1,10 @@ +The mail gopher (mopher) is an extension to all mail transfer agents +that implement the Sendmail Milter API. It reads a list of rules and +acts on each incoming mail delivery attempt based on various criteria +and existing states. + +Mopher supports indiscriminate and selective grey- and whitelisting of +either individual addresses or whole domains (based on reverse lookups +and rules provided by Mozilla's Public Suffix List). Access to tables +and state-related data passes through a generic interface and is then +translated by one of the available backend drivers. diff --git a/mail/mopher/Makefile b/mail/mopher/Makefile new file mode 100644 index 00000000000..5a3b342a24e --- /dev/null +++ b/mail/mopher/Makefile @@ -0,0 +1,70 @@ +# $NetBSD: Makefile,v 1.1 2014/12/01 13:58:15 gdt Exp $ + +DISTNAME= mopher-0.5.1 +CATEGORIES= mail +MASTER_SITES= http://mopher.org/download/ + +OWNER= petar@smokva.net +HOMEPAGE= http://mopher.org/ +COMMENT= Versatile mail filter +LICENSE= mit + +.include "../../mk/bsd.prefs.mk" + +MOPHER_USER?= mopher +MOPHER_GROUP?= ${MOPHER_USER} +MOPHER_HOME?= ${VARBASE}/mopher +MOPHER_RUN?= ${VARBASE}/run/mopher + +FILES_SUBST+= MOPHER_USER=${MOPHER_USER} +FILES_SUBST+= MOPHER_GROUP=${MOPHER_GROUP} +FILES_SUBST+= MOPHER_HOME=${MOPHER_HOME} +FILES_SUBST+= MOPHER_RUN=${MOPHER_RUN} +FILES_SUBST+= INSTALL=${INSTALL} + +USE_LANGUAGES= c +HAS_CONFIGURE= yes +CONFIGURE_ARGS+= --prefix=${PREFIX} +CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} +CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR} +CONFIGURE_ARGS+= --localstatedir=${VARBASE} + +.include "options.mk" + +BUILD_DEFS+= PKG_SYSCONFBASE VARBASE +BUILD_TARGET= build + +PKG_SYSCONFSUBDIR= mopher +INSTALLATION_DIRS+= ${EGDIR} +EGDIR= ${PREFIX}/share/examples/mopher +CONF_FILES+= ${EGDIR}/mopherd.conf +CONF_FILES+= ${PKG_SYSCONFDIR}/mopherd.conf +CONF_FILES+= ${EGDIR}/mopherd.acl +CONF_FILES+= ${PKG_SYSCONFDIR}/mopherd.acl +CONF_FILES+= ${EGDIR}/effective_tld_names.dat +CONF_FILES+= ${PKG_SYSCONFDIR}/effective_tld_names.dat +MAKE_ENV+= CONFIG_XPATH=${EGDIR} + +PKG_GROUPS= ${MOPHER_GROUP} +PKG_USERS= ${MOPHER_USER}:${MOPHER_GROUP} +OWN_DIRS_PERMS+= ${MOPHER_HOME} ${MOPHER_USER} ${MOPHER_GROUP} 2755 +RCD_SCRIPTS+= mopherd + +# FIXME: sent upstream; remove this on next upgrade +SUBST_CLASSES+= conf +SUBST_STAGE.conf= pre-configure +SUBST_MESSAGE.conf= Adding custom mopherd.conf +SUBST_FILES.conf= config/Makefile.in +SUBST_SED.conf= -e 's,mopherd.acl$$,& mopherd.conf,' + +# FIXME: sent upstream; remove this on next upgrade +pre-build: + ${SED} ${FILES_SUBST_SED} ${FILESDIR}/mopherd.conf \ + >${WRKSRC}/config/mopherd.conf + ${SED} ${FILES_SUBST_SED} ${FILESDIR}/mopherd.acl \ + >${WRKSRC}/config/mopherd.acl + +.include "../../mail/libmilter/buildlink3.mk" +.include "../../devel/libidn/buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/mail/mopher/PLIST b/mail/mopher/PLIST new file mode 100644 index 00000000000..0b22e18ec75 --- /dev/null +++ b/mail/mopher/PLIST @@ -0,0 +1,24 @@ +@comment $NetBSD: PLIST,v 1.1 2014/12/01 13:58:15 gdt Exp $ +${PLIST.mysql}lib/mopher/sakila.so +${PLIST.spf}lib/mopher/spf.so +lib/mopher/bdb.so +lib/mopher/cast.so +lib/mopher/counter.so +lib/mopher/dblog.so +lib/mopher/dnsbl.so +lib/mopher/memdb.so +lib/mopher/random.so +lib/mopher/spamd.so +lib/mopher/string.so +man/man5/mopherd.acl.5 +man/man5/mopherd.conf.5 +man/man7/mopher.7 +man/man8/mopherctl.8 +man/man8/mopherd.8 +sbin/mopherctl +sbin/mopherd +share/examples/mopher/effective_tld_names.dat +share/examples/mopher/mopherd.acl +share/examples/mopher/mopherd.acl.example +share/examples/mopher/mopherd.conf +share/examples/mopher/mopherd.conf.example diff --git a/mail/mopher/distinfo b/mail/mopher/distinfo new file mode 100644 index 00000000000..412ffcb91b9 --- /dev/null +++ b/mail/mopher/distinfo @@ -0,0 +1,5 @@ +$NetBSD: distinfo,v 1.1 2014/12/01 13:58:15 gdt Exp $ + +SHA1 (mopher-0.5.1.tar.gz) = 26b60fd04c8a2b40557555f8a60bd1b91f185491 +RMD160 (mopher-0.5.1.tar.gz) = 40eae10656a45b719bebb2de696fe087839f75b0 +Size (mopher-0.5.1.tar.gz) = 192071 bytes diff --git a/mail/mopher/files/mopherd.acl b/mail/mopher/files/mopherd.acl new file mode 100644 index 00000000000..4093250de93 --- /dev/null +++ b/mail/mopher/files/mopherd.acl @@ -0,0 +1,7 @@ +# $NetBSD: mopherd.acl,v 1.1 2014/12/01 13:58:15 gdt Exp $ +# +# minimal mopherd.acl(5) for pkgsrc +# +# Greylist unknown senders for 5 minutes or 3 retries. + +envrcpt counter_penpal == null greylist delay 5m attempts 3 deadline 2h visa 7d diff --git a/mail/mopher/files/mopherd.conf b/mail/mopher/files/mopherd.conf new file mode 100644 index 00000000000..1ac8a1f30e6 --- /dev/null +++ b/mail/mopher/files/mopherd.conf @@ -0,0 +1,35 @@ +# $NetBSD: mopherd.conf,v 1.1 2014/12/01 13:58:15 gdt Exp $ +# +# minimal mopherd.conf(5) for pkgsrc +# +# Your mailer-daemon needs to know about milter_socket. + +workdir_path = "@MOPHER_HOME@" +mopherd_user = "@MOPHER_USER@" +mopherd_group = "@MOPHER_GROUP@" +control_socket = "unix:@MOPHER_HOME@/mopherd-c.sock" +milter_socket = "unix:@MOPHER_HOME@/mopherd-m.sock" + +table[state] = +{ + driver = "bdb", + path = "state.db" +} + +table[greylist] = +{ + driver = "bdb", + path = "greylist.db" +} + +table[counter_relay] = +{ + driver = "bdb", + path = "relay.db" +} + +table[counter_penpal] = +{ + driver = "bdb", + path = "penpal.db" +} diff --git a/mail/mopher/files/mopherd.sh b/mail/mopher/files/mopherd.sh new file mode 100644 index 00000000000..a6241b46175 --- /dev/null +++ b/mail/mopher/files/mopherd.sh @@ -0,0 +1,25 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: mopherd.sh,v 1.1 2014/12/01 13:58:15 gdt Exp $ +# +# PROVIDE: mopherd +# REQUIRE: DAEMON +# BEFORE: mail +# KEYWORD: shutdown + +$_rc_subr_loaded . /etc/rc.subr + +name=mopherd +rcvar=mopherd +pidfile=@MOPHER_RUN@/mopherd.pid +start_precmd=mopherd_precmd +command=@PREFIX@/sbin/mopherd +command_args="-p $pidfile" + +mopherd_precmd() +{ + @INSTALL@ -d -o @MOPHER_USER@ -g @MOPHER_GROUP@ @MOPHER_RUN@ +} + +load_rc_config mopherd +run_rc_command "$1" diff --git a/mail/mopher/options.mk b/mail/mopher/options.mk new file mode 100644 index 00000000000..009ab3c6881 --- /dev/null +++ b/mail/mopher/options.mk @@ -0,0 +1,32 @@ +# $NetBSD: options.mk,v 1.1 2014/12/01 13:58:15 gdt Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.mopher +PKG_SUPPORTED_OPTIONS= mysql spf +PKG_SUGGESTED_OPTIONS= spf + +.include "../../mk/bsd.options.mk" + +PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS} + +# The use of db method is selected by config file; multiple methods +# can be compiled as modules. Non-optional modules are memdb (a memory +# hash-table; not persistent) and bdb, which either uses dbopen(3) from +# libc or the legacy Berkeley DB API from one of the db packages. + +# mysql +.if !empty(PKG_OPTIONS:Mmysql) +CONFIGURE_ARGS+= --with-mysql +PLIST.mysql= yes +.include "../../mk/mysql.buildlink3.mk" +.else +CONFIGURE_ARGS+= --without-mysql +.endif + +# spf +.if !empty(PKG_OPTIONS:Mspf) +CONFIGURE_ARGS+= --with-spf2 +PLIST.spf= yes +.include "../../mail/libspf2/buildlink3.mk" +.else +CONFIGURE_ARGS+= --without-spf2 +.endif |