File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -51,21 +51,28 @@ for maildir in "${storage}"/mail/*; do
51
51
fi
52
52
done
53
53
54
- # output actions
55
54
if [[ ${# users[@]} -eq 0 ]]; then
56
- echo " Nothing to be done ."
55
+ echo " Nothing to clean up ."
57
56
exit 0
58
57
fi
58
+
59
+ # is roundcube webmail in use?
60
+ webmail=false
61
+ docker compose exec webmail test -e /data/roundcube.db 2> /dev/null && webmail=true
62
+
63
+ # output actions
59
64
if ${unknown} ; then
60
65
echo " # To delete maildirs unknown to mailu, run:"
61
66
for email in " ${! users[@]} " ; do
62
67
[[ " ${users[${email}]} " == " unknown" ]] || continue
63
- echo " rm -rf '${storage} /mail/${email} '"
68
+ echo -n " rm -rf '${storage} /mail/${email} '"
69
+ ${webmail} && \
70
+ echo -n " && docker compose exec -T webmail su mailu -c \" /var/www/roundcube/bin/deluser.sh --host=front '${email} '\" "
71
+ echo
64
72
done
65
73
echo
66
74
fi
67
75
if ${disabled} ; then
68
- webmail=true; docker compose ps webmail & > /dev/null || webmail=false
69
76
echo " # To purge disabled users, run:"
70
77
for email in " ${! users[@]} " ; do
71
78
[[ " ${users[${email}]} " == " disabled" ]] || continue
@@ -76,4 +83,3 @@ if ${disabled}; then
76
83
done
77
84
echo
78
85
fi
79
-
You can’t perform that action at this time.
0 commit comments