how to setup storage for two different MX in different locations

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to setup storage for two different MX in different locations

Merrick
Hello,

We plan to setup two postfix as MX servers.
One is in west location, such as CA state.
Another is in east location, such as NYC.

The question is, how to make storage shared by two MX servers?
The messages should be stored in one place, such as webmail/IMAP could
read all messages directly from this location.

Thanks for any suggestion.

regards.
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Bernardo Reino
On Tue, 19 Nov 2019, Merrick wrote:

> The question is, how to make storage shared by two MX servers?

MX (SMTP) servers don't store messages. They deliver them to whatever
system makes them available to the users.

(or do you mean you want have a shared queue? -- not recommended!)

> The messages should be stored in one place, such as webmail/IMAP could read
> all messages directly from this location.

Use a single IMAP server. Have both mail servers deliver the messages to
the single IMAP server.
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Merrick
Bernardo Reino wrote:
>> The messages should be stored in one place, such as webmail/IMAP could
>> read all messages directly from this location.
>
> Use a single IMAP server. Have both mail servers deliver the messages to
> the single IMAP server.

Do you mean I setup a single IMAP server in middle location (such as
Dallas) then both MX servers deliver messages to the IMAP?

regards.
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Bernardo Reino
On Tue, 19 Nov 2019, Merrick wrote:

> Bernardo Reino wrote:
>>> The messages should be stored in one place, such as webmail/IMAP could
>>> read all messages directly from this location.
>>
>> Use a single IMAP server. Have both mail servers deliver the messages to
>> the single IMAP server.
>
> Do you mean I setup a single IMAP server in middle location (such as Dallas)
> then both MX servers deliver messages to the IMAP?

Perhaps you first need to think/consider what you actually want. I cannot
recommend you to install an IMAP server in Dallas or any other location.

Maybe you don't even need or want IMAP but want to deliver mail to a local
mailbox, or relay to another server, etc.

If this is a hobby project or some kind of theoretical question or
experiment, then OK, but if this is work then I'm not sure this is the
right place (and maybe -- meaning no offense -- you're not the right
person).

You could read about virtual_transport in postfix so you know which
options you have when delivering. I use dovecot (IMAP server), so I have
virtual_transport = lmtp:unix:private/dovecot-lmtp

If you install dovecot somewhere you could deliver received mails to it,
but not using a unix socket (as MX and IMAP would run on different
servers), but using something like lmtp:[IP_of_IMAP_server]:port

Good luck!

Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Merrick
Bernardo Reino wrote:

>
> Perhaps you first need to think/consider what you actually want. I
> cannot recommend you to install an IMAP server in Dallas or any other
> location.
>
> Maybe you don't even need or want IMAP but want to deliver mail to a
> local mailbox, or relay to another server, etc.
>
> If this is a hobby project or some kind of theoretical question or
> experiment, then OK, but if this is work then I'm not sure this is the
> right place (and maybe -- meaning no offense -- you're not the right
> person).
>
> You could read about virtual_transport in postfix so you know which
> options you have when delivering. I use dovecot (IMAP server), so I have
> virtual_transport = lmtp:unix:private/dovecot-lmtp
>
> If you install dovecot somewhere you could deliver received mails to it,
> but not using a unix socket (as MX and IMAP would run on different
> servers), but using something like lmtp:[IP_of_IMAP_server]:port

Thanks for the helps.
My purpose is to setup two MX servers in different locations for high
availability.
But I am not sure how the two MX servers handle message storage.

regards.
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Dominic Raferd
On Tue, 19 Nov 2019 at 08:56, Merrick <[hidden email]> wrote:
My purpose is to setup two MX servers in different locations for high
availability.
But I am not sure how the two MX servers handle message storage.

If you are a small organisation you could consider relaying into Gmail. Or, easiest of all, use G Suite (which is free for non-profits).

Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Merrick
Dominic Raferd wrote:
> If you are a small organisation you could consider relaying into Gmail.
> Or, easiest of all, use G Suite (which is free for non-profits).
>

I know there is gsuite exists, :)
Also a lot of cheap providers like MXroute on the world.
We just want to make an email service for ourselves, about 100 members
using this service.

regards.
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Gregory Heytings
In reply to this post by Merrick

>
> My purpose is to setup two MX servers in different locations for high
> availability.
>

I'm not sure I understand your question, but I guess that what you want is
a secondary MX in case the primary MX becomes unavailable for some reason
(power outage, server crash, whatever).  If this is indeed what you want
to do, you could check
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup , or
https://www.howtoforge.com/postfix_backup_mx , or any other howto.

Gregory
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Bill Cole-3
In reply to this post by Merrick
On 19 Nov 2019, at 1:04, Merrick wrote:

> Hello,
>
> We plan to setup two postfix as MX servers.
> One is in west location, such as CA state.
> Another is in east location, such as NYC.

The usefulness of such an architecture in modern times is marginal. If
the "4th nine" (or maybe 5th) is worth doubling your hard costs and
possibly doing worse to your support costs, go for it. As an example,
one 2-node mail cluster I manage has had a bit less than 2 hours of
downtime per node in the past year, all of it for scheduled updates, so
the whole system has never been unavailable but if it was a single node
it would only have been out for 2 hours of our own choosing: 99.977%
available even without a "planned downtime" exemption. The second node
takes us to 100% but at a significant cost of technical and human
resources.

> The question is, how to make storage shared by two MX servers?
> The messages should be stored in one place, such as webmail/IMAP could
> read all messages directly from this location.

This is not something Postfix would handle. When acting as a MX server,
Postfix accepts messages and (except in cases of extreme load or
malfunction) passes them in sub-second time to Something Else that
manages the storage of and access to delivered mail. Sometimes that's
just files on disk that can be accessed by traditional mail tools
(mail/mailx, mutt, etc.) or by IMAP /POP/webmail servers. Sometimes it
is an independent delivery agent that is handed messages over LMTP or a
pipe or more arcane mechanisms (see master.cf's often-commented lines
for delivery mechanisms Postfix can do.)

What you are looking for is either an independent IMAP server OR
synchronized IMAP servers. Typically webmail accesses delivered mail via
IMAP. https://wiki.dovecot.org/Replication explains one way to synch 2
or more IMAP servers, using Dovecot. Cyrus IMAP also has a mechanism for
it. If you are committed to truly singular storage, a single IMAP server
apart from the MX servers would suffice, but I don't think that's a
sensible architecture because it makes the solitary IMAP server a single
point of failure. Replication allows each node to stand on its own if
the other(s) fail, and avoids the problems of treating distant storage
as local.

It is also possible to use a commercial mail clustering solution, such
as CommuniGate Pro. I hear Microsoft has some sort of supposed
multi-node mail system as well... One might expect a commercial solution
to be a simpler tool to support but one might be surprised.

--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Reply | Threaded
Open this post in threaded view
|

Re: how to setup storage for two different MX in different locations

Merrick

Thanks Bill for the kind suggestion.

regards

Bill Cole wrote:

> On 19 Nov 2019, at 1:04, Merrick wrote:
>
>> Hello,
>>
>> We plan to setup two postfix as MX servers.
>> One is in west location, such as CA state.
>> Another is in east location, such as NYC.
>
> The usefulness of such an architecture in modern times is marginal. If
> the "4th nine" (or maybe 5th) is worth doubling your hard costs and
> possibly doing worse to your support costs, go for it. As an example,
> one 2-node mail cluster I manage has had a bit less than 2 hours of
> downtime per node in the past year, all of it for scheduled updates, so
> the whole system has never been unavailable but if it was a single node
> it would only have been out for 2 hours of our own choosing: 99.977%
> available even without a "planned downtime" exemption. The second node
> takes us to 100% but at a significant cost of technical and human
> resources.
>
>> The question is, how to make storage shared by two MX servers?
>> The messages should be stored in one place, such as webmail/IMAP could
>> read all messages directly from this location.
>
> This is not something Postfix would handle. When acting as a MX server,
> Postfix accepts messages and (except in cases of extreme load or
> malfunction) passes them in sub-second time to Something Else that
> manages the storage of and access to delivered mail. Sometimes that's
> just files on disk that can be accessed by traditional mail tools
> (mail/mailx, mutt, etc.) or by IMAP /POP/webmail servers. Sometimes it
> is an independent delivery agent that is handed messages over LMTP or a
> pipe or more arcane mechanisms (see master.cf's often-commented lines
> for delivery mechanisms Postfix can do.)
>
> What you are looking for is either an independent IMAP server OR
> synchronized IMAP servers. Typically webmail accesses delivered mail via
> IMAP. https://wiki.dovecot.org/Replication explains one way to synch 2
> or more IMAP servers, using Dovecot. Cyrus IMAP also has a mechanism for
> it. If you are committed to truly singular storage, a single IMAP server
> apart from the MX servers would suffice, but I don't think that's a
> sensible architecture because it makes the solitary IMAP server a single
> point of failure. Replication allows each node to stand on its own if
> the other(s) fail, and avoids the problems of treating distant storage
> as local.
>
> It is also possible to use a commercial mail clustering solution, such
> as CommuniGate Pro. I hear Microsoft has some sort of supposed
> multi-node mail system as well... One might expect a commercial solution
> to be a simpler tool to support but one might be surprised.
>