Skip to content

Commit

Permalink
milter-spamd is a sendmail milter plugin that passes mails through
Browse files Browse the repository at this point in the history
SpamAssassin's spamd, rejecting mails inline that are considered
spam. ok sturm@
  • Loading branch information
Daniel Hartmeier committed May 24, 2004
1 parent 05dd935 commit 287830e
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 2 deletions.
3 changes: 2 additions & 1 deletion infrastructure/db/user.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$OpenBSD: user.list,v 1.13 2004/05/13 06:52:12 grange Exp $
$OpenBSD: user.list,v 1.14 2004/05/24 07:35:47 dhartmei Exp $

This file lists all users and groups that are created by ports or that
users are encouraged to create after installing a port (these are marked
Expand Down Expand Up @@ -40,3 +40,4 @@ id user group port options
529 _ups sysutils/nut
530 _vscan _vscan mail/amavisd-new
531 _cnupm _cnupm net/cnupm
532 _milter-spamd _milter-spamd mail/milter-spamd
3 changes: 2 additions & 1 deletion mail/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.121 2004/04/24 16:15:05 peter Exp $
# $OpenBSD: Makefile,v 1.122 2004/05/24 07:35:47 dhartmei Exp $
# $FreeBSD: Makefile,v 1.51 1997/11/14 22:56:43 hoek Exp $
#

Expand Down Expand Up @@ -45,6 +45,7 @@
SUBDIR += mboxgrep
SUBDIR += metamail
SUBDIR += milter-regex
SUBDIR += milter-spamd
SUBDIR += mini_sendmail
SUBDIR += mixmaster
SUBDIR += movemail
Expand Down
32 changes: 32 additions & 0 deletions mail/milter-spamd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# $OpenBSD: Makefile,v 1.1 2004/05/24 07:35:47 dhartmei Exp $

.if !exists(/usr/lib/libmilter.a)
IGNORE="Fatal: milter required, see instructions in DESCR"
.endif

COMMENT= "sendmail milter plugin for SpamAssassin spamd"

DISTNAME= milter-spamd-0.3
CATEGORIES= mail
MASTER_SITES= http://www.benzedrine.cx/

HOMEPAGE= http://www.benzedrine.cx/milter-spamd.html

MAINTAINER= Daniel Hartmeier <[email protected]>

# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes

NO_REGRESS= Yes

do-configure:
@perl -pi -e 's,/etc/mi,${SYSCONFDIR}/mi,g' ${WRKSRC}/milter-spamd.{8,c}

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/milter-spamd ${PREFIX}/libexec
${INSTALL_MAN} ${WRKSRC}/milter-spamd.8 ${PREFIX}/man/man8

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions mail/milter-spamd/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MD5 (milter-spamd-0.3.tar.gz) = e2adc28256a92053d96c8915bcae1141
RMD160 (milter-spamd-0.3.tar.gz) = 1596ebcfb5f386bbc85197ccb21326194518ab2a
SHA1 (milter-spamd-0.3.tar.gz) = 2c18cd949f46c10f094241ee5f2d3b419104c6ce
22 changes: 22 additions & 0 deletions mail/milter-spamd/pkg/DEINSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2004/05/24 07:35:47 dhartmei Exp $
#
# milter-spamd de-installation

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DIR=/var/spool/milter-spamd
USER=_milter-spamd
GROUP=_milter-spamd

echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| these steps as root:"
echo "|"
echo "| userdel $USER"
echo "| groupdel $GROUP"
echo "| rm -rf $DIR"
echo "+---------------"
echo

exit 0
12 changes: 12 additions & 0 deletions mail/milter-spamd/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
milter-spamd is a sendmail milter plugin that passes mails through
SpamAssassin's spamd, rejecting mails inline that are considered
spam.

In order to build milter-spamd, sendmail needs to be compiled with
milter support, installing the libmilter library:

# cd /usr/src/gnu/usr.sbin/sendmail
# make clean cleandir
# [set the environment variable WANT_LIBMILTER to 1]
# make obj && make && make install

58 changes: 58 additions & 0 deletions mail/milter-spamd/pkg/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2004/05/24 07:35:47 dhartmei Exp $
#
# Pre/post-installation setup of milter-spamd

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DIR=/var/spool/milter-spamd
USER=_milter-spamd
GROUP=_milter-spamd
ID=532

do_usergroup_install()
{
# Create milter-spamd user and group
groupinfo -e $GROUP
if [ $? -eq 0 ]; then
echo "===> Using $GROUP group for milter-spamd"
else
echo "===> Creating $GROUP group for milter-spamd"
groupadd -g $ID $GROUP
fi
userinfo -e $USER
if [ $? -eq 0 ]; then
echo "===> Using $USER user for milter-spamd"
else
echo "===> Creating $USER user for milter-spamd"
useradd -g $GROUP -d /nonexistent -L daemon \
-c 'milter-spamd Account' -s /sbin/nologin \
-u $ID $USER 2>&1| grep nonexistant >&2
fi
}

do_install()
{
install -d -o $USER -g $GROUP -m 700 $DIR
}

if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi

case $2 in
PRE-INSTALL)
do_usergroup_install
if [ ! -d $DIR ]; then
do_install
fi
;;
POST-INSTALL)
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac

exit 0
16 changes: 16 additions & 0 deletions mail/milter-spamd/pkg/MESSAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
+---------------
| milter-spamd has been installed as ${PREFIX}/libexec/milter-spamd.
| See milter-spamd(8) for instructions on how to register the plugin.
|
| To start the plugin automatically on startup, one can use:
|
| /etc/rc.conf.local
| milter_spamd=""
|
| /etc/rc.local
| if [ X"${milter_spamd}" != X"NO" -a \
| -x ${PREFIX}/libexec/milter-spamd ]; then
| echo -n ' milter-spamd'
| ${PREFIX}/libexec/milter-spamd ${milter_spamd}
| fi
+---------------
3 changes: 3 additions & 0 deletions mail/milter-spamd/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1 2004/05/24 07:35:47 dhartmei Exp $
libexec/milter-spamd
man/man8/milter-spamd.8

0 comments on commit 287830e

Please sign in to comment.