diff --git a/smtp-stub/hooks/smtp_server-relation-joined b/smtp-stub/hooks/smtp_server-relation-joined new file mode 100755 index 0000000..afa8654 --- /dev/null +++ b/smtp-stub/hooks/smtp_server-relation-joined @@ -0,0 +1,18 @@ +#!/bin/bash + +OPTS=( + host + port + connection-security + auth-method +) +for var in "${OPTS[@]}"; do + value=$(options-get "$var") && relation-set "$var" "$value" || exit 1 + case "$var:$value" in + auth-method:password) + login=$(options-get "login") && relation-set login "$login" || exit 1 + password=$(options-get "password") && relation-set password "$password" || exit 1 + ;; + esac +done + diff --git a/smtp-stub/metadata.yml b/smtp-stub/metadata.yml new file mode 100644 index 0000000..e5509fd --- /dev/null +++ b/smtp-stub/metadata.yml @@ -0,0 +1,11 @@ +type: stub + +provides: + smtp-server: + +default-options: + port: 25 + connection-security: none # "none", "starttls", "ssl/tls" + auth-method: plain # "none", "password" + user: + password: \ No newline at end of file