User Administrationยถ
Promoting an OIDC User to Admin ๐งโ๐ผยถ
If your administrator logs in via OpenID Connect (OIDC) and you donโt want to create a separate local user, you can promote the existing OIDC-authenticated user to a global admin directly in the Mailu database using the CLI.
Follow these steps:
Enter the Mailu
admin
container shell:docker exec -it mailu-admin-1 flask shell
Inside the interactive shell, run the following commands:
from mailu import models, db user = models.User.query.filter_by(email='admin@example.com').first() user.global_admin = True db.session.commit()
Replace
admin@example.com
with the OIDC email address used to log in.Exit the shell:
exit()
Your OIDC-authenticated user is now a full global admin and has access to all administrative functions in the Mailu interface.
๐ก Tip: This method is useful when youโre using federated login and want to avoid managing separate local admin credentials.
Klar! Hier ist die Anleitung zur รnderung der primรคren Domain eines Mailu-Benutzers, speziell fรผr MariaDB als Datenbank-Backend, auf Englisch und im gleichen Stil wie deine Doku:
Changing the Primary Domain of a Mailu Account (MariaDB) ๐ยถ
Mailu links user accounts to specific domains, so changing a userโs primary domain cannot be done via the admin interface. You need to update it manually via the database.
โ ๏ธ Warning: Always back up your database before performing manual operations.
Steps for MariaDB:ยถ
Connect to the Mailu MariaDB container:
docker compose exec -it database mariadb -u mailu -p
Enter the password when prompted (you can find it in your
docker-compose.yml
or.env
file).Select the Mailu database (usually named
mailu
):USE mailu;
Update the userโs domain and email:
UPDATE user SET email='newname@newdomain.com', domain_name='newdomain.com' WHERE email='oldname@olddomain.com';
If needed, also update the local part (username):
UPDATE user SET localpart='newname' WHERE email='newname@newdomain.com';
If the new domain does not exist yet, insert it into the
domain
table:INSERT INTO domain (name, max_users, max_aliases, max_quota_bytes, comment, enabled) VALUES ('newdomain.com', 100, 100, 10737418240, 'New domain', true);
If the user had aliases, update the
alias
table accordingly.
Alternative: Recreate the Userยถ
If you prefer not to modify the database manually:
Delete the old user via the admin UI
Create a new user under the desired domain
Migrate emails using IMAP tools (e.g.
imapsync
)
Update DNS and Mailu Configurationยถ
Ensure that the new domain is correctly set up:
Add it to
HOSTNAMES
in yourdocker-compose.yml
Set up proper DNS records (MX, SPF, DKIM, DMARC)
If using Letโs Encrypt (
TLS_FLAVOR=cert
), make sure the domain is included inLETSENCRYPT_HOSTS
๐ก Tip: Mailu must be aware of the domain both in its configuration and the database for mail routing and certificate issuance to work correctly.
Wenn du willst, kann ich dir das gleich in eine fertige Markdown-Datei oder ein Doku-Format einfรผgen.