Skip to content
Snippets Groups Projects
Unverified Commit 8512eba7 authored by Roma's avatar Roma Committed by Rémy Huet
Browse files

Bug dans la génération des fichiers de config

parent 98ccb2b2
No related branches found
No related tags found
1 merge request!20pica-mailnt
......@@ -50,17 +50,20 @@ if [ "$1" == "imap" ]
then
echo "L\'authentification SASL se fera par IMAP."
#find-and-replace
sed -i -e 's/MECHANISMS="pam"/MECHANISMS="rimap"/g' /etc/default/saslauthd-postfix
sed -i -e 's/MECH_OPTIONS=""/MECH_OPTIONS="${IMAP_AUTH_LAN_HOSTNAME}"/g' /etc/default/saslauthd-postfix
#TODO: implémenter un find-and-replace permettant de mettre un backslash pour hôte/port
cat <<EOF >> /etc/default/saslauthd-postfix
MECHANISMS="rimap"
MECH_OPTIONS="${IMAP_AUTH_LAN_HOSTNAME}/${IMAP_AUTH_PORT}"
EOF
elif [ "$1" == "ldap" ]
then
echo "L\'authentification SASL se fera par LDAP."
#find-and-replace
sed -i -e 's/MECHANISMS="pam"/MECHANISMS="ldap"/g' /etc/default/saslauthd-postfix
cat <<EOF >> /etc/default/saslauthd-postfix
MECHANISMS="ldap"
MECH_OPTIONS=""
EOF
cat <<EOF >> /etc/saslauthd.conf
ldap_servers: ldap://${LDAP_SERVER_HOSTNAME}:${LDAP_PORT}
ldap_bind_dn: ${LDAP_BIND_DN}
......@@ -70,8 +73,12 @@ ldap_filter: ${LDAP_FILTER}
EOF
else
echo "L\'authentification SASL se fera par PAM."
#c'est le paramètre par défaut dans saslauthd-postfix: on touche à rien
echo "L\'authentification SASL se fera par PAM."
cat <<EOF >> /etc/default/saslauthd-postfix
MECHANISMS="pam"
MECH_OPTIONS=""
EOF
fi
service saslauthd restart
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment