Partial revert #1864 (#1877)

This commit is contained in:
Georg Lauterbach 2021-03-31 16:45:16 +02:00 committed by GitHub
parent 359696cba9
commit bc5bc51c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 51 deletions

View file

@ -162,7 +162,7 @@ function _usage
\e[94mCOMMAND\e[39m email \e[31m:=\e[39m
${0} email add <EMAIL ADDRESS> [<PASSWORD>]
${0} email update <EMAIL ADDRESS> [<PASSWORD>]
${0} email del [ OPTIONS\e[31m...\e[39m ] <EMAIL ADDRESS>
${0} email del [ OPTIONS\e[31m...\e[39m ] <EMAIL ADDRESS> [ <EMAIL ADDRESS>\e[31m...\e[39m ]
${0} email restrict <add\e[31m|\e[39mdel\e[31m|\e[39mlist> <send\e[31m|\e[39mreceive> [<EMAIL ADDRESS>]
${0} email list

View file

@ -21,7 +21,7 @@ function __usage
delmailuser - delete a user and related data
\e[38;5;214mSYNOPSIS\e[39m
./setup.sh email del [ OPTIONS ] { <MAIL ADDRESS> \e[31m|\e[39m help }
./setup.sh email del [ OPTIONS ] { <MAIL ADDRESS> [<MAIL ADDRESS>\e[31m...\e[39m] \e[31m|\e[39m help }
\e[38;5;214mDESCRIPTION\e[39m
Delete a mail user, aliases, quotas and mail data.
@ -38,7 +38,7 @@ function __usage
Delete the mail user, quotas and aliases, but ask
again whether mailbox data should be deleted.
\e[37m./setup.sh email del -y test@domain.com\e[39m
\e[37m./setup.sh email del -y test@domain.com test@domain.com\e[39m
Delete all mail data for the users 'test' and do not
prompt to ask if all mail data should be deleted.
@ -89,8 +89,9 @@ fi
(
flock -e 200
for EMAIL in "${@}"
do
ERROR=false
EMAIL="${*}"
# very simple plausibility check
[[ ${EMAIL} != *@*.* ]] && errex "No valid address: ${EMAIL}"
@ -158,6 +159,7 @@ use 'sudo docker exec mailserver rm -R /var/mail/${DOMAIN}/${USER}'"
fi
${ERROR} && errex 'See the messages above.'
done
) 200< "${DATABASE}"