Learn fuzzy hashes automatically
This commit is contained in:
@@ -2,7 +2,7 @@ FROM alpine:3.8
|
|||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
dovecot dovecot-pigeonhole-plugin dovecot-fts-lucene rspamd-client \
|
dovecot dovecot-pigeonhole-plugin dovecot-fts-lucene rspamd-client \
|
||||||
python3 py3-pip \
|
bash python3 py3-pip \
|
||||||
&& pip3 install --upgrade pip \
|
&& pip3 install --upgrade pip \
|
||||||
&& pip3 install jinja2 podop tenacity
|
&& pip3 install jinja2 podop tenacity
|
||||||
|
|
||||||
|
|||||||
4
core/dovecot/conf/bin/ham
Executable file
4
core/dovecot/conf/bin/ham
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
tee >(rspamc -h antispam:11334 -P mailu learn_ham /dev/stdin) \
|
||||||
|
| rspamc -h antispam:11334 -P mailu -f 13 fuzzy_add /dev/stdin
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
rspamc -h antispam:11334 -P mailu "learn_$1" /dev/stdin <&0
|
|
||||||
4
core/dovecot/conf/bin/spam
Executable file
4
core/dovecot/conf/bin/spam
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
tee >(rspamc -h antispam:11334 -P mailu learn_spam /dev/stdin) \
|
||||||
|
>(rspamc -h antispam:11334 -P mailu -f 11 fuzzy_add /dev/stdin)
|
||||||
@@ -8,4 +8,4 @@ if string "${mailbox}" "Trash" {
|
|||||||
stop;
|
stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
execute :pipe "mailtrain" "ham";
|
execute :pipe "ham";
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
require "vnd.dovecot.execute";
|
require "vnd.dovecot.execute";
|
||||||
|
|
||||||
execute :pipe "mailtrain" "spam";
|
execute :pipe "spam";
|
||||||
|
|||||||
Reference in New Issue
Block a user