0

So I have an instance of docker-mailserver running for a domain, is it possible for me to use that mail server at mail.domain1.com to send emails on behalf of domain2.com? If this is possible, how can I secure my domain so that only mail.domain1.com can send mail as me?

1 Answers1

1

Yes.

We can't answer with more specificity without knowing a lot more details, but it is pretty common/standard for 1 mail server to handle multiple domains.

With respect to securing who can send emails as you you would need to tie in auxilliary technologies like SPF, DMARC and DKIM (SPF and DMARC is implemented in DNS. DKIM is implemented in DNS and the mail server). You would also need to tie in SMTP Auth. This all works at a domain level and requires the recipients server to implement checks for these things - which is common but not guaranteed.

I've not tried it, but you may be able to modify your SMTP server config to tie down From addresses to the SMTP authorization to lock this down on a per user level - but this may also break aliases. It also depends on the flexibility of your mail server.

Apologies for the next sentence, but it could save you grief and hours of frustration - There are other practical requirements for running a mail server that is capable of reliably sending (more having remote mail servers accept) email. Be aware that if you don't know this [and my assumption is you likely don't because if you knew this you would have the knowledge to answer your own question] you will have a steep learning curve to get mail working properly. (Things like reverse DNS matching forward DNS, warming up mail servers, rate limits, SMTP banners spring to mind). You can likely bypass much of this by using an SMTP relay, although doing so will change your SPF records.

davidgo
  • 73,366