aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/rmilter
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.dk>2017-10-23 22:06:25 +0200
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-10-27 12:43:47 +0000
commit8395bdf62e93ad5ff2aa0e327c726cac43ca6a01 (patch)
tree7e7c2c7110ef3a534da10e2cb1519c566fa21a21 /unmaintained/rmilter
parent8db25d5fa1aaafe794536ed073f8c6b938c8147f (diff)
downloadaports-8395bdf62e93ad5ff2aa0e327c726cac43ca6a01.tar.bz2
aports-8395bdf62e93ad5ff2aa0e327c726cac43ca6a01.tar.xz
testing/rmilter: move to unmaintained
Diffstat (limited to 'unmaintained/rmilter')
-rw-r--r--unmaintained/rmilter/APKBUILD115
-rw-r--r--unmaintained/rmilter/config.patch156
-rw-r--r--unmaintained/rmilter/config_dir.patch30
-rw-r--r--unmaintained/rmilter/rmilter-clamav.conf3
-rw-r--r--unmaintained/rmilter/rmilter-clamav.pre-install6
-rw-r--r--unmaintained/rmilter/rmilter-dkim.conf3
-rw-r--r--unmaintained/rmilter/rmilter-dkim.pre-install5
-rw-r--r--unmaintained/rmilter/rmilter-redis.conf18
-rw-r--r--unmaintained/rmilter/rmilter-rspamd.conf3
-rw-r--r--unmaintained/rmilter/rmilter.conf20
-rw-r--r--unmaintained/rmilter/rmilter.confd6
-rw-r--r--unmaintained/rmilter/rmilter.initd45
-rw-r--r--unmaintained/rmilter/rmilter.pre-install6
-rw-r--r--unmaintained/rmilter/system_hiredis.patch28
14 files changed, 444 insertions, 0 deletions
diff --git a/unmaintained/rmilter/APKBUILD b/unmaintained/rmilter/APKBUILD
new file mode 100644
index 0000000000..88cc71e590
--- /dev/null
+++ b/unmaintained/rmilter/APKBUILD
@@ -0,0 +1,115 @@
+# Maintainer: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Nathan Angelacos <nangel@alpinelinux.org>
+pkgname=rmilter
+pkgver=1.10.0
+pkgrel=0
+pkgdesc="Rspamd mail filter"
+url="https://rspamd.com/rmilter"
+arch="all"
+license="BSD"
+pkgusers="rmilter"
+pkggroups="rmilter"
+depends=""
+depends_dev=""
+makedepends="$depends_dev cmake bison flex bsd-compat-headers
+ libressl-dev pcre-dev libmilter-dev opendkim-dev hiredis-dev
+ glib-dev"
+install="$pkgname.pre-install $pkgname-clamav.pre-install $pkgname-dkim.pre-install"
+subpackages="$pkgname-clamav::noarch $pkgname-rspamd::noarch $pkgname-redis::noarch $pkgname-dkim::noarch"
+source="$pkgname-$pkgver.tar.gz::https://github.com/vstakhov/$pkgname/archive/$pkgver.tar.gz
+ $pkgname-clamav.conf
+ $pkgname-rspamd.conf
+ $pkgname-redis.conf
+ $pkgname-dkim.conf
+ $pkgname.confd
+ $pkgname.initd
+ $pkgname.conf
+ config.patch
+ config_dir.patch
+ system_hiredis.patch
+"
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ cmake CMakeLists.txt \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DRMILTER_USER=$pkgusers \
+ -DRMILTER_GROUP=$pkggroups \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ install -Dm644 $pkgname.conf.sample "$pkgdir"/etc/$pkgname/$pkgname.conf.common
+ install -Dm644 "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname/$pkgname.conf
+ install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -dm755 "$pkgdir"/etc/$pkgname/conf.d
+}
+
+clamav() {
+ pkgdesc="$pkgdesc: enable virus scanning with local Clamav instance"
+ depends="$pkgname clamav"
+ install -Dm644 /dev/null "$subpkgdir"/etc/conf.d/$pkgname-rc_need@clamd
+ install -Dm644 "$srcdir"/$pkgname-clamav.conf "$subpkgdir"/etc/$pkgname/conf.d/clamav.conf
+}
+
+rspamd() {
+ pkgdesc="$pkgdesc: enable spam filtering with local Rspamd instance"
+ depends="$pkgname rspamd"
+ install -Dm644 /dev/null "$subpkgdir"/etc/conf.d/$pkgname-rc_need@rspamd
+ install -Dm644 "$srcdir"/$pkgname-rspamd.conf "$subpkgdir"/etc/$pkgname/conf.d/rspamd.conf
+}
+
+redis() {
+ pkgdesc="$pkgdesc: enable greylisting and limits with local Redis backend"
+ depends="$pkgname redis"
+ install -Dm644 /dev/null "$subpkgdir"/etc/conf.d/$pkgname-rc_need@redis
+ install -Dm644 "$srcdir"/$pkgname-redis.conf "$subpkgdir"/etc/$pkgname/conf.d/redis.conf
+}
+
+dkim() {
+ pkgdesc="$pkgdesc: enable DKIM"
+ depends="$pkgname"
+ install -dm750 -g mail "$subpkgdir"/etc/mail
+ install -dm755 "$subpkgdir"/etc/mail/dkim
+ install -Dm644 "$srcdir"/$pkgname-dkim.conf "$subpkgdir"/etc/$pkgname/conf.d/dkim.conf
+}
+
+md5sums="220d693636f9ec5606033d15816a2346 rmilter-1.10.0.tar.gz
+ae0cd1a2b91e06c217d3883211ef57b8 rmilter-clamav.conf
+bdbd10caee1958ce5f9b8b899accac9c rmilter-rspamd.conf
+690b8f76f40f1a16d3ca7b994c27b637 rmilter-redis.conf
+33eafa022a0e918c7a1cf74a81654373 rmilter-dkim.conf
+d37109f41764e89606d1e40c30c010de rmilter.confd
+098a8f376dab26291f3a5e3e775e14b5 rmilter.initd
+a4a15e6c89caaecf7bbdae681cdf36a2 rmilter.conf
+87da6d59c5ca17e760668ba878d83391 config.patch
+e4f3e1ea90401b8d55e6a381af05b994 config_dir.patch
+d1aded4ee98211bd5e644c63c77eab8b system_hiredis.patch"
+sha256sums="ea80563fa7636afed0b5fd9a29aa2300f15793ed85788e4ce69c187d341a7d54 rmilter-1.10.0.tar.gz
+35f6eecbac988a4a2fdbb649fdf93aec5e77ded321aaa0521ddc9ef2ffe721e1 rmilter-clamav.conf
+eae2a0867c3e258fa052f1ada5465cf3132da87028ac9ac1a829c3239382fa13 rmilter-rspamd.conf
+9c265b9dc02b5e520d62228e9486d8bf96041f50da8f240ad352a5b189da8b27 rmilter-redis.conf
+f7513ab4345d127d2a6ef34848bc68faea83e3f7cdc11f1da641e2934bb19dd9 rmilter-dkim.conf
+fd7ac67f1c2d8bc03fee67f5fca4d0a12c562eaaab00a390e0f8e5230e6a5da4 rmilter.confd
+d0cce00aa6780fabbba03d14ab4ffa914326ac48a085bcde4c12853f8c44037d rmilter.initd
+ee73f437d02ef343eb0c1aa6d2da5bfc502e4ee93fb9d9f3362dda2efe9e5a13 rmilter.conf
+aada82ad61f3d33d285e163e054748159c378f4b7713814bf8ae94c6451bea1e config.patch
+1aa29ce0a638356d4ebd75757a2094f9db20ad3895867e3676d5ae1129352760 config_dir.patch
+aa57dbf0e6244675989caec1a62ce969f044e0f0dc4f7bfee00e91ae19c58bc0 system_hiredis.patch"
+sha512sums="bef62d6dd4190b9a28e751cc598d201f0f994a08def46ae68587d1cc956e7e209ae540d91241545dc4efd055b4bf2b95039f0e9649448e5506f17ec37240adf8 rmilter-1.10.0.tar.gz
+e28357e8eab451cb972149b003db56e4386f17e137c3a690e90c4b161edd6eeb7da99b8f36cdf016f11161664b90825ee2f706ce70887c6d8b9c6a7b167770cd rmilter-clamav.conf
+15db17901e4fc53596860dadade29b656d0addb390a56a610d13caee6362c867215de0fb57071ba87f0b97620d076444ad22fd87a3c27b2ca709fc31d71ed19c rmilter-rspamd.conf
+f56f4295209483e2e2d0ecceeecdd8a73e547ba85bca6cf9c54f3a57a87b3ca1dfbb6dd062d54224840019cee47a062d8b9384b8b08a789b0ea46b947cb11ac2 rmilter-redis.conf
+b558762c18fbcb0a50c787094d267fabae3d336ea665b126fccf1fc67284b38336ee4b9997e23091bc64e60a0302e3c5a3f659581b72dccc5da0d26c8e722f30 rmilter-dkim.conf
+a8c91009662e1f4b4fd140df8187bc2b781aab167b71219ed63447da480f3b856bea00e48651f26104e5e53f096a84dc10f769067bc9c0e6e1d504a9fcef4fbd rmilter.confd
+010d6e8e83087212ef0fe0bebfcd9581e8205dcf2ddf3434f7b25b9e80959cd6f24a5ede3207f9a104b3d467a5649e365a78fa609a7d2bf361253c803bb1ab2c rmilter.initd
+1ab84f669bd05268816c2c454e939921102713f4ce9ef39ca695a21fc3410d915abecabd5b732022f945abfdf3d1e39ab13c8412c8de46420651a1b26e2374b3 rmilter.conf
+2112a10358d7f00931a850f501db53481932badeee488afc8d8481c07bde8556449e2485c0fad5e5a0837fd921dc153a674e1c69fc1d055f6f10b89f2f061237 config.patch
+6ac3a1d73e52c156b60cabaabceea6e01c7e5f2dce78a557ccce24127440a8fea713b2465ecdd29486c4283afb6dee723cbcb476f1789bcd3876dd6c6aa5ebd1 config_dir.patch
+6913c39c3335ecaebd6413ea8d39630cf67bc5fba9a91609f1ea25f756702e1652d51429534a5223a7136a7424deaffd16c2a2fb8d32fa1a1f1f23b3b8fed87c system_hiredis.patch"
diff --git a/unmaintained/rmilter/config.patch b/unmaintained/rmilter/config.patch
new file mode 100644
index 0000000000..feeac38265
--- /dev/null
+++ b/unmaintained/rmilter/config.patch
@@ -0,0 +1,156 @@
+--- a/rmilter.conf.sample
++++ b/rmilter.conf.sample
+@@ -1,24 +1,3 @@
+-# Sample config file for rmilter
+-# $Id$
+-#
+-
+-# .include - directive to include other config file
+-#.include ./rmilter-grey.conf
+-
+-# pidfile - path to pid file
+-# Default: pidfile = /var/run/rmilter.pid
+-pidfile = /var/run/rmilter/rmilter.pid;
+-
+-# bind_socket - socket credits for local bind:
+-# unix:/path/to/file - bind to local socket
+-# inet:port@host - bind to inet socket
+-# Default: bind_socket = unix:/var/tmp/rmilter.sock;
+-bind_socket = unix:/var/run/rmilter/rmilter.sock;
+-
+-# tempdir - path to directory that contains temporary files
+-# Default: $TMPDIR
+-tempdir = /tmp;
+-
+ # max_size - maximum size of scanned message for ClamAV, Rspamd and DCC
+ # Default: 0 (no limit)
+ max_size = 10M;
+@@ -27,14 +6,14 @@
+ # Default: no
+ #strict_auth = no;
+
+-# spf_domains - path to file that contains hash of spf domains
+-# Default: empty
+-#spf_domains = example.com, mail.ru;
+-
+ # use_dcc - whether or not use DCC
+ # Default: no
+ #use_dcc = no;
+
++# use_redis - switch cache to use redis or legacy memcached
++# Default: yes
++use_redis = no;
++
+ # whitelist - global recipients whitelist
+ # Default: no
+ #whitelist = abuse@example.com, postmaster@example.com;
+@@ -51,6 +30,7 @@
+ # sockets are separated by ','
+ # Default: empty
+ #servers = clam1.example.com, clam2.example.com;
++
+ # connect_timeout - timeout in miliseconds for connecting to clamav
+ # Default: 1s
+ #connect_timeout = 1s;
+@@ -84,13 +64,13 @@
+ # sockets are separated by ','
+ # if server name is prefixed with 'r:' it is an Rspamd server
+ # Default: empty
+- servers = r:localhost:11333;
++ #servers = r:localhost:11333;
+
+ # also_check - extra Rspamd servers to check
+ #also_check = r:clam10.example.com;
+
+ # diff_dir - path where to write messages that have different results from main and extra checks
+- #diff_dir = /var/run/rmilter/diffmsg;
++ #diff_dir = /run/rmilter/diffmsg;
+
+ # connect_timeout - timeout in miliseconds for connecting to spamd
+ # Default: 1s
+@@ -147,17 +127,17 @@
+ redis {
+ # servers_grey - redis servers for greylisting in format:
+ # host[:port][, host[:port]]
+- servers_grey = localhost;
++ #servers_grey = localhost;
+
+ # servers_white - redis servers for whitelisting in format similar to that is used
+ # in servers_grey
+- servers_white = localhost;
++ #servers_white = localhost;
+
+ # servers_limits - redis servers used for limits storing, can not be mirrored
+- servers_limits = localhost;
++ #servers_limits = localhost;
+
+ # servers_id - redis servers used for message id storing, can not be mirrored
+- servers_id = localhost;
++ #servers_id = localhost;
+
+ # servers_spam - redis servers used to send spam messages
+ #servers_spam = localhost;
+@@ -207,7 +187,6 @@
+ #maxerrors = 10;
+ };
+
+-
+ # rule definition:
+ # rule {
+ # accept|discard|reject|tempfail|quarantine "[message]"; <- action definition
+@@ -223,7 +202,7 @@
+ limits {
+ # enable: enable or disable rate limits (binary flag)
+ # Default: true
+- #enable = yes;
++ enable = no;
+
+ # Whitelisted ip or networks
+ #limit_whitelist = 194.67.45.4/32;
+@@ -246,7 +225,7 @@
+ greylisting {
+ # enable - enable or disable greylisting (binary flag)
+ # Default: true
+- #enable = yes;
++ enable = no;
+
+ # timeout - time during which we mark message greylisted
+ # Default: 300s
+@@ -264,23 +243,23 @@
+ dkim {
+ # enable - enable or disable DKIM signing (binary flag)
+ # Default: true
+- #enable = yes;
++ enable = no;
+
+ # Sample for dkim specific keys
+ # domain {
+- # key = /etc/dkim/dkim_example.key;
++ # key = /etc/mail/dkim/dkim_example.key;
+ # domain = "example.com";
+ # selector = "dkim";
+ # };
+ # domain {
+- # key = /etc/dkim/dkim_test.key;
++ # key = /etc/mail/dkim/dkim_test.key;
+ # domain = "test.com";
+ # selector = "dkim";
+ # };
+
+- # Universal selector, keys will be checked for pattern /etc/dkim/<domain>.<selector>.key
++ # Universal selector, keys will be checked for pattern /etc/mail/dkim/<domain>.<selector>.key
+ domain {
+- key = /usr/local/etc/dkim;
++ key = /etc/mail/dkim;
+ domain = "*";
+ selector = "dkim";
+ };
+@@ -288,8 +267,3 @@
+ body_canon = relaxed;
+ sign_alg = sha256;
+ };
+-
+-
+-# include user's configuration, replace this with full path
+-.try_include /usr/local/etc/rmilter.conf.local
+-.try_include /usr/local/etc/rmilter.conf.d/*.conf
diff --git a/unmaintained/rmilter/config_dir.patch b/unmaintained/rmilter/config_dir.patch
new file mode 100644
index 0000000000..92b5c7b016
--- /dev/null
+++ b/unmaintained/rmilter/config_dir.patch
@@ -0,0 +1,30 @@
+diff --git a/src/cfg_file.h b/src/cfg_file.h
+index a298493..ee87148 100644
+--- a/src/cfg_file.h
++++ b/src/cfg_file.h
+@@ -39,6 +39,12 @@
+ #include <dkim.h>
+ #endif
+
++#ifndef RMILTER_CONFDIR
++#define RMILTER_CONFDIR "/etc/rmilter"
++#endif
++
++#define FIXED_CONFIG_FILE RMILTER_CONFDIR "/rmilter.conf"
++
+ #define COND_CONNECT_FLAG 0x1
+ #define COND_HELO_FLAG 0x2
+ #define COND_ENVFROM_FLAG 0x4
+diff --git a/src/main.c b/src/main.c
+index 67c1667..b3990a8 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -259,7 +259,7 @@ main(int argc, char *argv[])
+ init_defaults (cfg);
+
+ if (cfg_file == NULL) {
+- cfg_file = strdup ("/usr/local/etc/rmilter.conf");
++ cfg_file = strdup (FIXED_CONFIG_FILE);
+ }
+
+ f = fopen (cfg_file, "r");
diff --git a/unmaintained/rmilter/rmilter-clamav.conf b/unmaintained/rmilter/rmilter-clamav.conf
new file mode 100644
index 0000000000..fac04675f1
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-clamav.conf
@@ -0,0 +1,3 @@
+clamav {
+ servers = /run/clamav/clamd.sock;
+};
diff --git a/unmaintained/rmilter/rmilter-clamav.pre-install b/unmaintained/rmilter/rmilter-clamav.pre-install
new file mode 100644
index 0000000000..1adaa3194f
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-clamav.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+adduser rmilter clamav 2>/dev/null
+echo "You cat add clamd to rc_need list at /etc/conf.d/rmilter"
+
+exit 0
diff --git a/unmaintained/rmilter/rmilter-dkim.conf b/unmaintained/rmilter/rmilter-dkim.conf
new file mode 100644
index 0000000000..bf158f8e55
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-dkim.conf
@@ -0,0 +1,3 @@
+dkim {
+ enable = yes;
+};
diff --git a/unmaintained/rmilter/rmilter-dkim.pre-install b/unmaintained/rmilter/rmilter-dkim.pre-install
new file mode 100644
index 0000000000..a651ced4d4
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-dkim.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser rmilter mail 2>/dev/null
+
+exit 0
diff --git a/unmaintained/rmilter/rmilter-redis.conf b/unmaintained/rmilter/rmilter-redis.conf
new file mode 100644
index 0000000000..0a1c96c042
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-redis.conf
@@ -0,0 +1,18 @@
+use_redis = yes;
+
+redis {
+ servers_grey = localhost;
+ servers_white = localhost;
+ servers_limits = localhost;
+ servers_id = localhost;
+ #servers_spam = localhost;
+ #servers_copy = localhost;
+};
+
+greylisting {
+ enable = yes;
+};
+
+limits {
+ enable = yes;
+};
diff --git a/unmaintained/rmilter/rmilter-rspamd.conf b/unmaintained/rmilter/rmilter-rspamd.conf
new file mode 100644
index 0000000000..dcc785d67f
--- /dev/null
+++ b/unmaintained/rmilter/rmilter-rspamd.conf
@@ -0,0 +1,3 @@
+spamd {
+ servers = r:localhost:11333;
+};
diff --git a/unmaintained/rmilter/rmilter.conf b/unmaintained/rmilter/rmilter.conf
new file mode 100644
index 0000000000..f1a4b17b2c
--- /dev/null
+++ b/unmaintained/rmilter/rmilter.conf
@@ -0,0 +1,20 @@
+# .include - directive to include other config file
+.include /etc/rmilter/rmilter.conf.common
+
+# pidfile - path to pid file
+# Default: no defaults
+pidfile = /run/rmilter/rmilter.pid;
+
+# bind_socket - socket credits for local bind:
+# unix:/path/to/file - bind to local socket
+# inet:port@host - bind to inet socket
+# Default: no defaults
+bind_socket = unix:/run/rmilter/rmilter.sock;
+
+# tempdir - path to directory that contains temporary files
+# Default: $TMPDIR
+tempdir = /tmp;
+
+# include user's configuration, replace this with full path
+.try_include /etc/rmilter/rmilter.conf.local
+.try_include /etc/rmilter/conf.d/*.conf
diff --git a/unmaintained/rmilter/rmilter.confd b/unmaintained/rmilter/rmilter.confd
new file mode 100644
index 0000000000..bf2a347286
--- /dev/null
+++ b/unmaintained/rmilter/rmilter.confd
@@ -0,0 +1,6 @@
+# User and group to run as
+#user=rmilter
+#group=rmilter
+
+# Main config file
+#cfgfile=/etc/rmilter/rmilter.conf
diff --git a/unmaintained/rmilter/rmilter.initd b/unmaintained/rmilter/rmilter.initd
new file mode 100644
index 0000000000..6983bddaef
--- /dev/null
+++ b/unmaintained/rmilter/rmilter.initd
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+
+description="Rapid mail filter"
+command=/usr/sbin/rmilter
+command_args=${cfgfile:+"-c $cfgfile"}
+
+: ${user:=rmilter}
+: ${group:=rmilter}
+: ${cfgfile:=/etc/rmilter/rmilter.conf}
+
+pidfile=$(grep '^[[:space:]]*pidfile[[:space:]]*=' $cfgfile | sed 's/[[:space:];]//g' | cut -d= -f2)
+required_files="$cfgfile"
+extra_started_commands="reload"
+description_reload="Reload configuration"
+start_stop_daemon_args="$start_stop_daemon_args --user $user --group $group"
+
+depend() {
+ need net localmount
+ use logger antivirus antispam
+ for file in $(ls /etc/conf.d/${RC_SVCNAME}-rc_need@* 2>/dev/null); do
+ need ${file#*@}
+ done
+}
+
+start_pre() {
+ ebegin
+ checkpath --directory --owner $user:$group ${pidfile%/*}
+ bind_socket=$(grep '^[[:space:]]*bind_socket[[:space:]]*=[[:space:]]*unix:' $cfgfile | sed 's/[[:space:];]//g' | cut -d: -f2)
+ diff_dir=$(grep -hr '^[[:space:]]*diff_dir[[:space:]]*=' ${cfgfile%/*} | sed 's/[[:space:];]//g' | cut -d= -f2)
+ if [ "$bind_socket" ]; then
+ checkpath --directory --owner $user:$group ${bind_socket%/*}
+ rm -f $bind_socket
+ fi
+ if [ "$diff_dir" ]; then
+ checkpath --directory --owner $user:$group $diff_dir
+ rm -f $diff_dir/*
+ fi
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon --signal USR1 --pidfile $pidfile
+ eend $?
+}
diff --git a/unmaintained/rmilter/rmilter.pre-install b/unmaintained/rmilter/rmilter.pre-install
new file mode 100644
index 0000000000..80ddefc291
--- /dev/null
+++ b/unmaintained/rmilter/rmilter.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S rmilter 2>/dev/null
+adduser -S -D -H -h /run/rmilter -s /sbin/nologin -G rmilter -g rmilter rmilter 2>/dev/null
+
+exit 0
diff --git a/unmaintained/rmilter/system_hiredis.patch b/unmaintained/rmilter/system_hiredis.patch
new file mode 100644
index 0000000000..d72e9cd03d
--- /dev/null
+++ b/unmaintained/rmilter/system_hiredis.patch
@@ -0,0 +1,28 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -370,6 +370,8 @@
+ ProcessPackage(GLIB2 LIBRARY glib-2.0 INCLUDE glib.h
+ INCLUDE_SUFFIXES include/glib
+ ROOT ${GLIB_ROOT_DIR} MODULES glib-2.0>=2.28)
++ProcessPackage(LIBHIREDIS LIBRARY hiredis INCLUDE hiredis.h INCLUDE_SUFFIXES include/hiredis
++ LIB_SUFFIXES lib/libhiredis ROOT ${LIBHIREDIS_ROOT_DIR} MODULES libhiredis)
+
+ IF(ENABLE_DKIM MATCHES "ON")
+ SET(WITH_DKIM 1)
+@@ -388,8 +390,6 @@
+ ENDIF()
+
+ ################################ SOURCES SECTION ###########################
+-ADD_SUBDIRECTORY(hiredis)
+-INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/hiredis")
+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/lc-btrie")
+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/")
+ ADD_SUBDIRECTORY(contrib/libucl)
+@@ -421,7 +421,6 @@
+ ADD_EXECUTABLE(rmilter ${RMILTERSRC})
+ SET_TARGET_PROPERTIES(rmilter PROPERTIES LINKER_LANGUAGE C)
+ TARGET_LINK_LIBRARIES(rmilter ${RMILTER_REQUIRED_LIBRARIES})
+-TARGET_LINK_LIBRARIES(rmilter rmilter-hiredis)
+ TARGET_LINK_LIBRARIES(rmilter ucl)
+ TARGET_LINK_LIBRARIES(rmilter xxhash)
+ TARGET_LINK_LIBRARIES(rmilter rmilter-http-parser)