Metadata-Version: 2.1
Name: vmail-cli
Version: 1.0.1
Summary: CLI to manage your vmail server (Dovecot, Postfix, MySQL)
Home-page: https://framagit.org/jlebleu/vmail-cli
Author: Jerome Lebleu
Author-email: jerome@maroufle.fr
License: MIT
Project-URL: Bug Tracker, https://framagit.org/jlebleu/vmail-cli/-/issues
Project-URL: Source Code, https://framagit.org/jlebleu/vmail-cli
Keywords: vmail,postfix,dovecot
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Email
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: click (>=7.0)
Requires-Dist: confuse (>=1.0)
Requires-Dist: passlib (>=1.7)
Requires-Dist: sqlalchemy (>=1.2)
Requires-Dist: tabulate (>=0.8)
Provides-Extra: test
Requires-Dist: black ; extra == 'test'
Requires-Dist: flake8-black ; extra == 'test'
Requires-Dist: flake8-isort ; extra == 'test'
Requires-Dist: flake8 (>=3.5) ; extra == 'test'
Requires-Dist: isort (>=5.0) ; extra == 'test'

# 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](https://thomas-leister.de/en/mailserver-debian-stretch)
from [Thomas Leister](https://thomas-leister.de) 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:

```sh
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:

```sh
pip3 install -e .[test]
```

## Configuration

You can create your local configuration thanks to the wizard:

```sh
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:

```sql
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](https://yaml.org/) file
loaded by [confuse](https://confuse.readthedocs.io/en/latest/usage.html#search-paths).
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](vmail/config_default.yaml) for available parameters.

## Usage

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

```sh
vmail-cli --help
```

## License

It started as a fork of [`vmail-manager`](https://pypi.org/project/vmail-manager/)
written by Dominik Rimpf and licensed under the [MIT License](LICENSE).


