1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00

chasquid-util: Add domaininfo-remove

This patch adds a chasquid-util subcommand to remove a domain
information entry.

The main use case is to manually allow a security level downgrade, after
performing manual verification.
This commit is contained in:
Alberto Bertogli
2018-05-20 12:18:44 +01:00
parent a177fec7c3
commit 4373f56a82
4 changed files with 55 additions and 9 deletions

View File

@@ -19,8 +19,9 @@ function check_userdb() {
}
mkdir -p .config/domains/domain
touch .config/chasquid.conf
mkdir -p .config/domains/domain/ .data/domaininfo
rm -f .config/chasquid.conf
echo 'data_dir: ".data"' >> .config/chasquid.conf
if ! r print-config > /dev/null; then
echo print-config failed
@@ -54,6 +55,16 @@ if r authenticate user@domain --password=passwd > /dev/null; then
exit 1
fi
touch '.data/domaininfo/s:dom%C3%A1in'
if ! r domaininfo-remove domáin; then
echo domaininfo-remove failed
exit 1
fi
if [ -f '.data/domaininfo/s:dom%C3%A1in' ]; then
echo domaininfo-remove did not remove file
exit 1
fi
echo "alias: user@somewhere" > .config/domains/domain/aliases
A=$(r aliases-resolve alias@domain | grep somewhere)
if [ "$A" != "(email) user@somewhere" ]; then