Pipe to rspamd

master
andryyy 2016-12-13 13:38:45 +01:00
parent b93c4e4102
commit 36b09f339b
2 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,7 @@ RUN apt-get update \
dovecot-pop3d \ dovecot-pop3d \
dovecot-dev \ dovecot-dev \
wget \ wget \
curl \
build-essential \ build-essential \
autotools-dev \ autotools-dev \
automake automake

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
if [[ ${1} == "learn_spam" ]]; then if [[ ${2} == "learn_spam" ]]; then
/usr/bin/curl --data-binary @- http://rspamd:11334/learnspam < /dev/stdin /usr/bin/curl --data-binary @- http://rspamd:11334/learnspam < /dev/stdin
elif [[ ${1} == "learn_ham" ]]; then elif [[ ${2} == "learn_ham" ]]; then
/usr/bin/curl --data-binary @- http://rspamd:11334/learnham < /dev/stdin /usr/bin/curl --data-binary @- http://rspamd:11334/learnham < /dev/stdin
fi fi
# Always return 0 to satisfy Dovecot...
exit 0