declare -a MAIL_DNS=()
declare -A ENSURED_DIRS=()
+declare -A NOT_COMPILED=()
#-------------------------------------------------------------------
detect_color() {
if [[ "${SIMULATE}" != "y" ]] ; then
sievec "${dovecot_sieve_file}" || true
fi
- CHOWN "${VMAIL_USER}:${VMAIL_GROUP}" "${compiled_sieve}"
- CHMOD 0600 "${compiled_sieve}"
+ if [[ -f "${compiled_sieve}" ]] ; then
+ CHOWN "${VMAIL_USER}:${VMAIL_GROUP}" "${compiled_sieve}"
+ CHMOD 0600 "${compiled_sieve}"
+ elif [[ "${SIMULATE}" != "y" ]] ; then
+ warn "Compiled sieve file '${YELLOW}${compiled_sieve}${NORMAL}' does not exists."
+ NOT_COMPILED[${dn}]="${cn} <${mail_address}>"
+ fi
if [[ -e "${compiled_sieve}" && "${QUIET}" != "y" ]] ; then
ls -l "${color_param}" "${compiled_sieve}"
fi
migrate_entry "${dn}"
done
+ if [[ "${SIMULATE}" != "y" ]] ; then
+ empty_line
+ local dn=
+ if [[ "${#NOT_COMPILED[*]}" == "0" ]] ; then
+ info "All generated sieve files could be compiled."
+ else
+ warn "The sieve scripts of following mailboxes could not be compiled:"
+ for dn in "${!NOT_COMPILED[@]}" ; do
+ echo " * ${NOT_COMPILED[${dn}]} - '${dn}'"
+ done
+ fi
+ fi
+
}
#------------------------------------------------