Resetting the Admin Account Password for Mail-in-a-Box: A Step-by-Step Guide

Mail-in-a-Box (MiAB) provides a convenient way to set up a self-hosted email server. However, in the heat of the moment, it’s easy to forget the admin email address or password. In this guide, we’ll walk you through the steps to recover your forgotten admin email address and password, so you can regain access to your Mail-in-a-Box server.

Step 1: SSH into the Virtual Machine

First, connect to your Virtual Private Server (VPS) or cloud instance where Mail-in-a-Box is installed using SSH.

Step 2: Login as the Root User or Switch to Superuser

Once you’re connected, login as the root user or use the sudo su command to switch to the superuser account. Make sure you’re in the /root/mailinabox directory before proceeding.

Step 3: Use the tools/mail.py Command to Manage Users

The tools/mail.py command is a powerful tool that allows you to manage users, including setting and retrieving passwords. To see the list of existing users, including the admin account, run the following command:

cd /root/mailinabox
tools/mail.py user

This will display a list of users, including the admin account. If you forgot the admin email address, you can use this command to list all the available users.

Step 4: Set a New Password for the Admin Account

To set a new password for the admin account, run the following command:

tools/mail.py user password [email protected]

Replace [email protected] with the admin email address you want to set or recover. When prompted, enter the new password and confirm it. This will set a new password for the admin account.

Step 5: Access the Admin Dashboard

With the new password set, you can now access the Mail-in-a-Box admin dashboard using the following URL:

https://box.yourdomain.com/admin

Replace box.yourdomain.com with the public IP address of your instance or the domain name you specified during the Mail-in-a-Box setup process.

Conclusion

In this guide, we’ve shown you how to recover your forgotten admin email address and password for Mail-in-a-Box. By following these simple steps, you should be able to regain access to your server and continue managing your email setup.

Remember to keep your admin email address and password secure to prevent unauthorized access to your server. If you have any further questions or concerns, feel free to reach out to the Mail-in-a-Box community or seek assistance from a qualified IT professional.