nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

SNI and multiple hostnames #208

Closed AroaR91867HTML closed 3 months ago

AroaR91867HTML commented 3 months ago

Hi,

I have a SMTP server with TLS (just to receive emails) but now we want to add multiple domains, I read in the doc about SNI, but I can't see how I can specify an individual certificate (key, cert) for each domain.

Thank you

andris9 commented 3 months ago

You can use something like this:

sniOptions: {
  "smtp.example.com": {
    key: fs.readFileSync("private.key"),
    cert: fs.readFileSync("server.crt")
  }
}
AroaR91867HTML commented 3 months ago

Thank you!