Skip to main content

CLI to manage your vmail server (Dovecot, Postfix, MySQL)

Project description

vmail-cli

DISCLAIMER: THIS APPLICATION IS STILL IN ALPHA/BETA STATE. DO NOT USE IT IN PRODUCTIVE ENVIRONMENTS IF YOU DON'T WHAT YOU'RE DOING!

vmail-cli is a command line tool and library for managing a mail-server database based on the great HowTo from Thomas Leister written in Python 3. Although the tutorial is using a MySQL/MariaDB database, this command line tool also supports other backends.

Requirements

  • Python 3 (>= 3.7)

You should use a dedicated and non-privileged user account to run this CLI. You could also rely on the packages provided by your GNU/Linux distribution. On a Debian-based host, you can install the following packages:

  • python3-click
  • python3-passlib
  • python3-sqlalchemy, with python3-mysqldb to use a MySQL database or python3-psycopg2 for PostgreSQL
  • python3-tabulate
  • python3-yaml
  • python3-argon2 for Argon2 password hashing (optional)

Finally, you should follow the tutorial to have a working mail setup with Postfix and Dovecot. Note that the database tables will automatically be created by this CLI as needed.

Installation

Via pip

Install it with:

pip3 install --user vmail-cli

Manually (for development)

Clone this repository or download the sources on your local machine, and go into this directory.

Install all requirements with:

pip3 install -e .[test]

Configuration

You can create your local configuration thanks to the wizard:

vmail-cli config init

You will have to create the database and the user if it is not already done. For a MariaDB database, this can be done with:

CREATE DATABASE vmail;
GRANT ALL ON vmail.* TO 'vmail-cli'@'localhost' IDENTIFIED BY 'your-password';

Note that the local configuration is stored in a YAML file loaded by confuse. It should be located in $XDG_CONFIG_HOME/vmail/config.yaml or ~/.config/vmail/config.yaml on GNU/Linux. You could have a look at the default configuration for available parameters.

Usage

Use the --help argument to list available commands with their options:

vmail-cli --help

License

It started as a fork of vmail-manager written by Dominik Rimpf and licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vmail-cli-1.0.1.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

vmail_cli-1.0.1-py3-none-any.whl (10.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page