docker-zulip icon indicating copy to clipboard operation
docker-zulip copied to clipboard

Incoming email setup - Local delivery setup - how to?

Open maltokyo opened this issue 4 years ago • 9 comments

I am trying to do this in docker, but I am not sure how to edit /etc/zulip/zulip.conf from docker-compose settings:

https://zulip.readthedocs.io/en/latest/production/email-gateway.html#local-delivery-setup

Could someone please share how you got INCOMING email working with docker-compose?

Concretely, how to concatenate , zulip::postfix_localmail to puppet_classes in /etc/zulip/zulip.conf like this:

puppet_classes = zulip::voyager, zulip::postfix_localmail

And I also need to add a section to /etc/zulip/zulip.conf like this:

[postfix]
mailname = emaildomain.example.com

maltokyo avatar Jan 19 '20 16:01 maltokyo

I think this is likely annoying to do with docker-zulip today; one needs to patch the Dockerfile or something to do it. My thought on how to fix this is to change puppet/zulip/manifests/dockervoyager.pp to include the zulip::postfix_localmail puppet class by default, and then add a way to add blocks to /etc/zulip/zulip.conf in the entrypoint.sh logic. (Or encourage using MANUAL_CONFIGURATION for it).

timabbott avatar Jan 25 '20 02:01 timabbott

Thanks. If I use manual config and still have some config in docker compose which is given preference? Do I need to remove everything from docker compose or is it all just ignored?

maltokyo avatar Jan 25 '20 08:01 maltokyo

@timabbott can I take over the old manual config of my "traditional" installation? This might be easier. Dealing with all of the variables has become a nightmare.

maltokyo avatar Feb 15 '20 04:02 maltokyo

@timabbot is there any chance of getting a few pointers here. Would you know which contributor may be able to guide me in the right direction. I've tried (I think) what you said above and rebuild but cannot get this working as it did in the non-docker version.

maltokyo avatar Apr 03 '20 10:04 maltokyo

Sorry. Should be @timabbott

maltokyo avatar Apr 03 '20 10:04 maltokyo

@hackerkid can you help with this? Ideally, the goal should be to have the incoming email gateway be fully supported by just merging changes to Zulip as I described above, but we can at least detail a workaround here.

timabbott avatar Apr 03 '20 19:04 timabbott

@hackerkid @timabbott I really give up ;) I tried to the best of my ability to hack it into working status, but couldn't find a way. I did the following steps:

  1. Setup MX server on DNS

  2. Changed this line in the Dockerfile from:

export PUPPET_CLASSES="zulip::dockervoyager" \

to:

export PUPPET_CLASSES="zulip::dockervoyager, zulip::postfix_localmail" \

  1. Add EMAIL_GATEWAY_PATTERN to settings in docker-compose.yml, and verify it was reflected correctly in the settings file.

  2. Rebuilt the container and start-up with the patched Dockerfile, it starts fine.

  3. Run /home/zulip/deployments/current/scripts/zulip-puppet-apply

  4. Restart with /home/zulip/deployments/current/scripts/restart-server

  5. Verify that something is listening on port 25 inside the container (and outside) with netstat -tulpn | grep LISTEN

  6. postfix was not running and hence nothing was listening in the container on port 25, so I tried to start it manually with /etc/init.d/postfix restart which worked, but emails sent there came back to me with error:

The response from the remote server was:
554 5.7.1 <stream.f20ed1cf65dc9c59376be9573333dcfc.show-sender@mail.domain.com>: Relay access denied

maltokyo avatar Apr 04 '20 00:04 maltokyo

I'm hitting the same issue. It seems I need to provide a value for mailname under [postfix].

What is the recommended method for customizing zulip.conf?

myedibleenso avatar Jan 07 '21 02:01 myedibleenso

Based on the discussion around this PR, adding zulip::postfix_localmail to puppet_classes in the Dockerfile introduces other issues. Is that (still) the case?

myedibleenso avatar Jan 07 '21 02:01 myedibleenso