This is a simple tool to help manage accounting backends for simple mail servers (primarily tested with postfix/dovecot).
- Python 2.X (tested with 2.7)
Either clone locally by running:
git clone https://github.com/fim/pma
and then install if necessary:
python setup.py install
Or simply run:
pip install https://github.com/fim/pma/tarball/master
Initialize the database:
> pma init
Create domains:
> pma domain add
Create user accounts:
> pma user add
Create aliases:
> pma alias add
Create transport rules:
> pma transport add
List existing records:
> pma domain list
Delete existing records:
> pma domain delete
Currently sqlite3, mysql and psql are supported.
- SQLite3
Requires python compiled with sqlite support.
Example:
> pma -b sqlite -s "dbname=/etc/mail/mail.db" init
Initializing database
> pma -b sqlite -s "dbname=/etc/mail/mail.db" domain add
...
- MySQL
Requires python-mysql installed
Example:
> pma -b mysql -s "host=127.0.0.1;user=dbadmin;pass=dbpass;dbname=mail" init
Initializing database
> pma -b mysql -s "host=127.0.0.1;user=dbadmin;pass=dbpass;dbname=mail" domain add
...
- PSQL
Requires psycopg2 installed
Example:
> pma -b pgsql -s "host=127.0.0.1;user=dbadmin;pass=dbpass;dbname=mail" init
Initializing database
> pma -b pgsql -s "host=127.0.0.1;user=dbadmin;pass=dbpass;dbname=mail" domain add
...