You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-12-01 22:41:53 +02:00
Fix rspamd-learn when moving mail from/to junk folder
Before, the ham/spam scripts got the rspamd-ip/port from the environment. However, when checking the environment of these processes now, it seems cleared. Maybe the new dovecot version now clears environment? — I couldn’t find a hint. In any case, using the common mechanism of injecting the ip/port from where it’s definately known by the already-used jinja2-mechanism seems reasonably safe.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import stat
|
||||
import glob
|
||||
import multiprocessing
|
||||
import logging as log
|
||||
@@ -32,6 +33,15 @@ 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)))
|
||||
|
||||
try:
|
||||
os.mkdir("/conf/bin")
|
||||
except FileExistsError:
|
||||
pass
|
||||
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, stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
|
||||
|
||||
# Run Podop, then postfix
|
||||
multiprocessing.Process(target=start_podop).start()
|
||||
os.system("chown mail:mail /mail")
|
||||
|
||||
Reference in New Issue
Block a user