diff --git a/core/dovecot/conf/ham.script b/core/dovecot/conf/ham.script index 910df8e4..57112747 100755 --- a/core/dovecot/conf/ham.script +++ b/core/dovecot/conf/ham.script @@ -1,6 +1,6 @@ #!/bin/bash - -RSPAMD_HOST="$(getent hosts {{ ANTISPAM_WEBUI_ADDRESS }}|cut -d\ -f1)" +{% set hostname,port = ANTISPAM_WEBUI_ADDRESS.split(':') %} +RSPAMD_HOST="$(getent hosts {{ hostname }}|cut -d\ -f1):{{ port }}" if [[ $? -ne 0 ]] then echo "Failed to lookup {{ ANTISPAM_WEBUI_ADDRESS }}" >&2 diff --git a/core/dovecot/conf/spam.script b/core/dovecot/conf/spam.script index e7d20427..2e3872b0 100755 --- a/core/dovecot/conf/spam.script +++ b/core/dovecot/conf/spam.script @@ -1,6 +1,6 @@ #!/bin/bash - -RSPAMD_HOST="$(getent hosts {{ ANTISPAM_WEBUI_ADDRESS }}|cut -d\ -f1)" +{% set hostname,port = ANTISPAM_WEBUI_ADDRESS.split(':') %} +RSPAMD_HOST="$(getent hosts {{ hostname }}|cut -d\ -f1):{{ port }}" if [[ $? -ne 0 ]] then echo "Failed to lookup {{ ANTISPAM_WEBUI_ADDRESS }}" >&2