postalsys / emailengine

Headless email client
https://emailengine.app/
Other
1.89k stars 166 forks source link

IPv6 Support #446

Closed isaachinman closed 1 month ago

isaachinman commented 1 month ago

Hi Andris, we are in the process of evaluating EmailEngine for our use case.

Just in the evaluation phase, we've already paid for a lot of egress, and would like EmailEngine to route through our private network. The private network is, however, IPv6.

The only semi-related issue I've found is https://github.com/postalsys/emailengine/issues/439.

In fact I have two desires:

  1. EmailEngine listens on IPv6 and serves API/webhook reqs
  2. EmailEngine takes an IPv6 Redis connection (private network)

The first is more important to us. The second is a nice to have, but our Redis latency is already <1ms, so I'm not terribly worried about that side.

Does EmailEngine support IPv6 out of the box? If it does not: (1) do you have any plans to, and (2) can you recommend any procedure to wrap the postalsys/emailengine:v2 Docker image in such a way to get IPv6 up and running easily?

I tried playing around with EENGINE_HOST and serviceUrl, but have had no luck. NodeJs normally plays fine with IPv6, so I was a little surprised.

Thanks! 🙏

andris9 commented 1 month ago

EmailEngine should be able to use IPv6 just fine. For example

$ EENGINE_HOST=::1 emailengine

If you can not get a connection, then there is something wrong with Docker networking 🤷‍♂️

For Redis, you would have to append ?family=6 to the Redis URL. (Important: you can not use an IPv6 address; you need to use a domain name with an AAAA record).

$ EENGINE_REDIS="redis://redis.host/?family=6" emailengine
isaachinman commented 1 month ago

something wrong with Docker networking

I suspect it's that the base image is alpine.

I'll report back any helpful findings.

Edit: Yep, modifying EENGINE_HOST correctly is all that is needed. This was user error in a sense, however I needed to manually override EENGINE_PORT among a couple other things.