Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Can I receive mails in 2 servers simultaneously?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Can I receive mails in 2 servers simultaneously?

jvnadrjvnadr Member

Hello all!
Is there any configuration in mx records that can allow me to setup two (or more) mail servers and receive mails there simultaneously? So, If a server goes off for any reason, then, I can still reach my emails to the other server? Can this be done with backup mx records (although I know that backup mx is for receiving mails when the original server is down).

Comments

  • nerouxneroux Member

    You can certainly specify more than one MX entry but only one server will actually receive the email. Whatever you do afterwards with the email (replication to other servers) is up to your setup.

    Thanked by 1jvnadr
  • MaouniqueMaounique Host Rep, Veteran
    edited May 2014

    You can also forward it automatically, set filters and all. You can specify the second server as backup mx in case the first one goes down, but for the time the first server is down you will only have full mail on the second one. This means they will all have same accounts or at least a catch all mail, otherwise there will be nasty loops going on. Or you may wish to set rules so the second server cannot send mail to the first or never reply anything, just to avoid those loops. You have many options.

    Thanked by 1jvnadr
  • jvnadrjvnadr Member

    @Maounique I want this only for incoming mails. I already have forwarding rules to back my mails up in a second server, but I wanted to know if there is a way not to do this with forwarding but as default simultaneously receiving.

    Thanked by 1lelewku
  • MaouniqueMaounique Host Rep, Veteran

    Not one that I know of, unless you replicate the server some other place, but that is not what you want either. SMTP just delivers the mail and is done with it, it only talks to one IP once, so, you can setup some kind of relay to take over the actual delivery and send in 2 places. I think this is the closest to what you intend.

  • jvnadrjvnadr Member

    @Maounique Thnks again!

    Thanked by 1lelewku
  • tomletomle Member, LIR

    I guess you could set up both servers the same way and then replicate the emails using btsync for example.

  • jvnadrjvnadr Member

    @tomle It's easier with imap sync, but what I originally intended to do was not syncing but receiving simultaneously thru duplicate mx records or something similar.

    Thanked by 1lelewku
  • nerouxneroux Member
    edited May 2014

    @jvnadr said:
    Maounique I want this only for incoming mails. I already have forwarding rules to back my mails up in a second server, but I wanted to know if there is a way not to do this with forwarding but as default simultaneously receiving.

    What I already explained before. You cant receive them at both servers independently, but you can replicate. I wouldnt experiment with forwarding.

  • rguru6rguru6 Member

    You could use a different approach. Use a replicated storage.
    I setup two Windows servers with the mail server installed on them (only the server program) and two Debian storage servers replicated in realtime (well, very near to realtime) via DRBD.
    Only one server was serving clients at once, accessing the storage via iSCSI.
    Replicating the mail server was only a sync once a day.

    When one server went down I moved IP to the second server and pointed the storage to use the second node.

  • NeoonNeoon Community Contributor, Veteran

    Maybe someone doing a Tutorial for a Mailserver cluster :D

  • cfgguycfgguy Member, Host Rep

    I am not sure but ip failover cluster and routing the mx entry to failover ip might help.

  • MaouniqueMaounique Host Rep, Veteran

    Anycast anyone?

  • RadiRadi Host Rep, Veteran

    Why not mount one disk to 2 servers?

  • rds100rds100 Member

    Another option would be to make some friends at the NSA and ask them for their copy of the emails, when your server goes down ;-)

  • jvnadrjvnadr Member

    @rds100 Ah, would love of their "technology tricks" would be public one day... A lot of solutions for a lot of problems (or more problems for known solutions?)

    --- Just kidding :-P

    Thanked by 1lelewku
  • amhoabamhoab Member

    With split delivery, you can setup a mail gateway that delivers to multiple destinations. I run this for some of my domains. I can write up a tutorial if enough people are interested.

  • NeoonNeoon Community Contributor, Veteran
    edited May 2014

    @rds100 what? no.

  • nerouxneroux Member

    amhoab said: With split delivery, you can setup a mail gateway that delivers to multiple destinations.

    What if this gateway goes down?

  • jvnadrjvnadr Member

    amhoab said: I can write up a tutorial if enough people are interested.

    I'm interested!

    Thanked by 1lelewku
  • amhoabamhoab Member

    @neroux said:
    What if this gateway goes down?

    You can setup multiple gateways and treat them like you would any standard mail exchanger. So long as they have the same configs, mail will still flow.

  • nerouxneroux Member

    amhoab said: You can setup multiple gateways and treat them like you would any standard mail exchanger. So long as they have the same configs, mail will still flow.

    But how is this different from what the OP already outlined?

  • rguru6rguru6 Member

    The problem using a mail gateway is that if mail server n.1 goes down, ok, it's true that you have a copy of data on mail server n.2 but you didn't replicate IMAP statuses.

    So when a user open his mailbox to read his latest mail out of 10s of thousands, all mail will be unread. And users don't like that.

    I would go for a replicated mail server with separate (and replicated) storage...

    :)

  • amhoabamhoab Member

    neroux said: But how is this different from what the OP already outlined?

    The difference is that mail will still be sent to multiple servers simultaneously. With primary and alternate MXes, only one host gets the mail. With this solution, multiple servers do. If you have multiple gateways and one goes down, the backup gateway will deliver to the same set of mail servers. If one mail server is down, your MTA will retry in a configured window (usually 4 days) before failing.

  • amhoabamhoab Member

    rguru6 said: The problem using a mail gateway is that if mail server n.1 goes down, ok, it's true that you have a copy of data on mail server n.2 but you didn't replicate IMAP statuses.

    That's a good point; the mail gateway delivers mail to the servers independently, and each server has no clue of the others' status. It's really only meant for certain scenarios. I use it to alias a Gmail account and backup to another location. A common use case is to do a seamless mail migration from one server to another without losing data.

  • rguru6rguru6 Member

    Yea, that's why I think that for small providers with Linux based services (or even mixed Windows/Linux services) a good infrastructure for storage could use two machines, in LAN or even in different farms and get replicated easily with DRBD.

    The first guide I found was (well) written by Falko Timme on Howtoforge.

    I use Debian and DRBD to create realtime redudant storage over two servers (active-passive) in two different farms. And I use only one IP for each storage server being short on public IPs. Only one storage server is active at one moment but always replicates to the other server.

    The storage created like that can also be accessed by Windows machines using iSCSI.

    Note: this architecture is only thought for redundancy (and/or nearly high availability) and does not substitute backups!

Sign In or Register to comment.