This guide explains how to manage user quotas and view server statistics using maddy commands.
/admin/
— no command line required.
You can manage user storage quotas using the maddy imap-acct quota subcommands.
Display the used space and maximum allowance for a specific user.
Set a custom storage limit for a user (e.g., 1GB, 500MB, or 10KB).
Remove the user's custom quota and revert to the system default. The user's account creation date is preserved.
Set the default storage limit for all users without a custom quota. This value is stored in the database and takes priority over the maddy.conf setting.
Display all users with their used space and quota limits. The list shows whether each user's quota is custom or inherited from the system default.
Commands for managing server load and freeing space by removing user data.
Remove all pending messages in the send queue related to a specific user (sender or recipient). Useful for clearing queue jams caused by spam or large messages.
Delete all emails for a user from all mailboxes (Inbox, Sent, etc.) without deleting the account or quota settings. Useful for quickly freeing disk space.
Delete all emails across the entire server for all users. This clears all email data while keeping user accounts, passwords, and quotas intact.
Delete all emails marked as read (Seen) across the entire server. New unread messages are preserved. Helps optimize space without losing new messages.
Delete unread messages older than the specified duration (e.g., 30 days). Useful for cleaning up old emails that users never opened.
You can open or close new user registration. When closed, only users with existing accounts can log in.
JIT registration allows the server to automatically create user accounts on the first login attempt. You can manage this feature independently of the overall registration setting.
When enabled, accounts are automatically created on the first login or when the first email is received.
When disabled, accounts can only be created via the API (web interface) and login with unregistered credentials is rejected.
You can enable or disable the call server (TURN) for all users. When disabled, call information is not shown on the info page.
You can enable or disable server logging. When disabled, no information about user activity is recorded.
For user privacy and to prevent storing activity information.
You can change the language of the web interface. Supported languages: English (en), Farsi (fa), Russian (ru), Spanish (es). Changes take effect immediately without a restart.
Switch the website to a different language.
Remove the database override and revert to the language configured in maddy.conf.
Ports and service settings (such as hostname, secret, relay IP, etc.) can be managed through the Admin API. These settings are stored in the database and take priority over the configuration file values.
To manage these settings, use the Admin API. The relevant endpoints are documented in the "Port Settings" and "Configuration Settings" sections of the API docs.
Madmail server can operate in stealth mode for enhanced security. In this mode, only essential ports remain open to the outside world.
Essential ports:
Other ports (such as 25, 143, 587, 993) can be closed via firewall for public access. Users connect to all services through the Shadowsocks proxy configured in the app, keeping your server hidden from internet scanners.
The Admin API is enabled by default. To completely disable it via the configuration file for enhanced security, set the following option in maddy.conf under the chatmail section.
Set admin_token to disabled:
After saving the file, restart the maddy service. This will disable all web admin panel and Admin API functionality.
The internal DNS cache system allows you to redirect outgoing email routing to custom servers without changing the OS DNS settings. Rewrite rules are stored in the main program database (the storage database). Changes take effect immediately without server restart.
Display all DNS rewrite rules stored in the database.
Set a DNS rewrite rule. If a rule already exists for this address, it will be updated.
Examples:
Display details of a DNS rewrite rule including source address, target, comments, and creation time.
Remove a DNS rewrite rule. After removal, emails will be routed through normal OS DNS.
Display total storage used on the server and the number of active user accounts.
The maddy status command shows the real-time server status. This includes active IMAP connections, TURN relays (voice/video calls), Shadowsocks, registered users, and uptime.
Display server status summary including active connections, registered users, boot time, and uptime.
Sample output:
IMAP connections: 27 unique IPs: 7 TURN relays: 1 Shadowsocks connections: 0 unique IPs: 0 Registered users: 42 Boot time: 2026-02-16 20:56:19 (up 5m 24s) Email servers seen (since last restart): Connection IPs: 1 Domain servers: 1 IP servers: 0
Use the --details (or -d) flag to see connection details broken down by port.
Sample output:
PORT PROTO TYPE CONNECTIONS UNIQUE IPs 993 tcp IMAP TLS 25 7 143 tcp IMAP 0 0 3478 udp TURN UDP 1 relays - 3478 tcp TURN TCP 0 0 8388 tcp Shadowsocks 0 0 443 tcp ALPN (chatmail) 3 1