38 lines
731 B
Bash
Executable File
38 lines
731 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "${NGX_MAIL}" = 1 ] ; then
|
|
unset mail_modules mail_confload
|
|
mail_modules=
|
|
mail_confload="${NGX_MAIL_CONFLOAD:-}"
|
|
|
|
## 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 confload"
|
|
mail_confload="${mail_confload} $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
|
|
|
|
set -a
|
|
NGX_MAIL_MODULES="${mail_modules}"
|
|
NGX_MAIL_CONFLOAD=$(sort_dedup_list "${mail_confload}")
|
|
set +a
|
|
|
|
unset mail_modules mail_confload
|
|
fi
|