Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to build a somewhat unusual setup.
It involves having multiple locations, a single mail domain and two or more linux mail servers (the distro is slackware, but for the mail servers i'm opened to suggestions - sendmail/qmail/postfix).
What I would like to do is to have a backup MX, in case the first one fails, but also to have users send and receive mails from the server which is "closest" to them (and is available, of course).
Also, the mail server should support per-user and per-group quotas (this is not a requirement, but it would be a very nice feature to have).
I don't know if I fully explained the situation, please reply if there are further clarifications needed.
Bear in mind that sending and receiving mails are separate functions - the users will pick up mail from a POP or IMAP service. IIRC, Cyrus IMAPd supports quotas, and can be clustered. For SMTP I'd recommend Postfix or Exim - qmail is not open source, and Sendmail is harder to manage without any benefit.
The geographical location of the servers isn't really relevant - it's only the speed and reliability of the connection between the client and the server that matters. So whilst you could write a script or application for clients that tests the connection speeds and switches to the fastest server it's probably not the most useful way to address whatever concern is involved.
Also in almost all real world setups with MX or Mail servers, you should always have a primary and secondary MX server. If the first fails, all mail is routed to the secondary server. Now setting it up beyond that depends on your own needs. Some people cluster their mail servers so they share the final location where their users pick up their email, etc. You could load balance them or whatever, but even if you don't cluster and I don't see a need to have users use the "closest" server which shouldn't even matter, a secondary MX record to point mail to if the first fails is always a good thing to have.
I could go with clustering the servers, but I would like to minimize the duration and traffic in the moment the user presses the send/receive button (since a user could download 2~300MB of mails, it's preferable to download it from a server in LAN instead of a 512kb internet connection).
I could separate the users by defining a group for the second location and forwarding all mails from mx1 to mx2, but the problem remains with roaming users: what if an user from location 2 takes his/her notebook and goes to location 1? The DNS will point him to mx1, but all the mails are on mx2.
Furthermore, doesn't clustering the servers require a "master server"?
I could go with clustering the servers, but I would like to minimize the duration and traffic in the moment the user presses the send/receive button (since a user could download 2~300MB of mails, it's preferable to download it from a server in LAN instead of a 512kb internet connection).
If you use IMAP then the clients may only download the headers for each mail, so in practice this isn't really an issue. I suspect that you are overthinking this - mail software is efficient enough that a single server can support hundreds of users, and a regular dial-up connection is enough for clients, unless somebody sends very large attachments. Any mail server software will enable you to set whatever maximum mail size you feel is appropriate.
I think that you need to investigate IMAP in more depth: with an IMAP facility the mail remains on the server, and the clients don't download mail data over the connection in the way that happens with POP.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.