Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Make the incoming mailserver's listen address configurable.

Alex Vandiver1527fd945db6
diff --git a/docs/production/email-gateway.md b/docs/production/email-gateway.md
index 9218ad68ee2..c8ae7c61ae6 100644
--- a/docs/production/email-gateway.md
+++ b/docs/production/email-gateway.md
@@ -97,6 +97,13 @@ using an [HTTP reverse proxy][reverse-proxy]).
Congratulations! The integration should be fully operational.
+:::{note}
+The incoming mail server listens on port 25, on all IPv4 and IPv6
+addresses, by default; you can adjust this with the
+[`email_gateway.listen`](system-configuration.md#listen) setting in
+`/etc/zulip/zulip.conf`.
+:::
+
[reverse-proxy]: reverse-proxies.md
## Polling setup
diff --git a/docs/production/system-configuration.md b/docs/production/system-configuration.md
index e64879e4f80..664ed53d8a7 100644
--- a/docs/production/system-configuration.md
+++ b/docs/production/system-configuration.md
@@ -533,3 +533,14 @@ The Sentry organization used for the [Sentry deploy hook](deployment.md#sentry-d
#### `project`
The Sentry project used for the [Sentry deploy hook](deployment.md#sentry-deploy-hook).
+
+### `[email_gateway]`
+
+#### `listen`
+
+The address for the [incoming email gateway's](email-gateway.md) SMTP
+server to bind to, as a bare port number, or `address:port`; IPv6
+addresses must be enclosed in square brackets (e.g.,
+`[2001:db8::1]:25`). Defaults to listening on port 25 on all
+addresses, both IPv4 and IPv6. This only applies to the local
+delivery mode of the gateway, not the polling mode.
diff --git a/puppet/zulip/manifests/local_mailserver.pp b/puppet/zulip/manifests/local_mailserver.pp
index a5501869043..4d1ef3e32d0 100644
--- a/puppet/zulip/manifests/local_mailserver.pp
+++ b/puppet/zulip/manifests/local_mailserver.pp
@@ -12,6 +12,7 @@ class zulip::local_mailserver {
before => Service[$zulip::common::supervisor_service],
}
}
+ $listen = zulipconf('email_gateway', 'listen', '')
file { "${zulip::common::supervisor_conf_dir}/email-mirror.conf":
ensure => file,
require => [
diff --git a/puppet/zulip/templates/supervisor/email-mirror.conf.template.erb b/puppet/zulip/templates/supervisor/email-mirror.conf.template.erb
index daa3e8e53e6..c7f52f496e9 100644
--- a/puppet/zulip/templates/supervisor/email-mirror.conf.template.erb
+++ b/puppet/zulip/templates/supervisor/email-mirror.conf.template.erb
@@ -1,5 +1,5 @@
[program:zulip-email-server]
-command=nice -n15 /home/zulip/deployments/current/manage.py email_server --user zulip --group zulip
+command=nice -n15 /home/zulip/deployments/current/manage.py email_server --user zulip --group zulip<% if @listen != '' %> --listen <%= @listen %><% end %>
environment=HTTP_proxy="<%= @proxy %>",HTTPS_proxy="<%= @proxy %>"
priority=350 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)