Closed CherryKitten closed 5 years ago
The entire purpose of this image is to allow multiple poste.io containers to co-exist on the same physical host, so yes. ;-)
Just configure each container with a docker hostname setting that corresponds to the IP you would like that container to have, then configure the domains of that instance for the corresponding IP.
If, however, what you mean is you need to have a single poste.io instance with 2 domains that share the same 2 IPs, then no, you can't do that easily with this image. Many of its features (like outbound IP binding) don't work with multiple IPs for the same container. But if each domain uses no more than one IP, you can create one container per IP, and put the corresponding domains in that container.
Thanks for the answer
I’d like to manage all my email domains from the same instance of poste without it using up all IPs of the server, probably a rare edge case.
Guess I’ll have to find another way to do this.
I'm sure it can be done, it's just going to need some work.
The first thing you'd need to do is to create a generic hostname that lists all the relevant IPs as A records, and set that as the container's hostname. That should actually take care of most of the issues (I think), as far as listening ports go; it's just that this image expects to only have one outgoing IP address.
Ironically, the haraka mail server that poste uses has support for selecting an outgoing IP address, it's just that I had so much trouble getting it to work with forcing one IP address that I stopped there.
If you want to see about extending it, the relevant parts of the configuration are in lines 41 - 76 of the patches file. Even more specifically, lines 57 and 73 arrange the writing of an outbound IP to a config file, and reading it back, respectively.
That being said, I wonder: since poste doesn't support outbound IP selection in this fashion now (as far as I know), how are you handling it presently? And why do you need multiple IPs for this in the first place?
FYI, it is now possible to do this as of the latest version, by defining a primary hostname for the container that lists both IP addresses in DNS, but all outbound mail will be sent from only one IP address. You can then manage as many domains you want from that container, as long as their MX records point to one of the relevant IP addresses. (But the outbound HELO will always be from the container hostname and its first IP).
Update: I've now added the ability to customize sending IP by domain, so the original use case in this issue should now be fully resolved. See the README for configuration details.
Is there a way to configure this so poste.io does bind to two specific IPs while not binding to the third?
When I use this image I lose access to one of my e-mail domains, because I use 2 domains with 2 IPs, but I want to have the third IP of my server freed for something else. Any way to do this?