PDA

View Full Version : Looking for a redundant Mail solution


hostpc.com
10-29-2005, 02:28 PM
As some of you may be aware, HostPC was out of commission for roughly 36 hours this past week due to Hurricane Wilma slashing our datacenter and a single faulty part (and subsequently bad backup part that was onsite) for the generators which failed. (Verio was also impacted, severely).

We're making a LOT of changes to our network, including backup services in 2 alternate datacenters (which means 2x the servers, 2x the DA licenses) - a cost I'm willing to assume - but I've got a couple of issues.

One issue is providing redundant MX records for our customers - one in each datacenter.

Can anyone explain how, or if that could be accomplished within DA? I'm sure it's necessary to have the user accounts (domain/username) exist on both servers - correct?

If anyone has thoughts on how this could be accomplished, please let me know.

Thanks

Bloory
10-29-2005, 04:19 PM
I'll begin by saying I'm no expert.

I am sure Jeff or one of the others can correct me;

you need to modify the dns template so that the additional mx record is served and then just add the domain to a file such as /etc/remotedomains.

getUP
10-30-2005, 08:15 AM
This really is the first feature I would like to see in DirectAdmin. Basically like the DNS MultiServer setup. Instead of fallback mx a real secondary mail server would be ideal. So customers can always check their e-mail.

At the moment we run fallback mx. Renting this service from a third party. So I honestly don't know how they have done it, but it's not DA dependant.
There is a 5 minute cron on our servers which creates a list of domains. What goes on after that on the secondary servers is beyond our knowledge.

We have dns_a.conf and dns_mx.conf in our /usr/local/directadmin/data/templates/custom directory.

dns_a.conf:
mx1=|IP|
mx2=192.168.0.1

dns_mx.conf:
mx1=10
mx2=20

This is all, working like a charm.

hostpc.com
10-30-2005, 09:28 AM
Could you tell us where you're getting this third party service? it souonds like an ideal situation.

Thanks

jlasman
10-30-2005, 11:42 AM
Joe,

I'm sorry to hear of your problems. My brothers are in Boca and in Davie, both hard-hit by Wilma.

A list of domains isn't enough; without a list of users you run into the problem I've mentioned previously where you end up with emails you don't know what to do with.

Using DA may or may not be the right way to go on the failover server. Previous studies have shown us that vexim may be a better solution but we're going to study it again beginning today.

We can offer this as a service if there's any interest but we're not sure how to price it and get any business.

Details:

1. Centrally located server hosting failover MX. (Note that this server will get some email even when your server is up, because that's how MX works.)

2. We're considering per domain per month pricing (to make it fair to us and to our clients who might want to sell it as an option).

3. A plugin for the DA server would automatically upload to us a list of domains and usernames on a regular basis (hourly?).

4. We'll start first with a U.S. based server, and add a European presence if/as European business warrants.

Of course once we start the service we're committed to running it forever, even if we only get a few clients...

So we're interested in knowing if anyone is interested in it, and if so, what would be a fair price.

Let's leave the thread here for now and perhaps move it to third-party software (where it may soon rightfully belong depending on where the thread takes us.

The best way to price it apears to be to get the number of domains we're hosting failover MX for on any given day and average for the month. But we're open to suggestions both for the pricing model, and any other issue that may come up.

Anyone?

Jeff

getUP
10-30-2005, 11:45 AM
Yea, sure. Check http://www.mijn-sleutel.net/?pagina=contact

I don't think they have a website available in english. But you can just send them an e-mail explaining your situation. They have both secondary servers available in the US as in Germany.

You will have to convert all your current zones though. We did have a script for that but it got lost :(

Edit:
Just read your reply Jeff, we would be interested if there could be a service allowing our clients to receive their e-mail from the secondary server as that is not possible for us at the moment.

resolveit
10-30-2005, 12:29 PM
Hi getUP,

Slave MX or what the site calls Fallback-MX will cache the mail waiting for yourprimary server to become available again. The users will not be able to collect thier mail from this server directly. What you're looking for is possible, setting up complete mail facilities on a second site and modifying DNS to find the available server BUT this is not reliable as your customer could miss mail because the second server answered before the first while the mail is on the first , etc.... Also when your primary goes down your customers who have cached the DNS info will get a failure in their mail client untill their DNS client requests new information from your DNS server.

I'll see if Jeff and I can figure out a way to make it work... I don't have high hopes though.

Regards,

jlasman
10-30-2005, 01:03 PM
The problem is simple: you can't guarantee with DNS alone that all users will see the fallback server while it has email.

So we'd have to develop a system that would keep track of when the main server is back up, and move to it any email still in the mailboxes on the failover server.

Which is possible. But a lot harder than the standard fallback system.

I don't think I'd want to try to attack it until I had a lot of advance subscriptions for it, as it's going to make the solution much more expensive (much more needed on the fallback server in the way of resources).

Jeff

getUP
10-30-2005, 03:26 PM
I know the way basic fallback mx works, that is, the caching part. Things we don't know is as in how they handle things on their server. But this is not my concern really.

This seemed to be the ideal solution to set things up quickly and without much hassle. If another solution will be too costly than it's not interesting. If our customers demand high end solutions regarding e-mail they should not be on a shared hosting account after all.

jlasman
10-30-2005, 05:53 PM
Well, a few hours later I can tell you two things:

1) Here's how we do it when required...

We have multiple MX servers all set up for the same users and the same passwords.

And we have each user set up two accounts on his/her desktop machine; one for each server. So email will be seen by the user no matter which system it comes in for.

Note that this doesn't work if the desktop client errors out when a system can't be reached. We use KMail desktops, which just skip over non-responding mail servers.

2) We're not going to get into failover mailboxes for a shared hosting solution; we may or may not get into it for our specialty mailbox hosting solution.

Jeff

backusnetcom
11-09-2005, 12:12 PM
Does anybody know what software (or what settings for exim) is needed to run on the failback mx server?

icepick
11-09-2005, 04:52 PM
Hey guys,

I'm interested in a simple backup mx, simular to the way multi server works, just store the mail till the primary mailserver comes back online.

roelp
11-10-2005, 01:06 AM
a very easy solution would be to just add another MX record with a lower priority

and just create a simple catchall pop3 on the backup server

backusnetcom
11-10-2005, 01:08 AM
Originally posted by roelp
a very easy solution would be to just add another MX record with a lower priority

and just create a simple catchall pop3 on the backup server

But how to make it send the mail back to first mx when that one comes back online?

roelp
11-10-2005, 01:15 AM
you could also use something like finger or etrn

MartijnHOS
11-10-2005, 02:26 AM
Hello,

I have also thought a lot about setting up a secundary mailserver (not a fallback). The easiest way is as Jeff describes in point 1).

If you set it up for all your customers the must set up two account in their mailprogram. I know for sure that not all customers will do and will loose email.

If you choose to set it up for just the clients who need it, you need to filter out the users who not need it.

Jeff if you are planning to work an this, i am willing to pay for the solution.

Kind regards,

Martijn

jlasman
11-10-2005, 02:39 PM
Originally posted by roelp
a very easy solution would be to just add another MX record with a lower priority

and just create a simple catchall pop3 on the backup server
This solution will cause you a lot of problems even if you figure out how to send email back to the main server.

Many spammers send email to all MX records (and even all A records) for a domain. So their dictionary attacks will fill your secondary MX system's space quickly, and when the system tries to forward the email to the main MX system it'll have tons of email it can neither deliver nor return.

Jeff

backusnetcom
11-10-2005, 11:43 PM
Originally posted by jlasman
This solution will cause you a lot of problems even if you figure out how to send email back to the main server.

Many spammers send email to all MX records (and even all A records) for a domain. So their dictionary attacks will fill your secondary MX system's space quickly, and when the system tries to forward the email to the main MX system it'll have tons of email it can neither deliver nor return.

Jeff

So how to set up a fall-back mail service then? and do you know whitch software i can use to run this on second server?

(that will forward mail etc)

getUP
11-24-2005, 07:54 AM
I just did a basic Exim config to allow the relay for specified domains - acting as a fallback mx solution.

My only concern is, if not using the same ACL rules as on a primary server - how will e-mail get bounced - if for instance, an e-mail has a virus in it?

Will it be send back to the fallback server or the original server which sent the e-mail?

TheBear
11-30-2005, 09:34 AM
Hello,

Here is a suggestion that may for for those if you looking for a simple, off-site backup MX setup.

For most of my domains (which are not on my DA server, and even some on my DA server) I have ouotsourced my DNS to DNSmadeeasy. The cost is reasonable and they also offer backup MX service for $7.50 per domain per year.

Their paid DNS services also offer a hot failover in case you want to mirror any of the IPs setup in zone files on their service.

Dale

jlasman
12-11-2005, 11:23 PM
Sure but how do they handle any of the issues I mentioned?

Jeff

streamservice
01-08-2006, 12:45 PM
Is it possible to have this like the multi server option for DNS?

It should be possible to just relay all e-mail on a domain I guess. A domain could be added to the second server when it is added on DirectAdmin (like the multi server option currently provided).

Only when the account doesn't excist how it works whit sending the message back (or because any other reason the server sents the email back). Could it be possible to sent the mail at that moment to the original sender? If so this could be the solution I am looking for. If this is not possible I will have to make an own application and to buy an extra server and use that application.

I don't want to outsource this at the moment. When you don't think this willcome just say it, because than I know I have to make an own application.

weng
06-06-2006, 10:07 AM
Originally posted by jlasman
This solution will cause you a lot of problems even if you figure out how to send email back to the main server.

Many spammers send email to all MX records (and even all A records) for a domain. So their dictionary attacks will fill your secondary MX system's space quickly, and when the system tries to forward the email to the main MX system it'll have tons of email it can neither deliver nor return.

Jeff

Hi Jeff,
Can't we set the primary mail server to drop all mails except for those with valid addresses? That way, there's no need to return those invalid addresses emails.

weng
06-06-2006, 10:09 AM
Originally posted by roelp
you could also use something like finger or etrn

Hi roelp,
I am using a reseller account running on DA. How can I set my secondary mail server to deliver to the primary mail server once it is up using finger or etrn?

I do not have access to SSH.

jlasman
06-14-2006, 07:44 PM
Originally posted by weng
Can't we set the primary mail server to drop all mails except for those with valid addresses? That way, there's no need to return those invalid addresses emails.
Yes, but it gets you on the RFC-ignorant list, and a lot of folk block on that.

And if anyone misspells your address they never get the mail back so they think they've reached you. That's a bummer when you win (as I did twelve times last week) the Dutch lottery :) .

It's against the RFCs for lots of good reasons.

Jeff

xemaps
06-15-2006, 10:35 AM
I have a backup mx but i don't use it because i must accept all mail.
If i use it it will break rfc because on the main mail server, i can filter and reject before accept..., or i must accept all on backup mx.

Thinking i must better build a mail server with same exim.conf rater using backup mx.

Will be great to have full da synchronized server ;-)

QuantumNet
02-28-2007, 07:48 PM
Exim has a feature for doing callouts from the backup system to verify that accounts exist on the primary system. These callouts get cached for when the primary is down and to also speed the processing of mail.

Also this solution still remains inadiquate. The only true way to have an ideal system is for someone to research a loadbalanced cluster solution like all the bigs guys such as gmail and hotmail use.

mail is not that much traffic and to have the mail loadbalanced between 2 systems would be sweet.

TheBear
02-28-2007, 07:52 PM
Check out SurgeMail - http://www.SurgeMail.com

It offers a reasonably (in my opinion) cluster license or you can buy 2 licenses (the second license is 1/2 price when used as a mirror) and setup a live mirrored system.

The primary receives all email and sends copies to the mirror system AFTER it processes all spam and anti-virus.

If the primary goes down, and you are using a DNS failover system, the DNS will point to your mirror and you are all set. Depending on how good and fast your DNS failover kicks in, your customers might never even notice you are having mail problems.

ocs-hosting
03-01-2007, 07:36 AM
well if you could get this to work that would be great, OCS Hosting, already use failsafe mail, with redundant DNS a records, as pointed out keeping the mail in one place really can be a pain in the backside, but this could be fixed with a simple backround application that pings the mail server every 90seconds, as soon as we get 80% or more missed DNS, the BG processes, suspendes the mailserver, and uses secondry DNS Settings. Once the system or mailserver is resored, all mail directorys are sync'd so to speak

In our experiance its a system intensive application, our mail servers currently averge a load of 9.91, but during failover this has risen to 20+.

If this could be maid to work, OCS-Hosting, would be willing to provide a dedicated soloution in Europe for this, aswell as asia and possibly in my rack at sify

Nothing flash maybe, athlon 3500+ 1.5GB DDR, 160GB Disk, 2TB Bandwith.

90GBPS DC Peering Capacity (EvoSwitch) or RedBus @ 12GBPS <Europe
Level3 Sify DC India, Total Peering Capacity, 10GBPS mutiple GB Fibers <India
Thukral Data Center Central HongKong, 5GBPS <Asia

LMK

Cheers

OCS Hosting Pvt Ltd

icepick
07-04-2007, 03:28 PM
In a multi-server setup, wouldn't it be easier to have the primary server hand over all entries in /etc/virtual/domains to the secondary server into a file such as /etc/virtual/secondary ?

If that were the case you could set exim to queue all mail for those 'secondary' domains and deliver them to the primary?

Not sure how easy that would be, but would be nice if the multiserver supported this.

icepick
07-04-2007, 03:34 PM
Would be simple if the secondary server (multi server) had a file such as I mentioned, then you would just add the following to exim

relay_domains = ${path to secondary file}

jlasman
07-05-2007, 07:42 PM
More than just domains, you'd also need to know which users to accept email for, or you'd end up with a lot of email you can neither deliver nor return, once your main server comes up.

It's possible to create a backup mx server. It's just not simple.

Since there seems to be so much interest we're looking at a scripted solution, and will probably begin work on it once SpamBlocker3 is released.

Jeff

Scormen
02-06-2008, 05:41 AM
Hi,

I was looking on the forum for a fallback- or backup MX solution, because of that I came to this old topic.

Since there seems to be so much interest we're looking at a scripted solution, and will probably begin work on it once SpamBlocker3 is released.
Is there already some news about this, Jeff?

Like someone said already, it would be nice to have a tool for MX inside DirectAdmin like the "Multie server setup" for DNS.

Thanks,
Kris

mattb
02-06-2008, 11:15 PM
For full failover (which is what you all seem to be talking about), it's more than multiple MX records.

You're really looking for fail-over across large network (ie: other side of the country/ another datacentre).

At a minimum you need something that:

1. Does heart-beating between multiple servers.
2. Disk replication / shared storage

jlasman
02-08-2008, 08:44 PM
Is there already some news about this, Jeff?
I'd still like to do it. I'd still like to do a lot of things. There just aren't enough hours in a day.

I'm now hiring, so maybe I'll have some time soon.

Jeff

Scormen
02-09-2008, 06:08 AM
Thanks Jeff, looks great :)
I hope something like that will be in one of the next versions of DA ;)

Grtz,
Kris

jlasman
02-15-2008, 07:24 PM
I certainly didn't mean to give you the impression it'll happen anytime soon. It may, if you work on it ;).

Jeff

Scormen
02-16-2008, 01:36 AM
Haha I know Jeff :) I whish I could...

Grtz,
Kris