Differences between revisions 1 and 2
Revision 1 as of 2004-01-11 21:34:10
Size: 2517
Editor: anonymous
Comment:
Revision 2 as of 2004-05-01 14:49:48
Size: 2518
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
First you need a global default procmailrc that will deliver email into users '~/Maildir'. Creat a file '/etc/procmailrc' that contains:: First you need a global default procmailrc that will deliver email into users '~/Maildir'. Create a file '/etc/procmailrc' that contains::

Configuring Debian for Maildir is not too hard, it's just hard to find out how. It's not the Debian default and there are no debconf prompts or alternatives that let you do it.

Be aware that when you change to using Maildir, some stuff will break. The mbox '/var/spool/mail' based delivery is so ingrained in Unix history that many utilities (like the "you have mail" notification) just cannot understand anything else. However, the speed and reliability benefits to IMAP usually make it worthwhile.

Using procmail for delivery

Both exim and postfix support using procmail for delivery "out of the box" on Debian. You can use procmail to put incoming mail into Maildir format by default. Another nice thing about this is it allows users to change the format of mail box(es) themselves by creating their own '~/.procmailrc', but make sure users are aware that if they do this, your IMAP and POP daemons will not see any non-Maildir format mailboxes.

First you need a global default procmailrc that will deliver email into users '~/Maildir'. Create a file '/etc/procmailrc' that contains::

    DEFAULT=$HOME/Maildir/

Note that webmin's procmail module can be used to do this.

Making Applications Maildir Aware

Next you need to ensure the various things that do mail stuff know you are using Maildir. This includes;

  • Edit '/etc/login.defs' so that it includes:

        QMAIL_DIR      Maildir/
        #MAIL_DIR        /var/mail
        # Note: QMAIL_DIR alone does not work as advertised... also need MAIL_FILE
        MAIL_FILE      Maildir/
  • * Edit '/etc/profile' so that it sets MAIL. In theory this should not be required because most things should use /etc/login.defs, but it seems ssh for example doesn't

    export MAIL=~''Maildir''

You can also edit '/etc/pam.d/*' so that 'pam_mail.so' is used to set MAIL, but this becomes a headache updating it every time packages update these config files, and the above two changes seem to cover everything anyway.

This a solution for Maildir delivery that only requires changing the configuration for exim. I changed /etc/exim/exim.conf to deliver to Maildir directly with the following

This change goes in the transport section of exim.conf

local_delivery:

  driver = appendfile
  group = mail
  mode = 0660
  mode_fail_narrower = false
  envelope_to_add = true
  #file = /var/spool/mail/${local_part}
  create_directory = true
  directory = ''home''${local_part}/Maildir
  maildir_format