From 195712a45e3f0eb709c20dc50cc586c2ee54cb65 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 14 Feb 2022 17:49:11 +0100 Subject: [PATCH] Compiling Sieve files --- migrate-sieve | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/migrate-sieve b/migrate-sieve index 04035f4..8a74d18 100755 --- a/migrate-sieve +++ b/migrate-sieve @@ -50,6 +50,7 @@ VMAIL_USER='vmail' VMAIL_GROUP='vmail' SIEVE_FILE_BASE="Normal.sieve" DOVECOT_SIEVE_FILE_BASE=".dovecot.sieve" +COMPILED_SIEVE_BASE=".dovecot.svbin" declare -a MAIL_DNS=() declare -A ENSURED_DIRS=() @@ -543,6 +544,7 @@ migrate_entry() { local domain_dir="${VMAIL_ROOT_DIR}/${domain}" local mailbox_dir="${domain_dir}/${mail_address}" local dovecot_sieve_file="${mailbox_dir}/${DOVECOT_SIEVE_FILE_BASE}" + local compiled_sieve="${mailbox_dir}/${COMPILED_SIEVE_BASE}" local sieve_dir="${mailbox_dir}/sieve" local sieve_file="${sieve_dir}/${SIEVE_FILE_BASE}" local dovecot_link_target="sieve/${SIEVE_FILE_BASE}" @@ -603,6 +605,17 @@ migrate_entry() { ls -l "${color_param}" "${dovecot_sieve_file}" fi + info "Compiling '${CYAN}${dovecot_sieve_file}${NORMAL}' ..." + debug "Executing: sievec \"${dovecot_sieve_file}\"" + if [[ "${SIMULATE}" != "y" ]] ; then + sievec "${dovecot_sieve_file}" + fi + CHOWN "${VMAIL_USER}:${VMAIL_GROUP}" "${compiled_sieve}" + CHMOD 0600 "${compiled_sieve}" + if [[ -e "${compiled_sieve}" && "${QUIET}" != "y" ]] ; then + ls -l "${color_param}" "${compiled_sieve}" + fi + } #------------------------------------------------ -- 2.39.5