mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Avoid sasl account reachable from other users
This commit is contained in:
parent
c1fddb312d
commit
94eb9246bb
1 changed files with 16 additions and 1 deletions
|
@ -31,8 +31,21 @@ do_pre_regen() {
|
||||||
export relay_port="$(yunohost settings get 'smtp.relay.port')"
|
export relay_port="$(yunohost settings get 'smtp.relay.port')"
|
||||||
export relay_user="$(yunohost settings get 'smtp.relay.user')"
|
export relay_user="$(yunohost settings get 'smtp.relay.user')"
|
||||||
relay_password="$(yunohost settings get 'smtp.relay.password')"
|
relay_password="$(yunohost settings get 'smtp.relay.password')"
|
||||||
echo "[${relay_host}]:${relay_port} ${relay_user}:${relay_password}" > ${postfix_dir}/sasl_passwd
|
|
||||||
|
# Avoid to display "Relay account paswword" to other users
|
||||||
|
touch ${postfix_dir}/sasl_passwd
|
||||||
|
chmod o=--- ${postfix_dir}/sasl_passwd
|
||||||
|
touch ${postfix_dir}/sasl_passwd.db
|
||||||
|
chmod o=--- ${postfix_dir}/sasl_passwd.db
|
||||||
|
# Avoid "postmap: warning: removing zero-length database file"
|
||||||
|
chown postfix ${pending_dir}/etc/postfix
|
||||||
|
chown postfix ${pending_dir}/etc/postfix/sasl_passwd
|
||||||
|
chown postfix ${pending_dir}/etc/postfix/sasl_passwd.db
|
||||||
|
|
||||||
|
cat <<< "[${relay_host}]:${relay_port} ${relay_user}:${relay_password}" > ${postfix_dir}/sasl_passwd
|
||||||
postmap ${postfix_dir}/sasl_passwd
|
postmap ${postfix_dir}/sasl_passwd
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
export main_domain
|
export main_domain
|
||||||
export domain_list="$YNH_DOMAINS"
|
export domain_list="$YNH_DOMAINS"
|
||||||
|
@ -57,6 +70,8 @@ do_pre_regen() {
|
||||||
|
|
||||||
do_post_regen() {
|
do_post_regen() {
|
||||||
regen_conf_files=$1
|
regen_conf_files=$1
|
||||||
|
chmod o=--- /etc/postfix/sasl_passwd
|
||||||
|
chmod o=--- /etc/postfix/sasl_passwd.db
|
||||||
|
|
||||||
[[ -z "$regen_conf_files" ]] \
|
[[ -z "$regen_conf_files" ]] \
|
||||||
|| { service postfix restart && service postsrsd restart; }
|
|| { service postfix restart && service postsrsd restart; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue