Slashdot Mirror


Building a Scalable Mail System?

clusteredMail asks: "I work for a small ISP that up until now has survived with single servers for most critical roles, including the mail server. We are planning to introduce multiple mail servers (primarily for email collection via POP3 and IMAP) and want to put in place the most scalable, resistant to failure system that we can manage. Everything is currently running on one or another flavour of Linux. In my mind, the ultimate scenario would be to have some sort of distributed/clustered file system between the multiple machines, so that any user could log onto any server, and the loss of a single server would not cause downtime for any group of users. Has anyone in the Slashdot community had to put together a system like this using Linux and Open Source Software? If so, how did you fare and what were the major stumbling blocks?" "So far, the plan is to split up the mail accounts between multiple servers and use some sort of connection proxy to sort out which account logs into which server but this seems like a rough approach. The disadvantage to this setup: if one server fails all the users who have accounts on that machine will be in the dark, email-wise."

109 comments

  1. Check out Perdition by Matts · · Score: 4, Informative

    If it's IMAP scalability you want then you should look into Perdition, particularly their article on clustered mail server farms. This is in use in a lot of high performance, high scaling environments.

    --

    Matt. Want XML + Apache + Stylesheets? Get AxKit.
    1. Re:Check out Perdition by Bronster · · Score: 3, Interesting

      Alternatively, check out nginx. Sure you have to wade through the Russian, but the configuration syntax is pretty simple and it's easy enough to build.

      It uses epoll. We replaced a perdition proxy that was seriously loading two servers with a single 8 process nginx instance that's not even breaking a sweat. It's amazing what the change from 32000 process down to 8 processes can do on a busy site! The two frontend machines are now configured with heartbeat to get full failover of IP addresses. Downtime appears to be on the order of 1-2 seconds with an orderly cutover and probably about 10 seconds for a total host failure.

      Cyrus supports replication now, which is a good way to handle the backends. I'd say more about it, but I haven't actually finished configuring the full failover system yet for this - lots of gating logic required to make sure two machines don't both believe they're master for a bit!

      Er, but why would I help you anyway, you're the competition ;)

      (I work for FastMail.FM btw)

    2. Re:Check out Perdition by Bronster · · Score: 1

      Damn, I really should have actually looked at who I was responding to as well! Hi Matt. I've sort of migrated out of doing disgusting things with Perl, XML and databases to doing disgusting things with Perl, RFC822 messages and ... erm, databases. Not to mention sha1hex storage pools and virtual filesystems.

      I still read the Axkit mailing list for its spam and other exciting goodness - but don't have much need to touch XML, bargepole or not, these days.

      Bron.

    3. Re:Check out Perdition by Ivan+Todoroski · · Score: 1

      From the site, it says that nginx is a "high perfomance http and reverse proxy server". How is this in any way related to SMTP/POP3/IMAP servers?

    4. Re:Check out Perdition by Bronster · · Score: 1

      Ahh, documentation. We sponsored Igor to add POP and IMAP a while ago. We use Postfix for SMTP - that's a separate function entirely.

      I might write up something about nginx as a pop/imap proxy and ask Igor to link to it.

      It really is very nice to use, if hard to read the docs!

  2. MIT by Anonymous Coward · · Score: 2, Interesting

    MIT, an organization which you'd think would have a handle on this sort of thing, simply has a bunch of independent servers and assigns accounts to a specific one. One user might use po10.mit.edu for POP/IMAP, another might use po2.

    Of course, that might just be because the IT department at MIT does not take advice from the faculty and students, and just generally sucks.

    1. Re:MIT by __aaclcg7560 · · Score: 1

      Of course, that might just be because the IT department at MIT does not take advice from the faculty and students, and just generally sucks.

      It's probably a lot more reliable since the IT department doesn't have to deal with the hassles of faculty and students mucking up the email servers. Besides, they probably don't want to share their Diablo 2 game server (which happened at one company I worked for).

  3. You mean, like Cyrus? by Just+Some+Guy · · Score: 4, Informative
    Cyrus is the most amazingly flexible POP/IMAP server I've run, and it supports clustering (a "Murder") out of the box.

    It's not for the faint of heart, but only takes a couple of "a-ha!" moments to go from lost to competent. Good luck!

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:You mean, like Cyrus? by vitroth · · Score: 4, Informative

      A Cyrus IMAP Murder isn't a clustered system, its exactly the multiple servers with a proxy that the original post was describing. (Note: I work for the CMU IT department, I'm familiar with the way this works, but I don't work for the email group.)

      However if you used the Murder as your frontend for clients, and applied fairly standard high availability tactics to the individual backends you could achieve clustering. Make each backend server a redundant load balanced virtual server, then make the Murder know about the mailbox locations on the virutal systems.

      I'm sure it could be done, but its definitely not something that Cyrus does out of the box.

      In practice the multiple servers w/ proxy has been good enough for CMU. With good hardware for the backend servers, and good RAID arrays, hardware failures are rare.

    2. Re:You mean, like Cyrus? by protagonist · · Score: 1

      The latest 2.3.x releases of Cyrus also support replication. You can have a Cyrus Murder plus replication on the backends for redundancy. This stuff works very well with very large installations. Fastmail.fm runs on Cyrus, for example, as well as a ton of university email systems.

    3. Re:You mean, like Cyrus? by Anonymous Coward · · Score: 0
      Cyrus is the most amazingly flexible POP/IMAP server I've run, and it supports clustering (a "Murder") out of the box.
      Murder looks a lot more complicated than a solution using perdition. Given that perdition can use various databases to look up the location of the real back-end imap/pop server, isn't perdition a simpler yet adequate solution for many installations?

      Really, I'm not trying to troll here -- just trying to understand what are the benefits of Murder over Perdition.

    4. Re:You mean, like Cyrus? by Just+Some+Guy · · Score: 1
      Really, I'm not trying to troll here -- just trying to understand what are the benefits of Murder over Perdition.

      The short answer is that a Murder tries to present a unified system image, which is important if you use a lot of things like shared folders.

      --
      Dewey, what part of this looks like authorities should be involved?
  4. The trick is... by Quaoar · · Score: 3, Funny

    ...to make the mail modular so that people of different sizes can wear the armor without the need for re-forging.

    --
    I'll form my OWN solar system! With blackjack! And hookers!
    1. Re:The trick is... by On+Lawn · · Score: 1

      Perhaps you could use an spiral inside the ring. It'd be more weight, but you could adjust it by twisting the rings to push the connection to the outer rungs.

    2. Re:The trick is... by BobPaul · · Score: 1

      Chainmail gains tremendous strength by flattening the two ends of a ring together with a hammer, than drilling and riveting the joint, as good smiths have done for years. An adjustable spiral would not only be difficult and time consuming to adjust, but much weaker both through the lack of riveted chinks and weakness added by adjusting the spirals (like bending a paperclip back and forth).

      You'd be better of with seperate overlapping sheets of mail head to the body with leather straps. Maybe not as good as a single solid piece, but it would be modular like the grandparent suggested without sacrafising the integrity of the individual components.

  5. There is always by jellomizer · · Score: 3, Funny

    You can Point you MX record to google gmail service and modify the pop addresses to point to google mail too.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    1. Re:There is always by Linux_ho · · Score: 1

      O RLY? Google will accept messages addressed to user@x.random.domain? All you have to do is point your MX record their way, and they'll have a mailbox all set up and waiting for the message? Wow, those guys really are geniuses.

      --
      include $sig;
      1;
    2. Re:There is always by corychristison · · Score: 1

      If only it worked that way...

      You'll have to apply a prefix to all of your accounts [eg: -mybusiness-_-username-@gmail.com] and then map users to gmail MX & POP/IMAP accounts... good luck with that. :-)

    3. Re:There is always by jrockway · · Score: 1

      > O RLY?

      YES RLY. It's called GMail for Domains.

      https://www.google.com/hosted/

      --
      My other car is first.
    4. Re:There is always by Linux_ho · · Score: 1
      O RLY?
      Gmail for your domain is currently available as a limited beta. If your organization is interested in helping Google test this service, we'll consider your domain for this beta. You'll need to sign in with a Google Account (or get a new one), and answer a few quick questions about your organization and your email needs.
      Sounds like there's a little more you need to do, besides just pointing your MX record at their servers. Like for instance, getting them to accept you as a beta user, answering a few quick questions, etc., having them set up their system to accept mail addressed to your domain...
      --
      include $sig;
      1;
  6. Foundation. by deep44 · · Score: 2, Interesting

    I would recommend deploying an LDAP-enabled directory server as the foundation for everything else. Almost every other service can leverage the directory for pulling various information about each user. You can really help yourself down the road by making your directory server _the_ single authoritative source of email-related customer information.

    1. Re:Foundation. by charlesnw · · Score: 1

      I agree with this. It is how every large scale (and even smaller scale) environments work. Make sure you setup a multi master LDAP server with replication. This can be a very intense process that requires a lot of work. It is not for the faint of heart.

      --
      Charles Wyble System Engineer
  7. distributed by Geekboy(Wizard) · · Score: 1

    Distributed authentication system (nis, kerberos, ldap, mysql, whatever), and storage (netapp. don't even think about using anything else, just get a damn netapp). have multiple everything and redundancy redundancy redundancy.

    don't forget testing it. get a system up and running, then see what happens if you power off the master. Hint: it shouldn't change anything.

    1. Re:distributed by i.r.id10t · · Score: 1

      Gee, at work we're using one of them IBM "Sharks" with 2 tb of storage... should we really replace it with a netapp?

      --
      Don't blame me, I voted for Kodos
    2. Re:distributed by secolactico · · Score: 1

      Sharks rule. Expensive as hell but redundant up the wazoo and then some.

      --
      No sig
    3. Re:distributed by walt-sjc · · Score: 1

      2T? How do you get by? Damn, I have nearly that on my desktop... :-)

      EMC's not bad either, but I think you get better bang for the buck with Netapp. They are faster. Isn't IBM just rebranding the Netapp's now anyway??? Netapp's snapshots are so cool. Wish we could get that on Linux. EMC doesn't come close either.

    4. Re:distributed by spir0 · · Score: 1

      I looked into buying a netapp a few years ago, but the NZ sales manager at the time was the rudest wanker I've ever had the misfortune of dealing with. He didn't stop short of trying to force me to buy, and even called me an idiot for considering competitor's products. So I politely told him to go fuck himself and this company will never touch a NetApp.

      --
      The reason girls and Windows users don't understand UNIX is because all the documentation is in Man files.
    5. Re:distributed by T-Ranger · · Score: 1

      You mean snapshots like LVM has provided for years? http://www.tldp.org/HOWTO/LVM-HOWTO/snapshots_back up.html ?

    6. Re:distributed by walt-sjc · · Score: 1

      No. NetApp snapshots are VERY different and much further advanced. Read their whitepapers on it to understand.

    7. Re:distributed by Geekboy(Wizard) · · Score: 1

      thats a bad salesmen. so what? that doesn't change the quality of engineering put into the product. don't buy from him, buy from someone else.

    8. Re:distributed by spir0 · · Score: 1

      not an option in a country as small as this, I'm afraid. NZ is a country of 4 million people. I'm sure the States have cities bigger than that... Most vendors only have one local distributor. Some have to be bought from overseas like Australia.

      A pity, cos NetApp gear looks pretty swish.

      --
      The reason girls and Windows users don't understand UNIX is because all the documentation is in Man files.
    9. Re:distributed by Anonymous Coward · · Score: 0

      Same concept, not nearly as slick an implementation. NetApp snapshots are genuinely the hotness, particularly the interface to schedule and manage them.

      The only downside to them is when you want to cleanup the snapshot space in a hurry you end up deleting more snapshots than you necessarily would like to to actually clear the space.

  8. nrg4u by Anonymous Coward · · Score: 0
  9. Use NFS by georgewilliamherbert · · Score: 2, Informative

    From commercial experience: Multiple MTA machines fine. Multiple MUA (IMAP, POP, Webmail) machines fine. Don't use a clustered filesystem; use NFS. All the software of note use locking which plays well with NFS.

    Scaling can be done easily by adding more NFS boxes and managing the directory structure with links or whatnot.

    1. Re:Use NFS by bill_mcgonigle · · Score: 2

      All the software of note use locking which plays well with NFS.

      Just to clarify (I initially parsed this incorrectly), you mean, "all the interesting mail processing software is written to use [perhaps optionally] forms of locking that NFS can tolerate", right?

      Usually locking is the problem people hit with NFS.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:Use NFS by Anonymous Coward · · Score: 0

      You've got to be joking. Avoid NFS like the plague. When NFS goes south, and it happens, you will often have to reboot to recover. Just like Windows. Not exactly what most people would describe as 'robust' and 'reliable'. If you really do want to build a mail server that needs to be rebooted every so often, make sure you turn off automatic filesystem checks, and instead run them manually sometimes. It's not fun to reboot the mail server in the middle of the day and then watch it decide to run a three hour file system check.

      Here are a couple of things to consider:

      Virtualization. If you run the OS on top of a hypervisor, you can abstract away the hardware. That lets you easily move the OS from machine to machine, even if the architecture is different. Some virtualization software even lets you do this live.

      Don't run any local disks at all. Separate the CPU box from the disks. Now you have an easily replicated OS box tied to a redundant-as-you-want-it-to-be SAN.

      Do nearline backups of your mail using something like rdiff-backup to some cheap SATA RAID box. 99% of the mail you need to recover was deleted within the last few days. Easier than recovering from tape.

      Intentionally break your setup, fix it, and document how that all works before you put anything into production!! It really doesn't matter how redundant and reliable your setup is if you have to pull out manuals when there is an emergency. Believe me, your brain will only work at 10% of its capacity when there is a crisis. You want to have some easy to follow tested instructions. Pull disks out live. Totally break your RAID setup on purpose. Fix it. Pull the fibers out. Move the OS around. Recover from tape. How fast can you rebuild from scratch?

      Separate gateway/spam/virus filtering from mail hub. Redundant gateways. Halve your load using greylisting. If you have multiple gateways w/ multiple MX records, that means putting the greylist data on a robust networked database. I like PostgreSQL.

      How are you going to monitor things? How much email are you processing? What's the load, and what's causing it?

      GFS looks interesting, but I haven't any actual experience. Check it out.

      Please god, do not use NFS. NFS4 maybe - I can't comment from experience. NFS3 - eyahhh!

    3. Re:Use NFS by georgewilliamherbert · · Score: 1
      You've got to be joking. Avoid NFS like the plague.
      Or don't use Linux for your NFS server.

      Solaris, or in extremis NetApp or the other dedicated NAS boxes, do just fine, up to pretty darn big sized installations.

  10. I am in the process of doing this... by charlesnw · · Score: 3, Interesting

    I run an open source project that is building an exchange replacement. http://www.thewybles.com/~charles/oser is the project homepage. It will be highly available (supporting both hardware (cisco/webmux load balancers) and software based load balancing. Along with a whole host of other groupware functionality. I have done high availability e-mail solution deployments. I am in the SoCal area but am willing to travel if necessary. There are others who can help you as well. Your choice. My blog covers a lot of the progress of the project and details. I would be happy to work with you to complete this task. Just e-mail me and we can work out an arrangement.

    --
    Charles Wyble System Engineer
    1. Re:I am in the process of doing this... by Anonymous Coward · · Score: 0

      Your four OSER "registered trademarks" are not on TESS, so the ® symbols are invalid.

  11. Cyrus + postfix + ldap + spam/virus by joib · · Score: 1

    See e.g. article about a university system. Also Cyrus supports load balancing and failover via murder, although backends (the actual file stores) still remain single points of failure.

    1. Re:Cyrus + postfix + ldap + spam/virus by vitroth · · Score: 1

      I knew somebody had to be applying High Availability tactics to a Cyrus system. Combined those techniques with the multiple server proxy capabilities of the Murder and you've got a system which should scale to unbelievable proportions.

    2. Re:Cyrus + postfix + ldap + spam/virus by Nation+XII · · Score: 1

      ..or you could just get a few decent alpha DS10's for around a grand, install VMS and use it's mail system on the cluster, then measure your uptime in four digit days.

    3. Re:Cyrus + postfix + ldap + spam/virus by Nutria · · Score: 1

      ..or you could just get a few decent alpha DS10's for around a grand, install VMS and use it's mail system on the cluster, then measure your uptime in four digit days.

      Amen, brother, amen. But you'd have to pay yearly for the OpenVMS licenses. And that adds up.

      --
      "I don't know, therefore Aliens" Wafflebox1
    4. Re:Cyrus + postfix + ldap + spam/virus by Nation+XII · · Score: 1

      Aye.. you can negotiate it though with your IT dept. Usually HP's gentle with the rubber gloves for someone testing the water/starting out with it. :)

      It's a bit like a friend that works for $.EDU.AU .. they negotiated with MS and have the entire product suite. Cost per additional license? $7.50au. Exchange with 3-billion L^Husers... $7.60 .. XP home.. 7.50.. Server 2003.. 7.50.. etc. I know of another business (small) that's negotiated with HP for tru64 el-cheapo so I "imagine" VMS (hopefully) wouldn't be that different, especially considering how easy it is to get into the hobbiest program these days.

  12. For starters... by metamatic · · Score: 4, Informative

    ...don't touch mbox format. Whatever software you choose, make sure it uses Maildir.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    1. Re:For starters... by p2sam · · Score: 0, Flamebait

      Come on now. If I had mod points, I'd mod you flamebait. :-)

    2. Re:For starters... by metamatic · · Score: 1

      Well, it's surprising how many IMAP systems are still based on mbox. It's a complete disaster as soon as you hit them from Apple Mail, which opens multiple threads at once; or try to do filtering of incoming mail into folders while the user might be updating the same folders.

      And then there's the breakage over NFS, the locking problems, the fact that it makes it harder to cluster, and so on.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    3. Re:For starters... by T-Ranger · · Score: 2, Insightful

      Or the DBish format of Cyrus. Or Netmail. Or a 100 line Perl, one table MySQL script. Or, fuck, even Exchange or Groupwise. But for the love of of all the is holy, not mbox.

    4. Re:For starters... by subreality · · Score: 3, Informative
      ...don't touch mbox format. Whatever software you choose, make sure it uses Maildir.

      You shouldn't state this as an absolute, because it's not. You also need to give reasons WHY to use maildir.

      An example exception case: We had an application where thousands of very small emails needed to be delivered to a single mailbox every minute. They all get picked up every minute by POP, and all messages are deleted every cycle. mbox is *vastly* better in this scenario, because you don't have to create all the files, move them around a few times, stat large dirs every time POP runs, etc. With mbox, all the delivery threads become sequential, so you cut down seek overhead, and the POP read becomes a single large file read, which is far faster. You also cut way down on metadata updates, and caching works better.

      mbox shines in this scenario, and it's not that uncommon. Many customer service apps work like this.

      In the situation of handling many users's email in a scalable system Maildir is usually better (NFS-safe, concurrent delivery, efficient individual message deletion, etc), but you've not even considered the other range of things available. MH and database backends come to mind. Each has their good and bad points.
    5. Re:For starters... by kashani · · Score: 1

      And I would mod you as never having built a real mail system. mbox doesn't scale.

      kashani

      --
      - Why is the ninja... so deadly?
    6. Re:For starters... by metamatic · · Score: 1

      The original question asked about IMAP. Therefore POP-only scenarios in which mbox makes sense aren't really relevant.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    7. Re:For starters... by billcopc · · Score: 1

      Out of sheer curiosity what kind of app needs to dump thousands of tiny emails then fetch them by POP ? Why not just a good old fashioned SQL database ?

      --
      -Billco, Fnarg.com
    8. Re:For starters... by kappa · · Score: 1

      We use mboxes for our 10^7 users. Indexed mboxes are OK.

      Maildir sucks badly at such scales. Why? Try accessing 100000 files at once or just having 10000000000 files lying around.

    9. Re:For starters... by subreality · · Score: 1

      It's a lot easier to write a good POP client than a good SMTP server, so many customer service apps are written this way. It ends up in the same DB either way, so they write it with the protocol least likely to break things.

    10. Re:For starters... by subreality · · Score: 1

      I was just illustrating that it's a more complicated thing than "use maildirs", and that's an example I'm familiar with.

    11. Re:For starters... by dubl-u · · Score: 1

      You shouldn't state this as an absolute, because it's not. You also need to give reasons WHY to use maildir. An example exception case: We had an application where thousands of very small emails needed to be delivered to a single mailbox every minute.

      If you are using mail servers for something other than email, then advice about how to handle email would indeed not apply.

      Your comment is sort of like saying the advice for safely handling uncooked poultry doesn't really apply to the test engineers using the chicken gun to shoot raw chickens into running jet engines. It's true, but you would hope they already know that the normal rules don't apply.

    12. Re:For starters... by Skapare · · Score: 1

      While your scenario probably does need mbox, it's not really typical. The biggest factor is that it deletes all mail in every pickup cycle. Of course that does mean there is mail arriving between the time all mail was fetched and the delete all is requested, which means the IMAP process has to rewrite the mbox file, which means locking out further deliveries while that is taking place. But regardless, it's not the kind of scenario most mail server users are doing. Your setup is probably better off using something else besides either mbox or Maildir, anyway.

      --
      now we need to go OSS in diesel cars
    13. Re:For starters... by fimbulvetr · · Score: 1

      LOL, I'm stealing this if you don't mind:)

  13. Shared Storage by ArkiMage · · Score: 2

    Multiple servers all looking at the same files? That's what shared storage is all about.. Fibre Channel, iSCSI, etc... Look at GFS from RedHat or any of the others like IBM's recently announced GPFS. Fedora or CentOS for RedHat's GFS on a more reasonable budget.

    1. Re:Shared Storage by Nutria · · Score: 1

      Multiple servers all looking at the same files? That's what shared storage is all about.. Fibre Channel, iSCSI, etc... Look at GFS from RedHat or any of the others like IBM's recently announced GPFS. Fedora or CentOS for RedHat's GFS on a more reasonable budget.

      OpenVMS. Clustering is deeply built into the OS and all relevant libraries.

      --
      "I don't know, therefore Aliens" Wafflebox1
  14. open SMTP relays by JeanBaptiste · · Score: 3, Funny

    cheap, reliable, scalable, and there doesn't seem to be any shortage of them.

    now if I could only figure out how to receive...

  15. Yet again, Communigate Pro by ejoe_mac · · Score: 1

    Scales beyond anything you can be doing, and has the features you're going to want. Check it out: http://stalker.com/

    Run it on Linux, it just works...

    1. Re:Yet again, Communigate Pro by corychristison · · Score: 1

      My school runs this.

      Honestly, I have a hard time trusting anything owned by a company with the word "Stalker" in it. :-P

  16. so you want what ? load / redunancy / clustering ? by johnjones · · Score: 1

    there are many elements to this problem

    o when a user points their mail client at the server do you want one address ?

    if yes
    then you want to invest in equipment/software load balance the IMAP/POP3/HTTP sessions across mail servers And shared require all serve out same same client data
    and
    you want several/all mail servers to be able serve out all the accounts then you want a shared stroage backend
    (either file system OR database wise)
    else
    simple option many mail servers all acting exactly the same with exactly the same config only differant servers used by differant clients and maybe a backup
    lotus notes has had options like this for a while so has exchange to a lesser degree these solutions base it around IMAP/POP3 multiplexing but exchange and notes Aggregate as well if needed

    if you want THE unix mailserver talk to Sun and their IMAP (java mail server system or whatever they are calling it now...) works

    regards

    John Jones

  17. Re:so you want what ? load / redunancy / clusterin by Gothmolly · · Score: 1

    They have this thing called DNS now, where you can create 'aliases' for all of your servers when someone tries to connect to 'mail.isp.net'. It's kind of interesting stuff, one of these days it might take off.

    --
    I want to delete my account but Slashdot doesn't allow it.
  18. Clustering and redundancy? Look at CommuniGate... by p0rkmaster · · Score: 2, Interesting

    I have been running CommuniGatePro mail servers for years. They have all the features you're looking for and more. The main thing I love about CommuniGate is the fact that I have one application that is the MTA, IMAP server, POP Server, and WebMail all in one. No dependencies. No futzing around with PHP or config files for half-a-dozen different applications. And it also supports clustering. A low-end cluster would consist of 2 machines with a NFS or CIFS/SMB backend for the storage. They also support so many operating systems it's not even funny. Solaris, Windows, Linux....even OS/2! You can grab a fully-functional trial off their site and have it up and running in minutes. Check it out, you won't be sorry. Their stuff scales from small systems to really huge ones with millions of accounts. For example - UC Berkeley's mail system is CGP. You can check 'em out at http://stalker.com/.

    --
    ... I like to keep an open mind, but not so open that my brains fall out. - Judge Harry Stone, Night Court
  19. Some ideas for qmail by Matt+Perry · · Score: 1

    This page might have some ideas.. Also see this page for a howto on setting up the mail server.

    --
    Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
    1. Re:Some ideas for qmail by fimbulvetr · · Score: 1

      Qmail is bad news because you need 50 different patches from 30 different people. Not to mention the all so famous security guarentee isn't even (a) honored by DJB and (b) doesn't apply after you start using Joe's qmail-ldap-mysql-pop3-super-vacation-script patch.

      Don't depend on finding anything in the code either. Everything, I mean _everything_ is hard coded. If you can navigate around regular open source code, it's not going to help for qmail. Everything is a nightmare in there. I encourage you to compare any random file out of postfix vs. qmail.

      Finally, new features do not exist, unless you got after an aforementioned patch. Wait til the day you have to emergency rebuild qmail and figure out which patches you installed to which binaries on which servers.

      I could go on, but those should be enough to have you steer clear.

  20. Scalix by On+Lawn · · Score: 1


    It costs, but since I've been looking into mail servers lately I can let you know Scalix has an enterprise edition that run on multiple servers.

  21. BAD LINK by On+Lawn · · Score: 1

    Please go here instead:

    Scalix Comparison

  22. Re:so you want what ? load / redunancy / clusterin by johnjones · · Score: 1

    and does it shift 500 light users onto a differant server from the 1 heavy user is hogging all the cpu or the box has crashed/error ?

  23. IBRIX by Midnight+Warrior · · Score: 2

    If you have a lot of data, then you can choose a scalable system like IBRIX and then use stateful load balancers between each of the POP3/IMAP servers. When you get to multiple nodes on the same filesystem, you have two problems: synchronization between nodes and locking.

    Note that the Oracle Clustered Filesystem v2 has now been merged with the mainline kernel.

  24. Use a forwarding server on the front end by Cybersonic · · Score: 1

    I would recommend RadWare http://radware.com/ or f5 http://f5.com/ to load balance the traffic to multiple IMAP and/or POP back end servers.

    You can even cluster the load balancers...

    --
    Cybie! aka Ralph Bonnell
    1. Re:Use a forwarding server on the front end by Cybersonic · · Score: 1

      Or go open source: http://www.linuxvirtualserver.org/ has a load balancing agent.

      --
      Cybie! aka Ralph Bonnell
    2. Re:Use a forwarding server on the front end by ChrisJones · · Score: 1

      LVS is a pretty damn sweet system and if you are worried about setting it up yourself, or your PHB wants a maintenance contract, I'd recommend talking to loadbalancer.org - we bought a couple of them for some web clustering at work and they are proving to be very reliable and easy to work with :)

      --
      Chris "Ng" Jones
      cmsj@tenshu.net
      www.tenshu.net
    3. Re:Use a forwarding server on the front end by Cybersonic · · Score: 1

      wow! I didn't realize there was a company commercially supporting LVS clustering to this extent! The pricing is quite reasonable for what they are offering...

      --
      Cybie! aka Ralph Bonnell
    4. Re:Use a forwarding server on the front end by ChrisJones · · Score: 1

      Yep, it's very very reasonable compared to the silly high level load balancers some people want to sell you.
      Also the company is pretty small and staffed by clued people, which I always appreciate :)

      --
      Chris "Ng" Jones
      cmsj@tenshu.net
      www.tenshu.net
  25. Layer 4/7 switching by thegrort · · Score: 2, Informative

    The best solution I have found is to put generic smtp/imap/pop servers behind layer 4 switching.

    Using this the only thing your servers need in common is backend storage that you can easily mount off NFS etc.

    1. Re:Layer 4/7 switching by fimbulvetr · · Score: 2, Funny

      This way is the only inexpensive, noncommercial software, non-kludge, non-propretary like way to do it.
      I've built several systems like this, one is close to 100,000 accounts with no problems. This system scales out (i.e. adding another cheap server for more power) as opposed to scaling up with huge servers (price, power demands, price, and price).

      It's also very easy to troubleshoot.

      Do not split your email users between servers and proxy them. Big problems.

  26. Qmail/Vpopmail, but only if you can spend the time by Etcetera · · Score: 2, Interesting

    A properly configured, customized, qmail/vpopmail cluster is a beauty to behold. Unfortuantely, it takes the better part of a month to get up to speed on how the system works, and it will be many months overall before you really feel "comfortable" with how it works (longer if you're coming solely from a sendmail background).

    That being said, it's also rock-solid, extremely fast when properly configured, and more flexible than you can imagine.

    We currently use a single RAID-10 NFS and MySQL DB system handling the backend, with 5 cluster servers in front of it, each of them able to perform any number of roles. (We had a load balancer in front of them at one point, but it actually more just got in the way than anything else.) A sixth box handles all DNS requests for the servers, and we'll be bringing a 7th up soon to offload some of the spam processing from the three that currently run our asnychronous processing code. The cluster boxes are cheap MicroATX Athlon XP 3000+ machines with 2 GB of RAM. I've seen each box take well over a 100 simultanous SMTP connections without CPU being noticably affected. Current 1 does webmail, 1 does incoming MX, 1 does POP3/IMAP, 1 is for development and servers IMAP to the webmail box, and 1 is running SMTP, 587, and SMTP-SSL.

    When properly administered, I think it beats anything out there. However, if you can't afford the time and 3am-bang-your-head-against-your-monitor agony, I'd suggest one of the other solutions people have mentioned here.

    My $.02

  27. My solution by subreality · · Score: 5, Informative

    It's been a while since I built a mid-size email system, but the last time I did it I used:

    Data stores were maildirs on NetApps
    SMTP servers running Postfix
    IMAP servers running Courier IMAP
    Logins via NIS
    IMAP and SMTP failover by means of load balancers

    The SMTP and IMAP servers get NIS-distributed automounter tables, so everyone's homedir is available everywhere. The load balancers distribute the load out to the SMTP and IMAP servers, and work around any that fail. Mail comes into the SMTP servers, and Postfix delivers to maildirs in the users' homedirs. Any SMTP server can deliver to any user. Users log in with IMAP on the Courier IMAP servers. Again, all homedirs are everywhere, so it doesn't matter which server they hit.

    Adding capacity at any point is easy - you just add more servers of the appropriate type when you need more. IMAP and SMTP are fully redundant. Load balancers usually only operate in failover pairs, but you can add more A records in DNS for more LB pairs if you need it.

    The one sticky point is the data stores on the NFS servers. Adding capacity is easy (just add more servers). but there's no easy way to make this fully redundant. See notes for more.

    So there you have it. That'll scale to a pretty large system, and it's simple to implement. It's not THE MOST scalable system, but if you have to ask, this is probably sufficient for your needs.

    Notes:

    You must use maildirs, not mbox. Maildirs perform very well even on NFS, because there can be multiple simultaneous readers and writers. mbox requires locking.

    With NetApp, or Red Hat Cluster Server, or any other cluster NFS server, you can make the head end redundant, so your disk shelf becomes the last single point of failure. If you run RAID 1+0, you can have all the disks mirrored across two shelves, so at least the hardware is completely redundant. However, there are still rare, but possible failure modes. STONITH is, ultimately, a problem that has no perfect solution. (Look it up if you're not familiar with STONITH.)

    NetApp makes very reliable NFS servers. Even in single head configurations my uptime experience has been incredibly good. Dual head is even better. But they're god awful expensive. There are other ones you can buy at all different price points. Clustered file systems like Coda sound really sexy, but they're still half baked. Lustre http://www.lustre.org/ might work well, but it wasn't available when I last did this, so I can't say. Choose what's appropriate to your needs and budget.

    I used NIS. These days LDAP is more fashionable. Make your LDAP server redundant of course.

    You need redundant networks. In the simplest case, put half of each type of servers (IMAP, SMTP, LB, NFS) on two different switches.

    I never bothered with POP, but you can get POP servers for maildirs, too.

    Configure your load balancers to balance per session - IE, if a user creates multiple IMAP connections, they all go to the same server. This helps keep down the number of NFS mounts, LDAP requests, etc.

    Software opinions: I like Postfix and Courier. They're simple, robust, flexible enough for most situations, and perform very well. Cyrus also has a good following in the large-scale arena, but does things different. Qmail's non-OSS license prevents people from releasing versions that strip out djb's quirky way of doing things, which is why I left it for Postfix (and never looked back). Sendmail doesn't suck as much as it used to, but I haven't really seen why I SHOULD use it these days either. Any of these can be made to work, though, so use whatever you're comfortable with.

    Tip for any email system: outright reject (IE, don't accept at all, don't send to someone's spam folder) as much spam as you can. If 90% of your mail is spam, and you reject the 90% most-likely-spam (delivering the other 10% more questionable stuff to a spam folder), you've just increased your mail performance and disk space by > 5x.

    Good luck!

    1. Re:My solution by kappa · · Score: 1

      > You must use maildirs, not mbox. Maildirs perform very well even on NFS, because there can be multiple simultaneous readers and writers. mbox requires locking.

      Locking is obviously not an issue with mail. A mailbox is accessed by one user -- his owner -- and local delivery agent. Locks are fine here. There is indeed some concurrent access but as far as mail mostly sits idle in the file and waits it's not a problem.

  28. A typical way to set this up. by jafo · · Score: 2, Informative

    The typical way to set this up is:

    High availability redundant NFS servers for storing the mailbox data and user information.

    One or more machines mounting this file-system for handling POP, IMAP, and SMTP from accounts and mailfolders off the NFS server.

    Webmail can be tricky because you need to make sure that either users always hit the same machine for webmail during a session, or session information is shared among the cluster. LVS systems can handle either of these scenarios, so it's not a problem, just something you have to be aware of.

    LVS systems up front, again running High Availability which do load-balancing and automatic removal of failed servers. These are the machines that have the IPs which your customers contact, and then get spread across the real machines in the middle layer above.

    This sort of solution works really well, and we have deployed it for customers of ours with good results. You can get started for only $5k to $10k worth of hardware and if you're building this from scratch it will probably only take you around 100 hours. If you have experience with this sort of setup it can take as little as 10 to 20.

    If $5k to $10k for hardware is out of your budget, you probably shouldn't be looking at this sort of solution. Individual stand-alone servers or even a single pointy box, possibly with high availability, is probably where you want to be in that case.

    linux-ha.org is the place to go for High Availability software on Linux.

    Sean

  29. Scalemail by nife00 · · Score: 1

    Scalemail looks like its a good start. http://www.inoi.fi/open/trac/scalemail/ "A scalable (but not fully highly available, atleast not yet) virtual domain system for handling mail for many users, based on Postfix, LDAP and Courier-IMAP."

  30. A Real-world Big Design by jjgm · · Score: 4, Informative

    I recently designed and built a mail system for a six-digit ISP userbase.

    Before I feed you the design, let me tell you a *crucial* concept that you must carry with you at all times.

    EMAIL SYSTEMS ARE PROTOCOL SPEAKERS BETWEEN USER DIRECTORIES AND STORAGE.

    Read that and inwardly digest it before you even start to design your system.

    For the design, first, I'm going to proselytize a particular piece of software.

    DOVECOT IS THE FREE POP/IMAP SERVER OF THE FUTURE. It leaves the Cyrus codebase rotting in the slime. It already kicks Courier's butt in performance and ease of deployment. It's beautifully coded; it has the most elegant authentication architecture; it's exceptionally fast. It isn't complete yet but it's featureful and stable enough that I have successfully deployed 1.0-betas into production. http://www.dovecot.org/ for the last IMAP server you'll ever need.

    Here is the design:

    1 x OpenLDAP 2.3 master server
    2 x OpenLDAP 2.3 read-only replicas
    2 x world-facing mail servers running Postfix 2.3
    4 x mail scanning servers running amavisd-new 2.3.3, ClamAV, SpamAssassin, Sophos SAVI and Sophos PMX-ENGINE. LMTP in from the mail front-ends; ESMTP out to the mail storage.
    2 x mail storage front-ends running Postfix 2.3 and Dovecot IMAP/POP3 1.0-beta. These servers also run mysql for amavisd-new quarantine and squirrelmail user options. Actual storage is over NFS to the NetApps. Using Dovecot's Sieve-based delivery agent for server-side filtering.
    2 x Squirrelmail webmail servers. We have our own skin, and our own sqm plugins as the user interface to our various system options - which are all in LDAP. We have integrated MailZu into sqm as a quarantine view/release interface.
    2 x NetApp FAS3020c heads w/4TB NFS storage allocated to mail.

    Everything is load-balanced using foundry hardware LBs. It's very high-throughput and very reliable. It's also easy to monitor (we're using Nagios).

    Base OS is Debian Sarge with applicable backports. I'd prefer FreeBSD but this happens to be a Debian shop, and I wasn't out to change their world, just their mail system.

    Probably the most borderline item is mysql's performance as a quarantine DB; however much RAM and index/query tuning we throw at it, I'm yet to be satisfied with InnoDB's performance on this 100GB+ INSERT-heavy database.

    If I could change one thing about it, it'd be to use the extremely pretty and surprisingly good value @mail (a commercial choice) rather than SquirrelMail. I'd also consider Fedora Directory Server over OpenLDAP, but it wasn't looking ready for this design at the time.

    I have to say there is some bad advice in this thread; now for the hatchet:

    Cyrus: difficult to configure, doesn't support shared storage, horribly ugly codebase, and has some nasty-ass failure modes.
    Qmail: stale, poorly integrated MTA software from the bitchiest developer in town.
    Sendmail: doesn't scale. Even the developers think so, which is why Sendmail X is a rip-off of postfix.
    Communigate Pro: if I don't get to futz with the source for integration and value-add, I'm not interested.
    GFS/GPFS: you don't need the complexity or interesting failure modes of shared-block-storage filesystems. Stay away.
    Linux NFS: isn't reliable enough. We've had problems with data corruption to Linux NFS, both kernel and userland. Right now the only NFS server implementations I trust are NetApp's and Solaris's. No doubt the Linux one can/will improve, or already has, but trust is a hard thing to build :). Plus NetApps are shiny, marvelously reliable, and I love their support.

    1. Re:A Real-world Big Design by ArkiMage · · Score: 1

      GFS/GPFS: you don't need the complexity or interesting failure modes of shared-block-storage filesystems. Stay away.

      I'd be curious about the "interesting failure modes" you mention. Do you have (bad) experience with this? I've deployed this technology multiple times with great success so far. It appears from your design you also try to avoid the "single point of failure". That's why with FC shared storage and GFS I generally design in more than one SAN/RAID unit and keep them sync'ed. GFS in my experience though beats NFS hands down. It's a local filesystem, most apps have no clue it's shared, it's pretty much totally transparent. NFS, even _good_ NFS, has done strange things or "let me down" much more often than GFS ever has.

      YMMV, but for me "it just works".

    2. Re:A Real-world Big Design by p0rkmaster · · Score: 1

      -> Communigate Pro: if I don't get to futz with the source for integration and value-add, I'm not interested.

      CGP has a well-documented api for all kinds of third-party integration. I have sucessfully integrated ClamAV and SpamAssassin to communigate.....so I don't really understand the need for source here. In fact - CommuniGate's flexibility in this area (the ability to interface with other applications) makes it easier to work with than any other mailer I've worked on before. What kind of value-add/integration did you do that required you to read or modify source?

      I love open source as much as the next guy - but after having to deal with managing open-source mail servers for years, I don't miss it and you can have my CGP server after you claw it from my cold, dead fingers.

      I agree with you about NFS, though. Either NetApp if you can afford it or x64 sun boxes running solaris if you can't is a really good way to go.

      --
      ... I like to keep an open mind, but not so open that my brains fall out. - Judge Harry Stone, Night Court
  31. I wrote my SMTP/POP servers to handle this problem by kingradar · · Score: 2, Interesting

    I started a free email service to compete with Gmail about 2 months after Gmail launched. For those interested, the name is Nerdshack.com.

    At first I used Postfix and Cyrus, but I found it to be a nightmare when your talking about more than 50k accounts.

    What I wanted was an email platform that integrated with ClamAV, DSPAM, supported SPF, Greylisting/Blacklisting/Whitelisting, and was all controlled from a MySQL database. I also wanted it to support SSL, and clustering.

    Frankly I didn't find anything. So I wrote my own. This may not be your cup of tea, so if not I reccomend looking at DB Mail (www.dbmail.org) and Cyrus (asg.web.cmu.edu/cyrus). Both are compotent mail servers, can be built to support a large user base. The problem I had was expanding their feature sets.

    As has been mentioned numerous times above, getting stock open source software to support a large user base is a huge pain. Combine that with trying to add in things like DSPAM, SPF and ClamAV, and your going to be faced with a nightmare. The system you end up with will be a kluge of hacks, custom scripts, and chewing gum. To me that seemed to much like a house cards. On top of which, most open source sytems do not handle large quota accounts very well. Run benchmarks against your favorite mail server using a 10 to 20 gig mail store for a single user. You will quickly find that even maildir struggles with that many files. (Hint, make sure you use ReiserFS at least.)

    So I went the route of Gmail, Yahoo, and Hotmail. I wrote my own, and after a few early bumps in the road, its pretty solid. I've had 100% uptime for over 300 days, util last month when I moved datacenters.

    Basically how I set things up is I have an Alteon AD4 load balancer that balances traffic amongst my application cluster. This app cluster runs my custom code which speaks SMTP and POP (IMAP is about 75% done), and interfaces with DSPAM, ClamAV, libspf, OpenSSL, LZW (for compression), and supports a host of other features. I even support using public key encryption (ECC) to store messages on disk with your public key, and then encrypt your private key with AES256 using your password as the key. Its seemless to the end user, but guarantees privacy while the mail is on my servers. I even created a point system to allow me to automatically block IP addresses that attempt dictionary attacks, etc (though its disabled at the moment). Each server caches everything it can to reduce database load, and uses a connection pool for retrieving messages and running queries. I wrote my server in C, so its very, very fast.

    These app servers store user information, preferences, etc, in a MySQL database. The actual messages are stored on message storage servers using a custom algorithim, and protocol for speed. Every message is stored on two servers, with both locations stored in the database. Needless to say my system rocks. Each Dell 1650 server can support close to 1000 simultaneous connections while using less than 10% of the CPU.

    What I'm working on now is the IMAP server, integration with Memcached, and moving configuration settings into an XML file. Right now config settings are DEFINE parameters, which means changing anything requires a recompile. I've also found that my database is the bottleneck, so I want to offload as much as I can to Memcached. Checking whether an email address exists, or using my custom point system with the database is too inefficient, so I hope Memcached will help.

    I've thought about releasing the source under the GPL, but I don't think its quite ready. I want to at least get config settings into an XML file first. I'd also like to find a company to sponser my development, but that hasn't happened yet. (I still have a day job.)

    Executive summary. Its always more fun to write your own, and then post to /. about it.

  32. How Much Money Do You Have? by Anonymous Coward · · Score: 0

    The best way to do it is to buy a NAS box and use Maildir to store the mail (so you don't have to worry about NFS file locking issues) then use replicated LDAP servers (for redundancy) to store the account details, one DNS entry for your SMTP server (which you can later use round-robin entries to scale to multple servers) and another DNS entry for your POP/IMAP connections so you can split them off onto a separate machine. I'd use postfix for the SMTP server and Courier IMAP for POP/IMAP. And of course, you need SpamAssassin and probably clam-av or some other anti-virus solution.

    The nice part about this is that you can originally start this all on a single machine, and migrate the different components off as the system load increases. You probably want to start with a dedicated NAS box though, even if it's just a regular Linux box running software RAID and NFS, as any new machines are going to need heavy remote disk access to the mailspools.

  33. Re:I wrote my SMTP/POP servers to handle this prob by Bronster · · Score: 2, Informative

    Wow, that's really interesting. I work at FastMail.FM and we've built our system on Cyrus as the backend, which has lots of advantages but also some big disadvantages.

    We use open source software throughout our system and contribute back most of our changes (where they actually have some utility outside our little world, 50 line perl programs that just query out database for status information need not apply - and we wouldn't want to inflict our web framework on the world. It certainly doesn't need another web framework with a steep learning curve and funky special cases!)

    Right as I type this (or at least when I stop typing and get my arse back to working on what I'm being paid to do) we're setting up a replicated environment with pairs of Cyrus servers:

    * Dual Xeon with hyperthreading
    * 8Gb RAM
    * 12 SATA drives configured as 4 arrays:
        [73Gb RAID 1] [73Gb RAID 1] [1.2Tb RAID5] [1.2Tb RAID5]

    Each array is then split in half, with the first partition holding an active Cyrus partition and the second half holding a replicated set from its "pair" server. This spreads IO evenly.

    The small RAID1 sets are faster disks and they hold the metadata partitions which get most of the IO.

    We don't have these things in production yet (still huge IBM monster machines with 6Gb memory and terabytes of attached SATA storage. They're much more reliable but don't have replication, so it's a tradeoff that makes an array failure much more painful to recover from).

    Every so often I do wish I had the time to build a full IMAP server from scratch with a modern indexed database engine (boo hiss in the direction of Berkeley DB) and the capability to store multiple copies of files. I've already done something like that with our virtual filesystem that provides DAV and FTP access to files on the servers, as well as websites viewing parts of your filespace - it's shiny and I can reboot any server in the VFS backend set without worrying about impacting production.

  34. Flawed plan. by mnmn · · Score: 1

    Think of redundancy. What is it supposed to achieve? One goes down the other keeps going...

    Now 3 servers would be a waste. Think about it. What are the chances a casing would FAIL?

    So lets put 3 servers in one box. Data has to go onto each of the 3 disks. Instantly. Theres so much IO involved. Should each email coming in have to go through the tcpip stack, through the kernel API levels, through the HAL out the driver, out the network card, through the switch and all the way back down to the disk? Using too much makes things less stable.

    So lets put the 3 disks together with one chip and lets call the chip servraid. Data is copied across the disks immediately by the chip in hardware, and the OS doesnt see it. Offloading work from the CPU and OS. You can do the same for the CPU and memory, and it will resemble the IBM xSeries 236, or countless others from Sun, HP, Dell etc. Medium level servers from these companies have redundant disks, power supplies, multiple redundant CPUs and NICs and even redundant memory slots. The only common part is the chipset and the motherboard, and of course the metal chassis. Both have extremely low instances of failure. About the same as the switch that connects the 3 servers, and the mechanism on the public side that is supposed to round-robin or otherwise load balance the servers.

    Just get something like the x236 (or the equivalent Opteron system from Sun). Use qmail on FreeBSD and you will not lose email.

    --
    "Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
  35. One scalable Sun box by Anonymous Coward · · Score: 0

    These multi-server solutions will increase complexity and increase the amount of sysadmin work. You could try switching to a single scalable Sun box. If you need more resources, throw in more cpus, ram, or disks. You have real reliability and scalabilty on a single machine. I've used Suns for over 10 years in a banking environment. You can sleep at night with a single critical Sun system.

    Simplicity, less work, reliability, scalability.

    Buy a Sun.

  36. How large providers do it. by dodobh · · Score: 1

    http://www.hserus.net/mailboxes-srs-inboxevent2004 .ppt

    http://72.14.203.104/search?q=cache:v5XWBwgqXQcJ:w ww.hserus.net/mailboxes-srs-inboxevent2004.ppt+inb oxevent2004.ppt+site:hserus.net&hl=en&ct=clnk&cd=1

    That system currently handles over 41 million users, serves up POP3, IMAP, Webmail, spam and virus filtering for paying customers, and deals with over half a billion messages per day.

    Every service is on physically separate hardware: MX, outbound MTAs, content filters, frontends....

    --
    I can throw myself at the ground, and miss.
  37. That is simple by Anonymous Coward · · Score: 0

    Most of them are on windows. Just use a virus to re-configure.

  38. Why bother? by Triones · · Score: 1

    Just use gmail for domain.
    Definitely more scalable than anything that you can come up with.

  39. Mail:Toaster by bemis · · Score: 2, Informative

    you should check out mail toaster from tnpi - it's open source - built on/against FreeBSD - but a creative soul can pretty easily get it going on Linux (if Linux is that important to you).
    http://www.tnpi.biz/internet/mail/toaster/

    it's qmail/imap based and scales quite well in my experience.

    1. Re:Mail:Toaster by The+Irish+Jew · · Score: 0

      I would absolutely not recommend Mail::Toaster. Qmail has tons of cruft and is incredibly obtuse, so why would you want to add a bunch of random perl scripts on top of it? We use it where I work and it is a nightmare, through and through. Initally we had 4 dual 2.8 xeon boxes w/ 2gb ram each and qmail would buckle under a medium email load. We actually hired the guy who wrote Mail::Toaster to set the cluster up and even he couldn't get it working acceptably. Its a mess. When something doesn't work(which will happen) have fun peeling back layer after layer of perl script and qmail retardedness to figure out whats wrong. And don't think about using an NFS share for mail storage. Qmail on FreeBSD crashes routinely when delivering mail over nfs requiring a reboot.

      For comparison before this debacle we had all mail running on a 400mhz celeron using a custom written mail server that handled somewhere between 1/2 and 3/4 of the current load.

      For the love of god don't use qmail in the first place, but if you do, don't add a bunch of crappy perl scripts around it.

  40. Why locking matters by subreality · · Score: 1

    This changes when you have multiple LDAs and MUAs sharing an NFS store. Locking matters a lot. On mbox, if you have a user that has a 500MB mailbox, and they delete the first message, the whole file has to be rewritten. While that's happening, all your SMTP servers have to queue mail for that user, because the mbox is locked. When you have a user sitting there incrementally deleting messages one by one off the top of their mail, at the same time as spammers are delivering mail to the end of the file, that can make stuff backlog pretty bad.

    Issue #2: some mail clients create multiple concurrent connections to the server when you're reading mail. With mbox, this hurts. :)

    Aside from the locking issue, this creates a ton of IO on your NFS server, due to constant mbox rewrites, as well as simply having to read the whole file every time a user connects. The sheer volume of IO for mbox is really the bigger problem.

  41. how cam.ac.uk do it.. by martin · · Score: 1

    http://www-uxsup.csx.cam.ac.uk/~fanf2/hermes/doc/t alks/2004-02-ukuug/

    is how the University of Cambridge do it....

    lots of nice details in there

  42. Re:so you want what ? load / redunancy / clusterin by saintp · · Score: 1
    Before you rush out and buy Sun's Java System Messaging Server, subscribe to the mailing list and give a read-through of some of the recent archives. You'll find a whole lot of bitching about the system from people who are actually using it. We're among the many admins who will shortly be switching away from JSMS to precisely what the OP is asking about: a scalable, redundant, open-source mail system.

    We'll be using a few front-line MX boxes running Postfix, SpamAssassin, and PureMessage (not FOSS), delivering via LMTP to several Cyrus machines, which will share SAN storage via Lustre. We'll also have a small cluster of boxes running the Horde suite for a web UI. All of this is authenticating against a four-way multi-master cluster of Fedora DS machines. Not only will that save us a bundle of cash, it will be far more stable than the breakage-prone JSMS, and, to be perfectly honest, support will be better from a bunch of 1337 h4x0r5 on a mailing list than from Sun.

  43. look into dbmail by davedoom · · Score: 1
    I am currently researching DBMAIL. This is an GPLed email system that permits one to store mail in an SQL database. The advantage of this is that all writes are transactional, permitting
    overview
    • Scalability

      Dbmail is as scalable as the database system that is used for the mail storage. In theory millions of accounts can be managed using dbmail. One could, for example, run 4 different servers with the pop3 daemon each connecting to the same database (cluster) server.

    • Manageability

      Dbmail is based upon a database. Dbmail can be managed by changing settings in the database (f.e. using PHP/Perl/SQL), without needing shell access.

    • Speed

      Dbmail uses very efficient, database specific queries for retrieving mail information. This is much faster then parsing a filesystem.

    • Security

      Dbmail has got nothing to do with the filesystem or interaction with other programs in the Unix environment which need special permissions. Dbmail is as secure as the database it's based upon.

    • Flexibility.

      Changes on a Dbmail system (adding of users, changing passwords etc.) are effective immediately.


    Other thoughts:
    Running the mail store on NFS has been an unmitigated disaster. Lost mail, nfs lock problems, slow response and other issues.
    Speculation about GFS and LUSTRE are just that. I have never met anyone successfully using a gfs/iscsi/god knows what in anything remotely resembling a production environment.
    It would be terrific to be able to backup the customer's mail. There is no effective way to do this with nfs/maildir/what have you. A database supports this natively
    I am a little disappointed that dovecot was not the base for the imap server in dbmail, but the provided imap server seems pretty full featured.
    1. Re:look into dbmail by Anonymous Coward · · Score: 0

      The trick to using NFS locking is _not_ to use lockd. Mutual exclusion files are the way to go. Anyone actually believing that lockd works is either a Sun employee or a retard or both.

    2. Re:look into dbmail by Anonymous Coward · · Score: 0

      NFS locking works.

      Oh wait..

  44. Sun Messaging Server by TheDealer · · Score: 1

    We've been using Sun's Java Enterprise System (formerly SunONE formerly iPlanet formerly Netscape blah blah) Messaging Server for the last few years for 25,000+ (and growing) users. It's proven to be very reliable and is extremely flexible. For scalability and added reliability look into their Messaging Multiplexor and High Availability options. Other significant advantages are the availability of well-written and thorough documentation and Sun's support team.

  45. Re:so you want what ? load / redunancy / clusterin by joib · · Score: 1


    Cyrus machines, which will share SAN storage via Lustre.


    Have you tested that this provides good performance? AFAIK Lustre is designed and optimized for massively parallel applications doing sequential IO on huge files (e.g. HPC apps using the MPI-IO API). Sounds like maildir (lots of tiny files) is the exact opposite.

  46. A little up-front dns thought will save you a lot by Anonymous Coward · · Score: 0

    I used to do this quite a bit. Save yourself a lot of work later by putting a bit of extra dns work up front when you create users. The nice exchange feature of being able to have the client find its mailbox when you move it to a different server is a tremendous help when scaling systems out -- and it's very easily replicated with simple dns.

    For each user create two records, one for retrieving mail and one for sending it. They may initially point to the same server, but as you scale up/out they can point to other servers, requiring no client change.

    Organize these as subdomains. So for every user you'd have, for example:

    bob.mailin.domain.com IN CNAME imapserver1.domain.com
    bob.mailout.domain.com IN CNAME smtpserver4.domain.com

    Then if you need to move bob's mail spool later you just move it - no need to update the client. This approach, while not required by some client/server packages (notably outlook/exchange) is useful on almost all of them.

  47. Re:Check out Perdition and Zimbra by Anonymous Coward · · Score: 0

    Zimbra is Open Source includes Perdition, Postfix and a niffy AJAX web UI. Check out the online demo. www.zimbra.com

  48. Re:so you want what ? load / redunancy / clusterin by Anonymous Coward · · Score: 0

    First, Sun Java Entrprise System Messaging Server is free as part of the Solaris Enterprise System. You just have to pay for support if you want it and the mailing list that you referenced is better than paid support anyways since you are talking to the engineering team directly.

    Second, stop spreading FUD. The gripes on the mailing list are mostly if not all dealing with the web end user interface (Communications Express or Unified Web Client - UWC). The LDAP/MTA/Message Store is ROCK solid and the virtual domain capibility is very simple to do which would be a BIG win for an ISP deployment.

    Third, JESMS is very much role/service based so that value-added services are easy to do on a per-user and/or per-domain basis. For example, you want everyone to have their mail go through a basic anti-virus/anti-spam product, but you also can offer different levels such that one level gets run through additional scanning and a third level goes through a completely different AVAS system.

    This then can extend to potentially offering calendar and IM (JABBER) based services with the installation of those servers. (Once you have the LDAP backend it becomes pretty painless to role out those services.)

    Take a look at the Deployment Planning Guide for example on how it can be deployed to fit the OP requirements.

  49. Re:Mail:Toaster - I disagree by Havokmon · · Score: 1
    I've been using Matt's toasters since 1.6 or so, and all Mail::Toaster does now is initial setup and routine maintenance. I have 3 boxes that run my email service, all based on his toaster and it works without issue. (on much lesser hardware)

    I will say that using tcpserver is a hit/miss proposition. If you don't get the memory requirements just right, you can easily take down a server with too many processes.

    My primary incoming MX is a $200 machine from WAL-MART with maybe 768MB. I've eaten a few hundred thousand joe-jobs without it going down - just had to wait for the queue to empty after figuring out what account the spammer had created... *grumble*

    Rick

    --
    "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)