feat: added the script that was used to get stuff abck online after Nixos Mailserver migration 3

This commit is contained in:
silver 2025-09-20 23:40:43 +01:00
parent 513d0958f3
commit ff82802e16
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# After running Migration 3 (https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#dovecot-mail-directory-migration)
# For some reason dovecot was putting items into /var/vmail/ldap/$USERNAME@skynet.ie instead of /var/vmail/skynet.ie/$USERNAME
# Whats more it was expecting to see items there so email clients were erroring out (seeing empty inboxes).
# This could be due to the extra commits we have on top of the main nixos mailserver
# This might be the case since migration 2 mentions teh /var/vmail/ldap folder as not being desired
for f in *; do
if [ -d "$f" ]; then
echo "$f"
mkdir -p "/var/vmail/ldap/$f@skynet.ie/"
# hardlink "copy", can delete the original folder afterwards
cp -rlp /var/vmail/skynet.ie/$f/* "/var/vmail/ldap/$f@skynet.ie"
fi
done