WIP : recherche du bug de suppression totale des confs

This commit is contained in:
Adrien Bourmault 2023-10-09 22:43:02 +02:00
parent c51c2a5f4b
commit 7124914e7a
Signed by: neox
GPG key ID: 2974E1D5F25DFCC8

View file

@ -16,6 +16,7 @@ if grep -q -e ^$user: /etc/passwd ; then
# Del account from members ML # Del account from members ML
echo -n "Deleting mail from member list..." echo -n "Deleting mail from member list..."
pos=$(grep --line-number -e ^$user: /etc/postfix/virtual_members | cut -d ":" -f 1) pos=$(grep --line-number -e ^$user: /etc/postfix/virtual_members | cut -d ":" -f 1)
echo Found at pos $pos
sed -i "${pos}d" /etc/postfix/virtual_members sed -i "${pos}d" /etc/postfix/virtual_members
postmap /etc/postfix/virtual_members postmap /etc/postfix/virtual_members
echo "[OK]" echo "[OK]"
@ -23,6 +24,7 @@ if grep -q -e ^$user: /etc/passwd ; then
# Del account from any redirect (if exist) # Del account from any redirect (if exist)
echo -n "Deleting mail from member list..." echo -n "Deleting mail from member list..."
pos=$(grep --line-number -e ^$user: /etc/postfix/virtual_redirect | cut -d ":" -f 1) pos=$(grep --line-number -e ^$user: /etc/postfix/virtual_redirect | cut -d ":" -f 1)
echo Found at pos $pos
sed -i "${pos}d" /etc/postfix/virtual_redirect sed -i "${pos}d" /etc/postfix/virtual_redirect
postmap /etc/postfix/virtual_redirect postmap /etc/postfix/virtual_redirect
echo "[OK]" echo "[OK]"
@ -34,7 +36,7 @@ if grep -q -e ^$user: /etc/passwd ; then
echo -n "Reloading postfix..." echo -n "Reloading postfix..."
postfix reload > /dev/null 2>&1 postfix reload
echo "[OK]" echo "[OK]"
$SCRIPTPATH/sendmail_deletion.sh $user $email $SCRIPTPATH/sendmail_deletion.sh $user $email