Metadata-Version: 2.1
Name: mailserver-admin
Version: 0.9.0
Summary: Webapp to manage mail server domains, users and aliases.
Home-page: https://github.com/jrd/mailserver-admin
Author: Cyrille Pontvieux
Author-email: cyrille@enialis.net
License: MIT
Project-URL: Source, https://github.com/jrd/mailserver-admin
Project-URL: Docker, https://hub.docker.com/repository/docker/jrdasm/mailserver-admin
Keywords: email mail domain admin
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django :: 3.1
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Communications :: Email
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: django (~=3.1)
Requires-Dist: fontawesome-free (~=5.14)
Requires-Dist: pycryptodome (~=3.0)
Requires-Dist: dnspython (~=1.0)
Provides-Extra: mysql
Requires-Dist: mysqlclient (~=2.0) ; extra == 'mysql'
Provides-Extra: postgresql
Requires-Dist: psycopg2-binary (~=2.8) ; extra == 'postgresql'

mailserver-admin
================

This application manages *domains*, *users* and *aliases* of a mail server.

This has been tested with **dovecot**, using either mysql or postgresql database.

The main goal was to enhance/replace [Jeffrey Boehm’s PHP mailserver-admin application](https://github.com/jeboehm/mailserver-admin) because I didn’t want to have a mail server administration application in PHP and I wanted to have administration account per domain.

Environment variables
---------------------

Required:

- `DJANGO_SECRET_KEY`: at least 40 characters. Should be specified for production.
- `DJANGO_DB_TYPE`: `postgres` or `mysql`, default to `mysql`.
- `DJANGO_DB_HOST`: database hostname, default to `db` (for use in docker-compose).
- `DJANGO_DB_PORT`: database port, default to empty (default port).
- `DJANGO_DB_NAME`: database name, default to `mailserver`.
- `DJANGO_DB_USER`: database user, default to `mailserver`.
- `DJANGO_DB_PASSWORD`: database password, default to `changeme`.

Optional:
- `DJANGO_DEBUG`: default `False`. Set to `True` to enable debug toolbar, more logs and static files served.
- `DJANGO_LOG_LEVEL`: default to `WARNING` (`INFO` if `DJANGO_DEBUG`).
- `DJANGO_RUNSERVER_LOG_LEVEL`: default to `INFO` (`DEBUG` if `DJANGO_DEBUG`). Used only when run with `runserver` or `runserver_plus`.
- `DJANGO_TZ`: timezone, defaut to `UTC`.
- `DJANGO_WEBMAIL_URL`: webmail url to show in the footer, default to no link.
- `DJANGO_VENDOR_NAME`: any vendor name you want to appear on the footer, default to *Sources*.
- `DJANGO_VENDOR_URL`: any url you want to be linked to your vendor name, default to this repository url. Set to empty to disable the link.
- `DJANGO_HIDE_VERSION`: default `False` if `DJANGO_DEBUG` else `True`. Set to `True` to hide the `mailserver-admin` version.

Install from PyPi
-----------------

### VirtualEnv and Dependencies

Minium python version is **3.9**.

Use:

```sh
pipenv install mailserver-admin
```

to install it without any database backend.

If you want to install the `mysql` or `postgresql` database backend alongside, use for instance:

```sh
pipenv install mailserver-admin[mysql]
```

### Configuration

Define the required environment variables then:

```sh
export DJANGO_SETTINGS_MODULE=mailserveradmin.config.settings
pipenv run django migrate
pipenv run django createsuperuser
TODO
```

You can now server the application using any **WSGI** server pointing to `$(VISUAL='readlink -f' pipenv open mailserveradmin|tail -n1)/config/wsgi.py`.

Don’t forget to also serve static ressources located at `$(VISUAL='readlink -f' pipenv open mailserveradmin|tail -n1)/to_serve` folder.

You can of course make symlinks to those locations to simplify configuration.

Install from sources
--------------------

### VirtualEnv and Dependencies

Use:

```sh
pipenv sync -d
```

to install dependencies. Default python version is **3.9**.

### Installation

You should also install a database driver, either `mysqlclient` or `psycopg2-binary`:

```sh
pipenv run pip install mysqlclient
```

### Configuration

Define the required environment variables then:

```sh
pipenv run ./manage.py migrate
pipenv run ./manage.py createsuperuser
pipenv run ./manage.py collectstatic
```

You can now server the application using any **WSGI** server pointing to the `config/wsgi.py` file.

Don’t forget to also serve the `static/` folder.

Alternatively, you can test the application with `pipenv run ./manage.py runserver_plus` but this should only be used for testing/development.


