git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git for redundant mail servers

From
David Woodhouse <dwmw2@infradead.org>
Date
Apr 23, 2005, 06:42 UTC
Message-ID
<1114238562.3419.29.camel@localhost.localdomain>

Random alternative use for git... we could use it to provide a cluster of redundant mail delivery/storage servers.

The principle is simple; you use something like a set of Maildir folders, stored in a git repository. Any action on the mail storage is done as a commit -- that includes delivery of new mail, or user actions from the IMAP server such as changing flags, deleting or moving mail. These actions are actually fairly efficient when Maildir folders are stored in a git repository -- the IMAP model is that mails are immutable, and flag changes are done as renames.

In the normal case where all the servers are online, each commit is immediately pushed to each remote server. When a server is offline or separated somehow from the rest of the group, it's going to have to do a merge when it reconnects -- we'd implement a Maildir-specific merge algorithm, which really isn't that hard to do.

In this case we'd probably want to make active use of the feature of git which allows you to prune history. You don't need to keep any history further back than the commit which will be the common ancestor when a currently-absent member of the cluster eventually comes back. In the common case, that will actually be no history at all, since all members will be present.

You can then have multiple members of a cluster, each running an SMTP server and allowing for delivery of email, and each running an IMAP server. Clients can connect to any of the machines and receive IMAP service, and email will continue to flow inward, as long as at least one machine in the cluster remains alive.

-- 
dwmw2
Next: Jon Seymour
Message 1 of 5 in “Git for redundant mail servers”
  1. David WoodhouseApr 23, 2005
  2. Jon SeymourApr 23, 2005
  3. David LangApr 24, 2005
  4. David WoodhouseApr 24, 2005
  5. David LangApr 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.