diff --git a/core/dovecot/conf/bin/ham b/core/dovecot/conf/bin/ham deleted file mode 100755 index becc304d..00000000 --- a/core/dovecot/conf/bin/ham +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -tee >(rspamc -h ${ANTISPAM_ADDRESS} -P mailu learn_ham /dev/stdin) \ - | rspamc -h ${ANTISPAM_ADDRESS} -P mailu -f 13 fuzzy_add /dev/stdin diff --git a/core/dovecot/conf/bin/spam b/core/dovecot/conf/bin/spam deleted file mode 100755 index 035706b6..00000000 --- a/core/dovecot/conf/bin/spam +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -tee >(rspamc -h ${ANTISPAM_ADDRESS} -P mailu learn_spam /dev/stdin) \ - >(rspamc -h ${ANTISPAM_ADDRESS} -P mailu -f 11 fuzzy_add /dev/stdin) diff --git a/core/dovecot/conf/ham.script b/core/dovecot/conf/ham.script new file mode 100755 index 00000000..f1dfc409 --- /dev/null +++ b/core/dovecot/conf/ham.script @@ -0,0 +1,4 @@ +#!/bin/bash + +tee >(rspamc -h {{ ANTISPAM_ADDRESS }} -P mailu learn_ham /dev/stdin) \ + | rspamc -h {{ ANTISPAM_ADDRESS }} -P mailu -f 13 fuzzy_add /dev/stdin diff --git a/core/dovecot/conf/spam.script b/core/dovecot/conf/spam.script new file mode 100755 index 00000000..c711be0a --- /dev/null +++ b/core/dovecot/conf/spam.script @@ -0,0 +1,4 @@ +#!/bin/bash + +tee >(rspamc -h {{ ANTISPAM_ADDRESS }} -P mailu learn_spam /dev/stdin) \ + >(rspamc -h {{ ANTISPAM_ADDRESS }} -P mailu -f 11 fuzzy_add /dev/stdin) diff --git a/core/dovecot/start.py b/core/dovecot/start.py index f522cf1e..b8ad1699 100755 --- a/core/dovecot/start.py +++ b/core/dovecot/start.py @@ -32,6 +32,12 @@ if os.environ["WEBMAIL"] != "none": for dovecot_file in glob.glob("/conf/*.conf"): conf.jinja(dovecot_file, os.environ, os.path.join("/etc/dovecot", os.path.basename(dovecot_file))) +os.makedirs("/conf/bin", exist_ok=True) +for script_file in glob.glob("/conf/*.script"): + out_file = os.path.join("/conf/bin/", os.path.basename(script_file).replace('.script','')) + conf.jinja(script_file, os.environ, out_file) + os.chmod(out_file, 0o555) + # Run Podop, then postfix multiprocessing.Process(target=start_podop).start() os.system("chown mail:mail /mail") diff --git a/towncrier/newsfragments/1177.bug b/towncrier/newsfragments/1177.bug new file mode 100644 index 00000000..752543d2 --- /dev/null +++ b/towncrier/newsfragments/1177.bug @@ -0,0 +1 @@ +Fix piping mail into rspamd when moving from/to junk-folder