Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support incoming email integration #382

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ by [setting the IPs][loadbalancer-ips] under `[loadbalancer]` in `zulip.conf`.

[loadbalancer-ips]: https://zulip.readthedocs.io/en/latest/production/deployment.html#configuring-zulip-to-trust-proxies

**Additional puppet classes**. If you need to do additional puppet classes, you can set `ADDITIONAL_PUPPET_CLASSES` to a comma-separated list of puppet classes. This will tell Zulip to run the puppet classes under `[additional_puppet_classes]` in `zulip.conf`.
For example: `ADDITIONAL_PUPPET_CLASSES="zulip::postfix_localmail"`.

**Mail name**. If you need to set the mail name to used in [Local delivery setup for incoming email integration](https://zulip.readthedocs.io/en/latest/production/email-gateway.html#local-delivery-setup), you can set `MAILNAME` to the mail name. This will tell Zulip to add the mail name configuration under `[postfix]` in `zulip.conf`.


### Manual configuration

The way the environment variables configuration process described in
Expand Down
28 changes: 28 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ additionalPuppetConfiguration() {
echo "Executing additional puppet configuration ..."

local changedPuppetConf=false
local requireUpdateApt=false

if [ "$QUEUE_WORKERS_MULTIPROCESS" == "True" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "true" ]; then
echo "Setting queue workers to run in multiprocess mode ..."
Expand All @@ -156,6 +157,33 @@ additionalPuppetConfiguration() {
echo "No additional puppet configuration executed for load balancer IPs."
fi

if [ -n "$ADDITIONAL_PUPPET_CLASSES" ]; then
echo "Add additional puppet classes"
current_classes=$(crudini --get /etc/zulip/zulip.conf machine puppet_classes)
if [ -n "$current_classes" ]; then
echo "Add additional puppet classes to existing"
crudini --set /etc/zulip/zulip.conf machine puppet_classes "${current_classes}, ${ADDITIONAL_PUPPET_CLASSES}"
else
echo "No existing puppet classes, just setting"
crudini --set /etc/zulip/zulip.conf machine puppet_classes "${ADDITIONAL_PUPPET_CLASSES}"
fi
changedPuppetConf=true
requireUpdateApt=true
else
echo "No additional puppet classes."
fi

if [ -n "$MAILNAME" ]; then
echo "Setup mail name for postfix"
crudini --set /etc/zulip/zulip.conf postfix mailname "${MAILNAME}"
changedPuppetConf=true
else
echo "No config for mail name for postfix"
fi

if [ "$requireUpdateApt" = true ]; then
apt update
fi
if [ "$changedPuppetConf" = true ]; then
/home/zulip/deployments/current/scripts/zulip-puppet-apply -f
fi
Expand Down