Add `-r' to mimedefang flags by default.

Add an example for filter_relay() that works out of the box.
Rename the mimedefang_daemon rc.d(8) script to mimedefang as it's
supposed to be...

ok okan@ (maintainer)
This commit is contained in:
ajacoutot 2012-12-05 18:51:56 +00:00
parent d5065f81aa
commit 818593cc5f
6 changed files with 34 additions and 23 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.28 2012/10/25 14:03:47 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.29 2012/12/05 18:51:56 ajacoutot Exp $
COMMENT= mailfilter to identify and mark spam
DISTNAME= mimedefang-2.73
REVISION= 5
REVISION= 6
CATEGORIES= mail
HOMEPAGE= http://www.mimedefang.org/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-examples_mimedefang-filter-openbsd-ports,v 1.3 2012/09/18 15:34:39 ajacoutot Exp $
--- examples/mimedefang-filter-openbsd-ports.orig Tue Sep 18 17:05:15 2012
+++ examples/mimedefang-filter-openbsd-ports Tue Sep 18 17:06:36 2012
$OpenBSD: patch-examples_mimedefang-filter-openbsd-ports,v 1.4 2012/12/05 18:51:56 ajacoutot Exp $
--- examples/mimedefang-filter-openbsd-ports.orig Wed Dec 5 12:02:27 2012
+++ examples/mimedefang-filter-openbsd-ports Wed Dec 5 12:03:24 2012
@@ -3,9 +3,6 @@
#
# mimedefang-filter
@ -85,7 +85,7 @@ $OpenBSD: patch-examples_mimedefang-filter-openbsd-ports,v 1.3 2012/09/18 15:34:
# Block message/partial parts
if (lc($type) eq "message/partial") {
@@ -316,6 +323,28 @@ sub filter_end {
@@ -316,7 +323,40 @@ sub filter_end {
# by marginal software. Your call.
# action_rebuild();
@ -112,5 +112,17 @@ $OpenBSD: patch-examples_mimedefang-filter-openbsd-ports,v 1.3 2012/09/18 15:34:
+# }
+# }
}
+
+# Uncomment to disable filtering mails sent from localhost
+# (mimedefang(8) must be stated with the `-r' flag).
+#sub filter_relay {
+# my ($ip, $name) = @_;
+# if ($ip eq '127.0.0.1') {
+# return ('ACCEPT_AND_NO_MORE_FILTERING', "ok");
+# }
+#
+# return ('CONTINUE', "ok");
+#}
# DO NOT delete the next line, or Perl will complain.
1;

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.10 2012/06/01 15:35:48 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.11 2012/12/05 18:51:56 ajacoutot Exp $
@newgroup _mdefang:570
@newuser _mdefang:570:_mdefang:daemon:MIMEDefang:/nonexistent:/sbin/nologin
@extraunexec rm -rf /var/spool/MIMEDefang/*
@ -42,5 +42,5 @@ share/examples/mimedefang/mail/sa-mimedefang.cf
@mode
@owner
@group
@rcscript ${RCDIR}/mimedefang_daemon
@rcscript ${RCDIR}/mimedefang
@rcscript ${RCDIR}/mimedefang_multiplexor

View File

@ -1,4 +1,4 @@
$OpenBSD: README,v 1.4 2012/06/01 15:35:48 ajacoutot Exp $
$OpenBSD: README,v 1.5 2012/12/05 18:51:56 ajacoutot Exp $
+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
@ -29,5 +29,4 @@ relays. The content of this file is generated using:
Start-up order
==============
Be sure to start mimedefang_multiplexor before mimedefang_daemon in
rc.local(8).
Be sure to start mimedefang_multiplexor before mimedefang in rc.local(8).

View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# $OpenBSD: mimedefang.rc,v 1.1 2012/12/05 18:51:56 ajacoutot Exp $
daemon="${TRUEPREFIX}/bin/mimedefang"
daemon_flags="-Gr -U _mdefang -P /var/spool/MIMEDefang/mimedefang.pid -p /var/spool/MIMEDefang/mimedefang.sock -m /var/spool/MIMEDefang/mimedefang-multiplexor.sock"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

View File

@ -1,12 +0,0 @@
#!/bin/sh
#
# $OpenBSD: mimedefang_daemon.rc,v 1.7 2012/09/18 15:34:39 ajacoutot Exp $
daemon="${TRUEPREFIX}/bin/mimedefang"
daemon_flags="-G -U _mdefang -P /var/spool/MIMEDefang/mimedefang.pid -p /var/spool/MIMEDefang/mimedefang.sock -m /var/spool/MIMEDefang/mimedefang-multiplexor.sock"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1