One Linode, one IP, two domains for two different email server.

As title.

I am running a Linode with one 1 IP, 1 domain, 1 apache for web pages, postfix/dovecot for emails.

I would like to add a completely different domain to my Linode, serving different pages,

and having different email with different SSL certificates.

Now I have www.domain1.org,

I would like to have www.domain2.com

Is this possible?

I have seen that it is pretty easy to do it with apache, but there is no many guides on how to do it with postfix/dovecot.

Neither how to configure different SSL certificates for the two domains.

Can you help me please?

Thanks

8 Replies

I could be wrong about this, but I believe if you really want to have 1 mail server for domain1 with certificates that match, and another mail server for domain2 with certificates that match, you will need 2 instances of postfix running, each with their own IP address.

@kangaby:

I could be wrong about this, but I believe if you really want to have 1 mail server for domain1 with certificates that match, and another mail server for domain2 with certificates that match, you will need 2 instances of postfix running, each with their own IP address.

I have read it somewhere but why?

Why I need to IP for postfix while I don't need it for apache?

it's just to understand how the things works :)

thanks

Apache was designed differently I suppose. Multiple SSL's on a single IP with Apache is a recent (< 10 years ?) feature. You needed a single IP for each SSL site in the past. I guess things changed when IP4 addresses ran out.

Most people with multiple domains on a single host send mail for domain1 through mail.domain1.xxx and mail for domain2 through mail.domain1.xxx or whatever host name you are using for your mail server.

> Most people with multiple domains on a single host send mail for domain1 through mail.domain1.xxx and mail for domain2 through mail.domain1.xxx or whatever host name you are using for your mail server.

I don't use postfix but rather Exim so I am not sure how you would configure this in Postfix but…

Your statement that you need to setup two separate mail servers to handle two domains in Postfix is hard to believe.

The authoritative mail server(s) for domains doesn't even need to in the same domain as the domains it serves. It just needs to be configured to know what domains it knows about and what their valid user lists for those domains are.

I've got a email server which serves more than 60 domains and it uses the same IP and mail server. Each domain has their MX record and other related security settings (DKIM, SPF etc) all point to the main email server. Each domain has it's own user list.

I have a number of mail servers setup the same to handle their own set of domains for email.

You just need to find someone who knows postfix configuration to show you how to do this.

@Dweeber:

Your statement that you need to setup two separate mail servers to handle two domains in Postfix is hard to believe.
I'm not really sure why you quoted me, and then said push all the mail through one server, when the quoted text pretty much says that anyway.

But, to answer the OP's original question, if you want a mail server for each domain, with each mail server having their own certificate, you need 2 instances of postfix or 2 computers.

I suspect Exim is similar (though I've never used it).

Or were you meaning to quote the OP.

Sorry,

I think the OP doesn't know that he only needs 1 TLS cert. Each domain doesn't need to have their own. They can use the same mail server which only needs to have 1. Then you don't need multiple IPs.

Since the mail server sends the mail, it uses it's TLS cert to accomplish that. Same goes for a DKIM cert.

If the OP still wants to create separate mail server for each domain, go for it. He will need IP's for each one (or at least one of them).

If he wants to end up later with 10 domains, I don't think he wants to manage 10 mail servers, one for each domain.

That is the point I was trying to make.

@Dweeber:

Sorry,

I think the OP doesn't know that he only needs 1 TLS cert. Each domain doesn't need to have their own. They can use the same mail server which only needs to have 1. Then you don't need multiple IPs.

Since the mail server sends the mail, it uses it's TLS cert to accomplish that. Same goes for a DKIM cert.

If the OP still wants to create separate mail server for each domain, go for it. He will need IP's for each one (or at least one of them).

If he wants to end up later with 10 domains, I don't think he wants to manage 10 mail servers, one for each domain.

That is the point I was trying to make.

the only things I want is to have one 1, 1 linode and can be able to send email using TLS signed certificate.

I also want to send mail from mail.domain1.xxx and from mail.domain2.xxx. is this possible with one postfix and one TLS certificate?

No, that is not possible. The developers of postfix have been against such a scheme for a long time, currently there are no plans to implement SNI in postfix.

In addition, the protocols related to email work differently from the web protocols. In HTTP/HTTPS, the browser and web server developers came together and came up with SNI, which is implemented on both sides (browser and web server). In the email world, nobody cares to implement SNI properly for various reasons (too many old clients, broken clients, Microsoft outlook being a monolithic ancient buggy software that Microsoft is refusing to improve, old email servers unable to upgrade or no real motivation, etc). Thus, when a client first connects via SMTP, there is no SNI that will inform the server to switch to a specific mail host, like its happening in the web.

Here are some suggestions:

  • Use a generic name for your server (like mysuperhosting.net) and set all your hosted domains to use as MX the mysuperhosting.net address. This is better than using mail.something and mail.somethingelse.

  • Add a separate IP address to your server and run a separate postfix process per IP/interface. Complex but it can be done if you know what you are doing.

  • Use separate linode servers.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct