-2

So im trying to make it so i have 2 domains, A.com, and B.com. they both use different email software (A.com has postal email server and B.com has modoboa) *something to also note, based on the subdomain as well changes which server it needs to go to

ive tried nginx streaming, this doesnt check the domain (even with v12.25.5 for server_name). ive tried postfix, but have not been successful.

things to note: Yes port 25/587 is open, Yes the DNS is correct.

Can someone point me to the right directions?

Because this question was removed - This is dealing with a business, I am the only dev working on this. I am full stack but dont know much about emails and looking for help. Thanks.

7
  • You may have yet another mail system. which would collect the mail for both domains and distribute it to the back-end real mail systems using private IPs or using ETRN. But, considering the complexity and caveats of such solution, the suggested idea of just having two different public IPs is much more reasonable. Commented Jun 9 at 7:09
  • so i run pfsense, and have access to 5 public ips, how could i choose which domain each port gets if i only get 1 port forward?
    – user655355
    Commented Jun 9 at 8:31
  • 1
    You are solving the wrong problem. mail servers are already designed to handle mail for multiple domains, just pick one and configure it properly handle all the mail
    – hardillb
    Commented Jun 9 at 8:51
  • Well heres the issue, we use postal for bulk emails (like user auth) then modoboa for our agents.
    – user655355
    Commented Jun 9 at 9:08
  • 1
    This is dealing with a business but is it in a usual and customary way? This is a highly unusual approach/design, there is likely a more sane solution.
    – Greg Askew
    Commented Jun 9 at 9:58

1 Answer 1

1

Email protocols don't have a mechanism to tell which hostname is used. The HTTP protocol has the Host header that can be used to forward different requests to different backends at the reverse proxy. Therefore, you need own IP addresses for both the email server solutions. Then, you simply use DNS for picking the correct server for the domain or subdomain.

Not the answer you're looking for? Browse other questions tagged .