2021-09-11 23:29:02 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
SCRIPT='setup'
|
|
|
|
|
|
|
|
set -euE -o pipefail
|
|
|
|
|
2022-05-10 15:50:33 +00:00
|
|
|
# shellcheck source=../scripts/helpers/index.sh
|
|
|
|
source /usr/local/bin/helpers/index.sh
|
|
|
|
|
2021-09-11 23:29:02 +00:00
|
|
|
function _usage
|
|
|
|
{
|
|
|
|
# shellcheck disable=SC2059
|
2022-05-10 15:50:33 +00:00
|
|
|
printf '%s' "${PURPLE}SETUP${RED}(${YELLOW}1${RED})
|
2021-09-11 23:29:02 +00:00
|
|
|
|
|
|
|
${ORANGE}NAME${RESET}
|
docs(chore): Normalize for consistency (#2206)
"Brief" summary/overview of changes. See the PR discussion or individual commits from the PR for more details.
---
Only applies to the `docs/content/**` content (_and `setup` command_). `target/` and `test/` can be normalized at a later date.
* Normalize to `example.com`
- Domains normalized to `example.com`: `mywebserver.com`, `myserver.tld`, `domain.com`, `domain.tld`, `mydomain.net`, `my-domain.tld`, `my-domain.com`, `example.org`, `whoami.com`.
- Alternative domains normalized to `not-example.com`: `otherdomain.com`, `otherdomain.tld`, `domain2.tld`, `mybackupmx.com`, `whoareyou.org`.
- Email addresses normalized to `admin@example.com` (in `ssl.md`): `foo@bar.com`, `yourcurrentemail@gmail.com`, `email@email.com`, `admin@domain.tld`.
- Email addresses normalized to `external-account@gmail.com`: `bill@gates321boom.com`, `external@gmail.com`, `myemail@gmail.com`, `real-email-address@external-domain.com`.
- **`faq.md`:** A FAQ entry title with `sample.domain.com` changed to `subdomain.example.com`.
- **`mail-fetchmail.md`:** Config examples with FQDNs for `imap`/`pop3` used `example.com` domain for a third-party, changed to `gmail.com` as more familiar third-party/external MTA.
* Normalize config volume path
- Normalizing local config path references to `./docker-data/dms/config/`: `./config/`, `config/`, \``config`\`, `/etc/` (_volume mount src path prefix_).
- Normalize DMS volume paths to `docker-data/dms/mail-{data,state,log}`: `./mail`, `./mail-state` `./data/mail`, `./data/state`, `./data/logs`, `./data/maildata`, `./data/mailstate`, `./data/maillogs`, (_dropped/converted data volumes: `maildata`, `mailstate`_).
- Other docker images also adopt the `docker-data/{service name}/` prefix.
* `ssl.md` - Use `dms/custom-certs` where appropriate.
* Apply normalizations to README and example `docker-compose.yml`
---
Common terms, sometimes interchangeably used or now invalid depending on context: `mail`, `mail container`, `mail server`, `mail-server`, `mailserver`,`docker-mailserver`, `Docker Mailserver`.
Rough transformations applied to most matches (_conditionally, depending on context_):
- 'Docker Mailserver' => '`docker-mailserver`'
- 'mail container' => '`docker-mailserver`' (_optionally retaining ' container'_)
- 'mail server' => 'mail-server' / '`docker-mailserver`'
- 'mail-server' => '`docker-mailserver`'
- 'mailserver' => 'mail-server' / '`docker-mailserver`'
Additionally I checked `docker run` (_plus `exec`, `logs`, etc, sub-commands_) and `docker-compose` commands. Often finding usage of `mail` instead of the expected `mailserver`
Additionally changes `mailserver` hostname in k8s to `mail` to align with other non-k8s examples.
---
* drive-by revisions
Mostly minor revisions or improvements to docs that aren't related to normalization effort.
2021-09-22 23:29:37 +00:00
|
|
|
${SCRIPT:-${0}} - 'docker-mailserver' Administration & Configuration script
|
2021-09-11 23:29:02 +00:00
|
|
|
|
|
|
|
${ORANGE}SYNOPSIS${RESET}
|
|
|
|
./${SCRIPT:-${0}} [ OPTIONS${RED}...${RESET} ] COMMAND [ help ${RED}|${RESET} ARGUMENTS${RED}...${RESET} ]
|
|
|
|
|
2022-05-07 22:28:32 +00:00
|
|
|
COMMAND ${RED}:=${RESET} { email ${RED}|${RESET} alias ${RED}|${RESET} quota ${RED}|${RESET} dovecot-master ${RED}|${RESET} config ${RED}|${RESET} relay ${RED}|${RESET} debug } SUBCOMMAND
|
2021-09-11 23:29:02 +00:00
|
|
|
|
|
|
|
${ORANGE}DESCRIPTION${RESET}
|
docs(chore): Normalize for consistency (#2206)
"Brief" summary/overview of changes. See the PR discussion or individual commits from the PR for more details.
---
Only applies to the `docs/content/**` content (_and `setup` command_). `target/` and `test/` can be normalized at a later date.
* Normalize to `example.com`
- Domains normalized to `example.com`: `mywebserver.com`, `myserver.tld`, `domain.com`, `domain.tld`, `mydomain.net`, `my-domain.tld`, `my-domain.com`, `example.org`, `whoami.com`.
- Alternative domains normalized to `not-example.com`: `otherdomain.com`, `otherdomain.tld`, `domain2.tld`, `mybackupmx.com`, `whoareyou.org`.
- Email addresses normalized to `admin@example.com` (in `ssl.md`): `foo@bar.com`, `yourcurrentemail@gmail.com`, `email@email.com`, `admin@domain.tld`.
- Email addresses normalized to `external-account@gmail.com`: `bill@gates321boom.com`, `external@gmail.com`, `myemail@gmail.com`, `real-email-address@external-domain.com`.
- **`faq.md`:** A FAQ entry title with `sample.domain.com` changed to `subdomain.example.com`.
- **`mail-fetchmail.md`:** Config examples with FQDNs for `imap`/`pop3` used `example.com` domain for a third-party, changed to `gmail.com` as more familiar third-party/external MTA.
* Normalize config volume path
- Normalizing local config path references to `./docker-data/dms/config/`: `./config/`, `config/`, \``config`\`, `/etc/` (_volume mount src path prefix_).
- Normalize DMS volume paths to `docker-data/dms/mail-{data,state,log}`: `./mail`, `./mail-state` `./data/mail`, `./data/state`, `./data/logs`, `./data/maildata`, `./data/mailstate`, `./data/maillogs`, (_dropped/converted data volumes: `maildata`, `mailstate`_).
- Other docker images also adopt the `docker-data/{service name}/` prefix.
* `ssl.md` - Use `dms/custom-certs` where appropriate.
* Apply normalizations to README and example `docker-compose.yml`
---
Common terms, sometimes interchangeably used or now invalid depending on context: `mail`, `mail container`, `mail server`, `mail-server`, `mailserver`,`docker-mailserver`, `Docker Mailserver`.
Rough transformations applied to most matches (_conditionally, depending on context_):
- 'Docker Mailserver' => '`docker-mailserver`'
- 'mail container' => '`docker-mailserver`' (_optionally retaining ' container'_)
- 'mail server' => 'mail-server' / '`docker-mailserver`'
- 'mail-server' => '`docker-mailserver`'
- 'mailserver' => 'mail-server' / '`docker-mailserver`'
Additionally I checked `docker run` (_plus `exec`, `logs`, etc, sub-commands_) and `docker-compose` commands. Often finding usage of `mail` instead of the expected `mailserver`
Additionally changes `mailserver` hostname in k8s to `mail` to align with other non-k8s examples.
---
* drive-by revisions
Mostly minor revisions or improvements to docs that aren't related to normalization effort.
2021-09-22 23:29:37 +00:00
|
|
|
This is the main administration script that you use for all your interactions with
|
|
|
|
'docker-mailserver'. Setup, configuration and much more is done with this script.
|
2021-09-11 23:29:02 +00:00
|
|
|
|
docs(chore): Normalize for consistency (#2206)
"Brief" summary/overview of changes. See the PR discussion or individual commits from the PR for more details.
---
Only applies to the `docs/content/**` content (_and `setup` command_). `target/` and `test/` can be normalized at a later date.
* Normalize to `example.com`
- Domains normalized to `example.com`: `mywebserver.com`, `myserver.tld`, `domain.com`, `domain.tld`, `mydomain.net`, `my-domain.tld`, `my-domain.com`, `example.org`, `whoami.com`.
- Alternative domains normalized to `not-example.com`: `otherdomain.com`, `otherdomain.tld`, `domain2.tld`, `mybackupmx.com`, `whoareyou.org`.
- Email addresses normalized to `admin@example.com` (in `ssl.md`): `foo@bar.com`, `yourcurrentemail@gmail.com`, `email@email.com`, `admin@domain.tld`.
- Email addresses normalized to `external-account@gmail.com`: `bill@gates321boom.com`, `external@gmail.com`, `myemail@gmail.com`, `real-email-address@external-domain.com`.
- **`faq.md`:** A FAQ entry title with `sample.domain.com` changed to `subdomain.example.com`.
- **`mail-fetchmail.md`:** Config examples with FQDNs for `imap`/`pop3` used `example.com` domain for a third-party, changed to `gmail.com` as more familiar third-party/external MTA.
* Normalize config volume path
- Normalizing local config path references to `./docker-data/dms/config/`: `./config/`, `config/`, \``config`\`, `/etc/` (_volume mount src path prefix_).
- Normalize DMS volume paths to `docker-data/dms/mail-{data,state,log}`: `./mail`, `./mail-state` `./data/mail`, `./data/state`, `./data/logs`, `./data/maildata`, `./data/mailstate`, `./data/maillogs`, (_dropped/converted data volumes: `maildata`, `mailstate`_).
- Other docker images also adopt the `docker-data/{service name}/` prefix.
* `ssl.md` - Use `dms/custom-certs` where appropriate.
* Apply normalizations to README and example `docker-compose.yml`
---
Common terms, sometimes interchangeably used or now invalid depending on context: `mail`, `mail container`, `mail server`, `mail-server`, `mailserver`,`docker-mailserver`, `Docker Mailserver`.
Rough transformations applied to most matches (_conditionally, depending on context_):
- 'Docker Mailserver' => '`docker-mailserver`'
- 'mail container' => '`docker-mailserver`' (_optionally retaining ' container'_)
- 'mail server' => 'mail-server' / '`docker-mailserver`'
- 'mail-server' => '`docker-mailserver`'
- 'mailserver' => 'mail-server' / '`docker-mailserver`'
Additionally I checked `docker run` (_plus `exec`, `logs`, etc, sub-commands_) and `docker-compose` commands. Often finding usage of `mail` instead of the expected `mailserver`
Additionally changes `mailserver` hostname in k8s to `mail` to align with other non-k8s examples.
---
* drive-by revisions
Mostly minor revisions or improvements to docs that aren't related to normalization effort.
2021-09-22 23:29:37 +00:00
|
|
|
Please note that this script executes most of its commands inside the container itself.
|
|
|
|
If it cannot find a running 'docker-mailserver' container, it will attempt to run one using
|
|
|
|
any available tags which include 'label=org.opencontainers.image.title=\"docker-mailserver\"'
|
2021-09-11 23:29:02 +00:00
|
|
|
and then run the necessary commands. If the tag for the container is not found, this script
|
2022-05-10 15:50:33 +00:00
|
|
|
will pull the '${LWHITE}:latest${RESET}' tag of '${LWHITE}docker.io/mailserver/docker-mailserver${RESET}'.
|
docs(chore): Normalize for consistency (#2206)
"Brief" summary/overview of changes. See the PR discussion or individual commits from the PR for more details.
---
Only applies to the `docs/content/**` content (_and `setup` command_). `target/` and `test/` can be normalized at a later date.
* Normalize to `example.com`
- Domains normalized to `example.com`: `mywebserver.com`, `myserver.tld`, `domain.com`, `domain.tld`, `mydomain.net`, `my-domain.tld`, `my-domain.com`, `example.org`, `whoami.com`.
- Alternative domains normalized to `not-example.com`: `otherdomain.com`, `otherdomain.tld`, `domain2.tld`, `mybackupmx.com`, `whoareyou.org`.
- Email addresses normalized to `admin@example.com` (in `ssl.md`): `foo@bar.com`, `yourcurrentemail@gmail.com`, `email@email.com`, `admin@domain.tld`.
- Email addresses normalized to `external-account@gmail.com`: `bill@gates321boom.com`, `external@gmail.com`, `myemail@gmail.com`, `real-email-address@external-domain.com`.
- **`faq.md`:** A FAQ entry title with `sample.domain.com` changed to `subdomain.example.com`.
- **`mail-fetchmail.md`:** Config examples with FQDNs for `imap`/`pop3` used `example.com` domain for a third-party, changed to `gmail.com` as more familiar third-party/external MTA.
* Normalize config volume path
- Normalizing local config path references to `./docker-data/dms/config/`: `./config/`, `config/`, \``config`\`, `/etc/` (_volume mount src path prefix_).
- Normalize DMS volume paths to `docker-data/dms/mail-{data,state,log}`: `./mail`, `./mail-state` `./data/mail`, `./data/state`, `./data/logs`, `./data/maildata`, `./data/mailstate`, `./data/maillogs`, (_dropped/converted data volumes: `maildata`, `mailstate`_).
- Other docker images also adopt the `docker-data/{service name}/` prefix.
* `ssl.md` - Use `dms/custom-certs` where appropriate.
* Apply normalizations to README and example `docker-compose.yml`
---
Common terms, sometimes interchangeably used or now invalid depending on context: `mail`, `mail container`, `mail server`, `mail-server`, `mailserver`,`docker-mailserver`, `Docker Mailserver`.
Rough transformations applied to most matches (_conditionally, depending on context_):
- 'Docker Mailserver' => '`docker-mailserver`'
- 'mail container' => '`docker-mailserver`' (_optionally retaining ' container'_)
- 'mail server' => 'mail-server' / '`docker-mailserver`'
- 'mail-server' => '`docker-mailserver`'
- 'mailserver' => 'mail-server' / '`docker-mailserver`'
Additionally I checked `docker run` (_plus `exec`, `logs`, etc, sub-commands_) and `docker-compose` commands. Often finding usage of `mail` instead of the expected `mailserver`
Additionally changes `mailserver` hostname in k8s to `mail` to align with other non-k8s examples.
---
* drive-by revisions
Mostly minor revisions or improvements to docs that aren't related to normalization effort.
2021-09-22 23:29:37 +00:00
|
|
|
This tag refers to the latest release, see the tagging convention in the README under:
|
2021-09-11 23:29:02 +00:00
|
|
|
${BLUE}https://github.com/docker-mailserver/docker-mailserver/blob/master/README.md${RESET}
|
|
|
|
|
|
|
|
You will be able to see detailed information about the script you're invoking and their
|
2022-05-10 15:50:33 +00:00
|
|
|
arguments by appending '${LWHITE}help${RESET}' after your command. Currently, this does not work with all scripts.
|
2021-09-11 23:29:02 +00:00
|
|
|
|
|
|
|
${RED}[${ORANGE}SUB${RED}]${ORANGE}COMMANDS${RESET}
|
|
|
|
${LBLUE}COMMAND${RESET} email ${RED}:=${RESET}
|
|
|
|
${0} email ${CYAN}add${RESET} <EMAIL ADDRESS> [<PASSWORD>]
|
|
|
|
${0} email ${CYAN}update${RESET} <EMAIL ADDRESS> [<PASSWORD>]
|
|
|
|
${0} email ${CYAN}del${RESET} [ OPTIONS${RED}...${RESET} ] <EMAIL ADDRESS> [ <EMAIL ADDRESS>${RED}...${RESET} ]
|
|
|
|
${0} email ${CYAN}restrict${RESET} <add${RED}|${RESET}del${RED}|${RESET}list> <send${RED}|${RESET}receive> [<EMAIL ADDRESS>]
|
|
|
|
${0} email ${CYAN}list${RESET}
|
|
|
|
|
|
|
|
${LBLUE}COMMAND${RESET} alias ${RED}:=${RESET}
|
|
|
|
${0} alias ${CYAN}add${RESET} <EMAIL ADDRESS> <RECIPIENT>
|
|
|
|
${0} alias ${CYAN}del${RESET} <EMAIL ADDRESS> <RECIPIENT>
|
|
|
|
${0} alias ${CYAN}list${RESET}
|
|
|
|
|
|
|
|
${LBLUE}COMMAND${RESET} quota ${RED}:=${RESET}
|
|
|
|
${0} quota ${CYAN}set${RESET} <EMAIL ADDRESS> [<QUOTA>]
|
|
|
|
${0} quota ${CYAN}del${RESET} <EMAIL ADDRESS>
|
|
|
|
|
2022-05-07 22:28:32 +00:00
|
|
|
${LBLUE}COMMAND${RESET} dovecot-master ${RED}:=${RESET}
|
|
|
|
${0} dovecot-master ${CYAN}add${RESET} <USERNAME> [<PASSWORD>]
|
|
|
|
${0} dovecot-master ${CYAN}update${RESET} <USERNAME> [<PASSWORD>]
|
|
|
|
${0} dovecot-master ${CYAN}del${RESET} [ OPTIONS${RED}...${RESET} ] <USERNAME> [ <USERNAME>${RED}...${RESET} ]
|
|
|
|
${0} dovecot-master ${CYAN}list${RESET}
|
|
|
|
|
2021-09-11 23:29:02 +00:00
|
|
|
${LBLUE}COMMAND${RESET} config ${RED}:=${RESET}
|
|
|
|
${0} config ${CYAN}dkim${RESET} [ ARGUMENTS${RED}...${RESET} ]
|
|
|
|
|
|
|
|
${LBLUE}COMMAND${RESET} relay ${RED}:=${RESET}
|
|
|
|
${0} relay ${CYAN}add-auth${RESET} <DOMAIN> <USERNAME> [<PASSWORD>]
|
2022-03-03 11:38:28 +00:00
|
|
|
${0} relay ${CYAN}add-domain${RESET} <DOMAIN> <HOST> [<PORT>]
|
2021-09-11 23:29:02 +00:00
|
|
|
${0} relay ${CYAN}exclude-domain${RESET} <DOMAIN>
|
|
|
|
|
2022-04-19 08:44:51 +00:00
|
|
|
${LBLUE}COMMAND${RESET} fail2ban ${RED}:=${RESET}
|
|
|
|
${0} fail2ban ${RESET}
|
|
|
|
${0} fail2ban ${CYAN}ban${RESET} <IP>
|
|
|
|
${0} fail2ban ${CYAN}unban${RESET} <IP>
|
|
|
|
|
2021-09-11 23:29:02 +00:00
|
|
|
${LBLUE}COMMAND${RESET} debug ${RED}:=${RESET}
|
2022-03-03 11:38:28 +00:00
|
|
|
${0} debug ${CYAN}fetchmail${RESET}
|
2021-09-11 23:29:02 +00:00
|
|
|
${0} debug ${CYAN}login${RESET} <COMMANDS>
|
2022-03-03 11:38:28 +00:00
|
|
|
${0} debug ${CYAN}show-mail-logs${RESET}
|
2021-09-11 23:29:02 +00:00
|
|
|
|
|
|
|
${ORANGE}EXAMPLES${RESET}
|
2022-05-10 15:50:33 +00:00
|
|
|
${LWHITE}./setup.sh email add test@example.com${RESET}
|
|
|
|
Add the email account ${LWHITE}test@example.com${RESET}. You will be prompted
|
2021-09-11 23:29:02 +00:00
|
|
|
to input a password afterwards since no password was supplied.
|
|
|
|
|
2022-05-10 15:50:33 +00:00
|
|
|
${LWHITE}./setup.sh config dkim keysize 2048 domain 'example.com,not-example.com'${RESET}
|
2021-09-11 23:29:02 +00:00
|
|
|
Creates keys of length 2048 but in an LDAP setup where domains are not known to
|
|
|
|
Postfix by default, so you need to provide them yourself in a comma-separated list.
|
|
|
|
|
2022-05-10 15:50:33 +00:00
|
|
|
${LWHITE}./setup.sh config dkim help${RESET}
|
|
|
|
This will provide you with a detailed explanation on how to use the ${LWHITE}
|
2021-09-11 23:29:02 +00:00
|
|
|
config dkim${RESET} command, showing what arguments can be passed and what they do.
|
|
|
|
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
|
|
|
function _invalid_command
|
|
|
|
{
|
|
|
|
echo "The command '${*}' is invalid.
|
|
|
|
Use \`./setup.sh help\` to get an overview of all commands." >&2
|
|
|
|
exit 2
|
|
|
|
}
|
|
|
|
|
|
|
|
function _main
|
|
|
|
{
|
|
|
|
case ${1:-} in
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( email )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( add ) shift 2 ; addmailuser "${@}" ;;
|
|
|
|
( update ) shift 2 ; updatemailuser "${@}" ;;
|
|
|
|
( del ) shift 2 ; delmailuser "${@}" ;;
|
|
|
|
( restrict ) shift 2 ; restrict-access "${@}" ;;
|
|
|
|
( list ) listmailuser ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( alias )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( add ) shift 2 ; addalias "${1}" "${2}" ;;
|
|
|
|
( del ) shift 2 ; delalias "${1}" "${2}" ;;
|
|
|
|
( list ) shift 2 ; listalias ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( quota )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( set ) shift 2 ; setquota "${@}" ;;
|
|
|
|
( del ) shift 2 ; delquota "${@}" ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2022-05-07 22:28:32 +00:00
|
|
|
( dovecot-master )
|
|
|
|
case ${2:-} in
|
|
|
|
( add ) shift 2 ; adddovecotmasteruser "${@}" ;;
|
|
|
|
( update ) shift 2 ; updatedovecotmasteruser "${@}" ;;
|
|
|
|
( del ) shift 2 ; deldovecotmasteruser "${@}" ;;
|
|
|
|
( list ) listdovecotmasteruser ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( config )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( dkim ) shift 2 ; open-dkim "${@}" ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( relay )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( add-domain ) shift 2 ; addrelayhost "${@}" ;;
|
|
|
|
( add-auth ) shift 2 ; addsaslpassword "${@}" ;;
|
|
|
|
( exclude-domain ) shift 2 ; excluderelaydomain "${@}" ;;
|
|
|
|
( * ) _invalid_command "${1}" "${2}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2022-04-19 08:44:51 +00:00
|
|
|
( fail2ban ) shift 1 ; fail2ban "${@}" ;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( debug )
|
2021-09-11 23:29:02 +00:00
|
|
|
case ${2:-} in
|
2021-09-19 14:47:08 +00:00
|
|
|
( fetchmail ) debug-fetchmail ;;
|
|
|
|
( show-mail-logs ) cat /var/log/mail/mail.log ;;
|
|
|
|
( login )
|
2021-09-11 23:29:02 +00:00
|
|
|
shift 2
|
|
|
|
if [[ -z ${1:-} ]]
|
|
|
|
then
|
|
|
|
/bin/bash
|
|
|
|
else
|
|
|
|
/bin/bash -c "${@}"
|
|
|
|
fi
|
|
|
|
;;
|
2021-09-19 14:47:08 +00:00
|
|
|
( * ) _invalid_command "${*}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2021-09-19 14:47:08 +00:00
|
|
|
( help ) _usage ;;
|
|
|
|
( * ) _invalid_command "${*}" ;;
|
2021-09-11 23:29:02 +00:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2022-04-18 13:28:12 +00:00
|
|
|
if [[ -z ${1:-} ]]
|
|
|
|
then
|
|
|
|
_usage
|
|
|
|
else
|
|
|
|
_main "${@}"
|
|
|
|
fi
|