Last active
March 15, 2018 22:26
-
-
Save sanderson/afd05daaf01fc5c9edde61f49abeaa33 to your computer and use it in GitHub Desktop.
Configuring Nanobox to Use nullmailer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add nullmailer as an extra package | |
run.config: | |
... | |
extra_packages: | |
- nullmailer | |
# curl the setup-nullmailer script and run it as a transform hook | |
deploy.config: | |
transform: | |
- bash <(curl -sL https://git.io/vAgf3) | |
# start the nullmailer server in whatever component(s) is/are sending mail | |
web.site: | |
start: | |
mail: /data/libexec/nullmailer/nullmailer-send |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SMTP_HOST=smtp-host | |
SMTP_PORT=smtp-port | |
SMTP_USER=smtp-username | |
SMTP_PASS=smtp-password | |
SMTP_TLS=tls|ssl | |
SMTP_AUTH=login|plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ln -sf /data/libexec/nullmailer/sendmail /data/bin/ | |
mkdir -p /data/var/spool/nullmailer/{failed,queue} | |
mkfifo /data/var/spool/nullmailer/trigger | |
echo "${APP_NAME}" > /data/etc/nullmailer/defaulthost | |
echo "nanoapp.io" > /data/etc/nullmailer/defaultdomain | |
echo "${APP_NAME}.nanoapp.io" > /data/etc/nullmailer/me | |
echo "${SMTP_USER}" > /data/etc/nullmailer/adminaddr | |
if [[ -n "${SMTP_PORT}" ]]; then | |
options="--port=${SMTP_PORT}" | |
fi | |
if [[ "${SMTP_TLS}" == "tls" || "${SMTP_TLS}" == "ssl" ]]; then | |
options="${options} --tls" | |
elif [[ "${SMTP_TLS}" == "starttls" ]]; then | |
options="${options} --starttls" | |
fi | |
if [[ "${SMTP_AUTH}" == "login" ]]; then | |
options="${options} --auth-login" | |
fi | |
echo "${SMTP_HOST} smtp --user='${SMTP_USER}' --pass='${SMTP_PASS}' ${options}" > /data/etc/nullmailer/remotes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment