40 lines
784 B
Plaintext
40 lines
784 B
Plaintext
|
#!/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"
|
||
|
mail_snippets="${mail_snippets}${mail_snippets:+ }$i"
|
||
|
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
|
||
|
|
||
|
mail_snippets=$(sort_dedup_list "${mail_snippets}")
|
||
|
|
||
|
set -a
|
||
|
NGX_MAIL_MODULES="${mail_modules}"
|
||
|
NGX_MAIL_SNIPPETS="${mail_snippets}"
|
||
|
set +a
|
||
|
|
||
|
unset mail_modules mail_snippets
|
||
|
fi
|