Note
Mailcow Tools is still in very early development. A lot of features are still missing and the code structure is not final at all.
Mailcow is a great option to run your very own mailserver. It comes with tons of features and one of them is the REST API. The API is the counterpart of this tool.
Mailcow Tools allows you to manage any Mailcow instance right from the terminal. But it does not just map the REST routes to commands - it also comes with some handy additions, like batch creation of mailboxes.
- Clone this repository:
git clone git@github.com:zion-networks/mailcow-tools.git
- Move to the directory:
cd mailcow-tools
- Make it a venv:
python3 -m venv .
- Activate the venv:
source bin/activate
- Install the required packages
pip install -r requirements.txt
- (Optional) Enable bash autocompletion:
source bash_autocomplete.sh
- Use it:
./mailcow-tools.sh help
You can either create a .env
file or use global environment variables. Currently, Mailcow Tools knows these environment variables:
- MAILCOW_TOOLS_MAILCOW_API_KEY=place-your-api-key-here (you can get your API key from your Mailcow web interface: https://mail.mymailcowhost.tld/admin)
- MAILCOW_TOOLS_MAILCOW_HOST=mail.mymailcowhost.tld
- MAILCOW_TOOLS_VALIDATE_CERTIFICATE=true (only use
false
if you really know, what you do) - MAILCOW_TOOLS_LOG_LEVEL=INFO (Supported:
DEBUG
,INFO
,WARNING
,ERROR
)
The help
command will list you all available modules. Using ./mailcow-tools.sh help <module>
you can also see the help for a specific module.