MailStorageStandardisation

This proposal serves to describe a standard layout, and naming, for local user mail folders created in Hoary and later Ubuntu releases.

Introduction

Ubuntu has selected a number of mail system software tools for inclusion in our fully supported "main" component. Yet these tools do not integrate well with one another. For example, the default system installation includes postfix for local mail delivery. It is not possible, though, to have postfix delivering mail locally and then export this mail simply by installing dovecot, our preferred imap server.

A complete analysis of the approach taken to mail is necessary, but this document aims to address just part of the problem: standardisation of the storage format, naming and layout of end user mail on an Ubuntu system.

Implementation of this proposal should go a long way to ensuring that an installation of a new piece of mail infrastructure will Just Work. For example, on a system that has been using the default postfix configuration for local mail delivery it should be possible simply to apt-get install dovecot and have end-user mail exported via imap. This should Just Work with an installation of thunderbird, evolution or mutt, with no additional configuration required by users or administrators other than apt-get install foo. Finally, offlineimap should Just Work when given the same minimal configuration file, amended for the name of a remote imap server, allowing people to keep their local mail perfectly in sync with a remote imap server.

Mail Format

The preferred local mail storage format is maildir format. This format, for a single
directory in maildir format, is given on the Qmail web site 
at http://www.qmail.org/qmail-manual-html/man5/maildir.html

Rationale: This format is supported by all the preferred mail system components in the Ubuntu main component: postfix, mutt, evolution, dovecot and offlineimap. In addition, kmail (Kubuntu), balsa and pine can all support maildir. Maildir also works with other popular mail system components such as qmail. It also has superior performance for large folders of mail, simpler locking, and is easy to backup.

Maildir is not supported by sylpheed or elm.

Mail Directory Naming

The user mail directory should be ~/.maildir

Mail folders should have dot-separated name components, and will begin with a dot.
This complies with the specification given at http://www.courier-mta.org/?maildir.html
For example, valid folder names in the .maildir directory would include:

 .ubuntu.work and play
 .ubuntu.comunity support
 .ubuntu.future plans
 .companies.legacy.microsoft
 .companies.legacy.buggy whips inc
 .games.doom3

Rationale: The maildir format is not designed to be human-readable. The directory is not designed to be browsed in the shell or a file explorer. Manual intervention in a maildir directory by non-experts can only result in tears.

Conventionally the maildir directory was named Maildir. This results in a very visible directory, and with increasing numbers of non-expert Ubuntu users this will become a problem. Shifting to a dotfile name will hide the maildir from most users, resulting in fewer unplanned mail disasters.

In addition, the use of a dot to indicate folder names in the mail directory means that folders are invisible to users in any event. Having a directory called Maildir that appears to contain nothing is a real recipe for disaster, so we choose to use the dotfile name for the maildir itself as well.

Open questions include:

  • can we standardise the name and structure of the INBOX, or does maildir do so?
  • we should review the standard cacheing of dovecot to make sure its sane

Changes Required

The following packages will need to be altered to bring Ubuntu into full conformance with this specification.

  • postfix
  • mutt
  • evolution
  • dovecot
  • offlineimap

Each of these packages should have defaults set so that they can be used in conjunction with one another without any editing of the default configurations. For example, it should be possible to deliver mail locally (using postfix) to a user, and have that mail immediately show up in evolution or mutt. Installing dovecot on the server should immediately export this mail via IMAP. Finally, dropping offlineimap onto the system should allow trivial syncing of that local directory with a remote IMAP server using the minimal offlineimaprc configuration.

From goofrider Sat Apr 23 17:05:03 +0100 2005 From: goofrider Date: Sat, 23 Apr 2005 17:05:03 +0100 Subject: MailDir Rationale Message-ID: <20050423170503+0100@https://www.ubuntulinux.org>

Please elaborate on the rationale of MailDir. Wide support isn't necessearily a strong enough reason since mbox is much more ubiquitous than MailDir. The choice of MailDir should base on its advantages over mbox, such as less prone to corruption, better R/W performance, miminal file locking issues, etc.

CategoryArchive

MailStorageStandardisation (last edited 2008-08-06 17:00:03 by localhost)