1
0
angie-conv-image/image-entry.d/31-mail-modules.envsh

38 lines
731 B
Plaintext
Raw Normal View History

2024-07-15 16:15:47 +03:00
#!/bin/sh
if [ "${NGX_MAIL}" = 1 ] ; then
unset mail_modules mail_snippets
mail_modules=
mail_snippets="${NGX_MAIL_SNIPPETS:-}"
## filter out builtin mail modules
unset i
for i in ${NGX_MAIL_MODULES:-} ; do
[ -n "$i" ] || continue
if is_builtin_module mail "$i" ; then
log "$i is builtin module, moving to snippets"
2024-07-20 16:35:39 +03:00
mail_snippets="${mail_snippets} $i"
2024-07-15 16:15:47 +03:00
continue
fi
## naive deduplication
case " ${mail_modules} " in
*" $i "* )
log "$i is already specified"
continue
;;
esac
mail_modules="${mail_modules}${mail_modules:+ }$i"
done
unset i
set -a
NGX_MAIL_MODULES="${mail_modules}"
2024-07-20 16:35:39 +03:00
NGX_MAIL_SNIPPETS=$(sort_dedup_list "${mail_snippets}")
2024-07-15 16:15:47 +03:00
set +a
unset mail_modules mail_snippets
fi