diff --git a/bootstrap/email/README.md b/bootstrap/email/README.md index cf7102d..7d9c175 100644 --- a/bootstrap/email/README.md +++ b/bootstrap/email/README.md @@ -24,7 +24,7 @@ export LAB_EMAIL_DOMAIN=example.org export LAB_EMAIL_NSG_IDS='["ocid1.networksecuritygroup..."]' ./jeannie email-vm plan ./jeannie email-vm apply -./jeannie email-vm setup +./jeannie email-vm setup [--domain example.org] ``` `email-vm setup` defaults to the Ubuntu `ubuntu` account and the local diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index 2047947..d5bc354 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -3292,7 +3292,16 @@ email_vm_manage() { local email_action="${1}" shift || true case "${email_action}" in - setup) LAB_EMAIL_DOMAIN="${LAB_EMAIL_DOMAIN:-}" LAB_EMAIL_OPEN_MAIL_PORTS="${LAB_EMAIL_OPEN_MAIL_PORTS:-false}" "${REPO_ROOT}/scripts/email-server" install ;; + setup) + while (($# > 0)); do + case "$1" in + --domain) export LAB_EMAIL_DOMAIN="${2:-}"; shift 2 ;; + --open-mail-ports) export LAB_EMAIL_OPEN_MAIL_PORTS=true; shift ;; + *) echo "Usage: ./jeannie email-vm setup [--domain DOMAIN] [--open-mail-ports]" >&2; return 2 ;; + esac + done + LAB_EMAIL_DOMAIN="${LAB_EMAIL_DOMAIN:-}" LAB_EMAIL_OPEN_MAIL_PORTS="${LAB_EMAIL_OPEN_MAIL_PORTS:-false}" "${REPO_ROOT}/scripts/email-server" install + ;; status-server) "${REPO_ROOT}/scripts/email-server" status ;; esac return