Friday, August 23, 2019

Move opensmptd filters to libexec/smtpd

Briefly discussed with gilles@.

I would like to move the filters to libexec/smtpd for two reasons.
1) filters are not commandline applications and I don't want them in my
$PATH.
2) opensmtpd-extras already used this location, so it's only consistent
to install there as well.

Diff below works for me and based on go.port.mk I don't see any other
way to change the install directory (except for changing go.port.mk)

OK?

martijn@

Index: opensmtpd-filter-rspamd/Makefile
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- opensmtpd-filter-rspamd/Makefile 13 Aug 2019 18:40:10 -0000 1.1.1.1
+++ opensmtpd-filter-rspamd/Makefile 24 Aug 2019 04:01:56 -0000
@@ -23,3 +23,7 @@ NO_TEST = Yes
ALL_TARGET = filter-rspamd

.include <bsd.port.mk>
+
+MODGO_INSTALL_TARGET = ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/smtpd && \
+ ${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/* \
+ ${PREFIX}/libexec/smtpd;
Index: opensmtpd-filter-rspamd/pkg/PLIST
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- opensmtpd-filter-rspamd/pkg/PLIST 13 Aug 2019 18:40:10 -0000 1.1.1.1
+++ opensmtpd-filter-rspamd/pkg/PLIST 24 Aug 2019 04:01:56 -0000
@@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/08/13 18:40:10 gilles Exp $
-@bin bin/filter-rspamd
+libexec/smtpd/
+@bin libexec/smtpd/filter-rspamd
share/doc/pkg-readmes/${PKGSTEM}
Index: opensmtpd-filter-rspamd/pkg/README
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- opensmtpd-filter-rspamd/pkg/README 13 Aug 2019 18:40:10 -0000 1.1.1.1
+++ opensmtpd-filter-rspamd/pkg/README 24 Aug 2019 04:01:56 -0000
@@ -8,7 +8,7 @@ To use filter-rspamd, you must declare i

Edit the /etc/mail/smtpd.conf file to declare the filter:

- filter "rspamd" proc-exec "${PREFIX}/bin/filter-rspamd"
+ filter "rspamd" proc-exec "${PREFIX}/libexec/smtpd/filter-rspamd"

Then add the filter to each listener that should be filtered:

Index: opensmtpd-filter-senderscore/Makefile
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- opensmtpd-filter-senderscore/Makefile 19 Aug 2019 21:21:17 -0000 1.1.1.1
+++ opensmtpd-filter-senderscore/Makefile 24 Aug 2019 04:01:56 -0000
@@ -23,3 +23,7 @@ NO_TEST = Yes
ALL_TARGET = filter-senderscore

.include <bsd.port.mk>
+
+MODGO_INSTALL_TARGET = ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/smtpd && \
+ ${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/* \
+ ${PREFIX}/libexec/smtpd;
Index: opensmtpd-filter-senderscore/pkg/PLIST
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- opensmtpd-filter-senderscore/pkg/PLIST 19 Aug 2019 21:21:17 -0000 1.1.1.1
+++ opensmtpd-filter-senderscore/pkg/PLIST 24 Aug 2019 04:01:56 -0000
@@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/08/19 21:21:17 gilles Exp $
-@bin bin/filter-senderscore
+libexec/smtpd/
+@bin libexec/smtpd/filter-senderscore
share/doc/pkg-readmes/${PKGSTEM}
Index: opensmtpd-filter-senderscore/pkg/README
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- opensmtpd-filter-senderscore/pkg/README 19 Aug 2019 21:21:17 -0000 1.1.1.1
+++ opensmtpd-filter-senderscore/pkg/README 24 Aug 2019 04:01:56 -0000
@@ -9,7 +9,7 @@ To use filter-senderscore, you must decl
Edit the /etc/mail/smtpd.conf file to declare the filter:

filter "senderscore" \
- proc-exec "${PREFIX}/bin/filter-senderscore [...]"
+ proc-exec "${PREFIX}/libexec/smtpd/filter-senderscore [...]"

The following options may be passed to filter-senderscore:

No comments:

Post a Comment