diff --git a/core/dovecot/conf/bin/ham b/core/dovecot/conf/bin/ham index 0d56bf0f..becc304d 100755 --- a/core/dovecot/conf/bin/ham +++ b/core/dovecot/conf/bin/ham @@ -1,4 +1,4 @@ #!/bin/bash -tee >(rspamc -h ${HOST_ANTISPAM:-antispam:11334} -P mailu learn_ham /dev/stdin) \ - | rspamc -h ${HOST_ANTISPAM:-antispam:11334} -P mailu -f 13 fuzzy_add /dev/stdin +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 index 78ede011..035706b6 100755 --- a/core/dovecot/conf/bin/spam +++ b/core/dovecot/conf/bin/spam @@ -1,4 +1,4 @@ #!/bin/bash -tee >(rspamc -h ${HOST_ANTISPAM:-antispam:11334} -P mailu learn_spam /dev/stdin) \ - >(rspamc -h ${HOST_ANTISPAM:-antispam:11334} -P mailu -f 11 fuzzy_add /dev/stdin) +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 6f011c74..ae429748 100755 --- a/core/dovecot/start.py +++ b/core/dovecot/start.py @@ -24,6 +24,7 @@ def start_podop(): os.environ["FRONT_ADDRESS"] = system.resolve_address(os.environ.get("HOST_FRONT", "front")) os.environ["REDIS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_REDIS", "redis")) os.environ["ADMIN_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ADMIN", "admin")) +os.environ["ANTISPAM_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ANTISPAM", "antispam:11334")) if os.environ["WEBMAIL"] != "none": os.environ["WEBMAIL_ADDRESS"] = system.resolve_address(os.environ.get("HOST_WEBMAIL", "webmail")) diff --git a/services/rspamd/conf/antivirus.conf b/services/rspamd/conf/antivirus.conf index a39d7228..a0582a0d 100644 --- a/services/rspamd/conf/antivirus.conf +++ b/services/rspamd/conf/antivirus.conf @@ -3,6 +3,6 @@ clamav { attachments_only = true; symbol = "CLAM_VIRUS"; type = "clamav"; - servers = "{{ HOST_ANTIVIRUS }}"; + servers = "{{ ANTIVIRUS_ADDRESS }}"; } {% endif %} diff --git a/services/rspamd/start.py b/services/rspamd/start.py index 592eb609..354b14b7 100755 --- a/services/rspamd/start.py +++ b/services/rspamd/start.py @@ -14,7 +14,9 @@ os.environ["FRONT_ADDRESS"] = system.resolve_address(os.environ.get("HOST_FRONT" if "HOST_REDIS" not in os.environ: os.environ["REDIS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_REDIS", "redis")) -os.environ["HOST_ANTIVIRUS"] = system.resolve_address(os.environ.get("HOST_ANTIVIRUS", "antivirus:3310")) + +if os.environ.get("ANTIVIRUS") == 'clamav': + os.environ["ANTIVIRUS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ANTIVIRUS", "antivirus:3310")) for rspamd_file in glob.glob("/conf/*"): conf.jinja(rspamd_file, os.environ, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))