[Postfix] Add scripts to learn from spam/ham traps
[Dovecot] Learn fuzzy when moving mails from/to junkmaster
parent
d8f86ae488
commit
15b80760b2
|
@ -1,4 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnham < /dev/stdin
|
FILE=/tmp/mail$$
|
||||||
# Always return 0 to satisfy Dovecot...
|
cat > $FILE
|
||||||
|
trap "/bin/rm -f $FILE" 0 1 2 3 13 15
|
||||||
|
|
||||||
|
cat ${FILE} | /usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnham
|
||||||
|
cat ${FILE} | /usr/bin/curl -H "Flag: 13" -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/fuzzyadd
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnspam < /dev/stdin
|
FILE=/tmp/mail$$
|
||||||
# Always return 0 to satisfy Dovecot...
|
cat > $FILE
|
||||||
|
trap "/bin/rm -f $FILE" 0 1 2 3 13 15
|
||||||
|
|
||||||
|
cat ${FILE} | /usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnspam
|
||||||
|
cat ${FILE} | /usr/bin/curl -H "Flag: 11" -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/fuzzyadd
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -45,6 +45,8 @@ COPY zeyple.conf /etc/zeyple.conf
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
||||||
COPY postfix.sh /opt/postfix.sh
|
COPY postfix.sh /opt/postfix.sh
|
||||||
|
COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
|
||||||
|
COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
|
||||||
COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
|
COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
|
||||||
|
|
||||||
EXPOSE 588
|
EXPOSE 588
|
||||||
|
|
|
@ -4,10 +4,11 @@ trap "postfix stop" EXIT
|
||||||
|
|
||||||
[[ ! -d /opt/postfix/conf/sql/ ]] && mkdir -p /opt/postfix/conf/sql/
|
[[ ! -d /opt/postfix/conf/sql/ ]] && mkdir -p /opt/postfix/conf/sql/
|
||||||
|
|
||||||
cat /dev/null > /etc/aliases;
|
cat <<EOF > /etc/aliases
|
||||||
echo 'null: /dev/null' >> /etc/aliases;
|
null: /dev/null
|
||||||
echo '"ham: "|/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnham"' >> /etc/aliases;
|
ham: "|/usr/local/bin/rspamd-pipe-ham"
|
||||||
echo 'spam: "|/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnspam"' >> /etc/aliases;
|
spam: "|/usr/local/bin/rspamd-pipe-spam"
|
||||||
|
EOF
|
||||||
newaliases;
|
newaliases;
|
||||||
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
|
cat <<EOF > /opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
FILE=/tmp/mail$$
|
||||||
|
cat > $FILE
|
||||||
|
trap "/bin/rm -f $FILE" 0 1 2 3 13 15
|
||||||
|
|
||||||
|
cat ${FILE} | /usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnham
|
||||||
|
cat ${FILE} | /usr/bin/curl -H "Flag: 13" -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/fuzzyadd
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
FILE=/tmp/mail$$
|
||||||
|
cat > $FILE
|
||||||
|
trap "/bin/rm -f $FILE" 0 1 2 3 13 15
|
||||||
|
|
||||||
|
cat ${FILE} | /usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnspam
|
||||||
|
cat ${FILE} | /usr/bin/curl -H "Flag: 11" -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/fuzzyadd
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue