2020-06-09 20:40:40 +00:00
[`setup.sh` ](https://github.com/tomav/docker-mailserver/blob/master/setup.sh ) is an administration script that helps with the most common tasks, including initial configuration. It is intented to be used from the host machine, _not_ from within your running container.
2020-06-09 20:39:39 +00:00
2020-06-09 20:42:44 +00:00
The latest version of the script is included in the `docker-mailserver` repository. You may retrieve it at any time by running this command in your console:
2016-08-29 19:51:09 +00:00
2020-06-09 20:37:53 +00:00
```sh
2016-08-29 19:51:09 +00:00
wget -q -O setup.sh https://raw.githubusercontent.com/tomav/docker-mailserver/master/setup.sh; chmod a+x ./setup.sh
```
2020-06-09 20:37:53 +00:00
Or if you use curl:
```sh
2017-03-17 22:34:05 +00:00
curl -o setup.sh https://raw.githubusercontent.com/tomav/docker-mailserver/master/setup.sh; chmod a+x ./setup.sh
```
2016-08-29 19:51:09 +00:00
2020-06-09 20:42:44 +00:00
## Usage
Run `./setup.sh` without arguments and you'll get some usage information:
2016-08-29 19:51:09 +00:00
2020-06-09 20:37:53 +00:00
```sh
2016-12-03 00:11:25 +00:00
Usage: ./setup.sh [-i IMAGE_NAME] [-c CONTAINER_NAME] < subcommand > < subcommand > [args]
OPTIONS:
-i IMAGE_NAME The name of the docker-mailserver image, by default
'tvial/docker-mailserver:latest'.
-c CONTAINER_NAME The name of the running container.
2016-08-29 19:51:09 +00:00
SUBCOMMANDS:
email:
./setup.sh email add < email > < password >
2018-01-30 17:05:00 +00:00
./setup.sh email update < email > < password >
2016-08-29 19:51:09 +00:00
./setup.sh email del < email >
2018-02-08 07:32:56 +00:00
./setup.sh email restrict < add | del | list > < send | receive > [< email > ]
2016-08-29 19:51:09 +00:00
./setup.sh email list
2017-05-13 18:15:04 +00:00
alias:
./setup.sh alias add < email > < recipient >
./setup.sh alias del < email > < recipient >
./setup.sh alias list
2020-04-25 21:32:25 +00:00
quota:
./setup.sh quota set < email > [< quota > ]
./setup.sh quota del < email >
2016-08-29 19:51:09 +00:00
config:
2018-03-06 13:00:37 +00:00
./setup.sh config dkim < keysize > (default: 2048)
2016-08-29 19:51:09 +00:00
./setup.sh config ssl
debug:
./setup.sh debug fetchmail
2016-12-03 00:11:25 +00:00
./setup.sh debug show-mail-logs
./setup.sh debug inspect
./setup.sh debug login < commands >
2016-08-29 19:51:09 +00:00
```
2020-06-09 20:37:53 +00:00
## email
2018-03-01 08:32:21 +00:00
* `./setup.sh email add <email> [<password>]` : Add an email-account (\<password\> is optional)
* `./setup.sh email update <email> [<password>]` : Change the password of an email-account (\<password\> is optional)
2020-05-29 03:35:34 +00:00
* `./setup.sh email del <email>` : delete an email-account
2018-03-01 08:32:21 +00:00
* `./setup.sh email restrict <add|del|list> <send|receive> [<email>]` : deny users to send or receive mail. You can also list the respective denied mail-accounts.
2018-01-30 17:05:00 +00:00
* `./setup.sh email list` : list all existing email-accounts
2020-06-09 20:37:53 +00:00
## alias
2018-01-30 17:05:00 +00:00
* `./setup.sh alias add <email> <recipient>` : add an alias(email) for an email-account(recipient)
* `./setup.sh alias del <email> <recipient>` : delete an alias
* `./setup.sh alias list` : list all aliases
2020-06-09 20:37:53 +00:00
## quota
2020-04-25 21:32:25 +00:00
* `./setup.sh quota set <email> [<quota>]` : define the quota of a mailbox (quota format e.g. 302M (B (byte), k (kilobyte), M (megabyte), G (gigabyte) or T (terabyte)))
* `./setup.sh quota del <email>` : delete the quota of a mailbox
2020-06-09 20:37:53 +00:00
## config
2018-03-06 13:00:37 +00:00
* `./setup.sh config dkim <keysize> (default: 2048)` : autoconfig the dkim-config with an (optional) keysize value
2018-01-30 17:05:00 +00:00
* `./setup.sh config ssl` : generate ssl-certificates
2020-06-09 20:37:53 +00:00
## debug
2018-01-30 17:05:00 +00:00
* `./setup.sh debug fetchmail` : see [wiki ](https://github.com/tomav/docker-mailserver/wiki/Retrieve-emails-from-a-remote-mail-server-%28using-builtin-fetchmail%29#debugging )
2018-02-01 08:36:13 +00:00
* `./setup.sh debug fail2ban <unban> <ip-address>` : omitt all options to get a list of banned IPs, otherwise unban the specified IP.
2018-01-30 17:05:00 +00:00
* `./setup.sh debug show-mail-logs` : show the logfile contents of the mail container
* `./setup.sh debug inspect` : show infos about the running container
2020-03-15 05:59:58 +00:00
* `./setup.sh debug login <commands>` : run a command inside the mail container (omit the command to get shell access)
2016-08-29 19:51:09 +00:00