1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00
Mailu/docs/cli.rst
Florent Daigniere 7137ba6ff1 Misc improvements to PASSWORD_SCHEME
- remove PASSWORD_SCHEME altogether
- introduce CREDENTIAL_ROUNDS
- migrate all old hashes to the current format
- auto-detect/enable all hash types that passlib supports
- upgrade passlib to 1.7.4 (see #1706: ldap_salted_sha512 support)
2021-03-09 12:04:42 +01:00

121 lines
2.3 KiB
ReStructuredText

Mailu command line
==================
Managing users and aliases can be done from CLI using commands:
* alias
* alias-delete
* domain
* password
* user
* user-import
* user-delete
* config-update
alias
-----
.. code-block:: bash
docker-compose exec admin flask mailu alias foo example.net "mail1@example.com,mail2@example.com"
alias-delete
------------
.. code-block:: bash
docker-compose exec admin flask mailu alias-delete foo@example.net
domain
------
.. code-block:: bash
docker-compose exec admin flask mailu domain example.net
password
--------
.. code-block:: bash
docker-compose exec admin flask mailu password myuser example.net 'password123'
user
----
.. code-block:: bash
docker-compose exec admin flask mailu user myuser example.net 'password123'
user-import
-----------
primary difference with simple `user` command is that password is being imported as a hash - very useful when migrating users from other systems where only hash is known.
.. code-block:: bash
docker-compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT'
user-delete
------------
.. code-block:: bash
docker-compose exec admin flask mailu user-delete foo@example.net
config-update
-------------
The sole purpose of this command is for importing users/aliases in bulk and synchronizing DB entries with external YAML template:
.. code-block:: bash
cat mail-config.yml | docker-compose exec -T admin flask mailu config-update --delete-objects
where mail-config.yml looks like:
.. code-block:: bash
users:
- localpart: foo
domain: example.com
password_hash: klkjhumnzxcjkajahsdqweqqwr
aliases:
- localpart: alias1
domain: example.com
destination: "user1@example.com,user2@example.com"
without ``--delete-object`` option config-update will only add/update new values but will *not* remove any entries missing in provided YAML input.
Users
-----
following are additional parameters that could be defined for users:
* comment
* quota_bytes
* global_admin
* enable_imap
* enable_pop
* forward_enabled
* forward_destination
* reply_enabled
* reply_subject
* reply_body
* displayed_name
* spam_enabled
* spam_threshold
Alias
-----
additional fields:
* wildcard