mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix warnings and weird stuff >_>
This commit is contained in:
parent
ca5f264baf
commit
9156b1e56a
1 changed files with 9 additions and 6 deletions
|
@ -27,22 +27,21 @@ do_pre_regen() {
|
|||
# Add possibility to specify a relay
|
||||
# Could be useful with some isp with no 25 port open or more complex setup
|
||||
export relay_host="$(yunohost settings get 'smtp.relay.host')"
|
||||
if [ ! -z "${relay_host}" ]; then
|
||||
if [ -n "${relay_host}" ]
|
||||
then
|
||||
export relay_port="$(yunohost settings get 'smtp.relay.port')"
|
||||
export relay_user="$(yunohost settings get 'smtp.relay.user')"
|
||||
relay_password="$(yunohost settings get 'smtp.relay.password')"
|
||||
|
||||
# Avoid to display "Relay account paswword" to other users
|
||||
touch ${postfix_dir}/sasl_passwd
|
||||
chmod o=--- ${postfix_dir}/sasl_passwd
|
||||
chmod 750 ${postfix_dir}/sasl_passwd
|
||||
# Avoid "postmap: warning: removing zero-length database file"
|
||||
chown postfix ${pending_dir}/etc/postfix
|
||||
chown postfix ${pending_dir}/etc/postfix/sasl_passwd
|
||||
|
||||
cat <<< "[${relay_host}]:${relay_port} ${relay_user}:${relay_password}" > ${postfix_dir}/sasl_passwd
|
||||
postmap ${postfix_dir}/sasl_passwd
|
||||
|
||||
|
||||
fi
|
||||
export main_domain
|
||||
export domain_list="$YNH_DOMAINS"
|
||||
|
@ -67,8 +66,12 @@ do_pre_regen() {
|
|||
|
||||
do_post_regen() {
|
||||
regen_conf_files=$1
|
||||
chmod o=--- /etc/postfix/sasl_passwd*
|
||||
chown postfix /etc/postfix/sasl_passwd*
|
||||
|
||||
if [ -e /etc/postfix/sasl_passwd ]
|
||||
then
|
||||
chmod 750 /etc/postfix/sasl_passwd*
|
||||
chown postfix:root /etc/postfix/sasl_passwd*
|
||||
fi
|
||||
|
||||
[[ -z "$regen_conf_files" ]] \
|
||||
|| { service postfix restart && service postsrsd restart; }
|
||||
|
|
Loading…
Add table
Reference in a new issue