[
    {
        "role": "user",
        "content": "in%20exim4%2C%20I%20want%20to%20change%20the%20default%20local%20transport%20from%20mail_spool%20to%20maildir_home."
    },
    {
        "role": "assistant",
        "content": "Here\u2019s how you can change the default local delivery in Exim4 on a Debian/Ubuntu system from `mail_spool` (the default mbox-style delivery in `/var/mail/username`) to `maildir_home` (Maildir-style in each user\u2019s `~/Maildir`). You\u2019ll be editing Debian\u2019s Exim4 configuration via the `update-exim4.conf.conf` file rather than hand-writing big transport blocks in most cases.\n\n---\n\n## What you need to understand\n- Debian (and Ubuntu) package `exim4-config` has a parameter `dc_localdelivery` in `/etc/exim4/update-exim4.conf.conf`.\n- That parameter picks one of several transport options for local delivery. The two built-in options you\u2019re talking about are `mail_spool` (default) vs. `maildir_home`. ([papercut.com](https://www.papercut.com/blog/releases/new-mail-server-debian-exim4-dovecot-imap/?utm_source=openai))\n- If `dc_localdelivery` is unset, Exim4 will default to `mail_spool`. ([alioth-lists.debian.net](https://alioth-lists.debian.net/pipermail/pkg-exim4-maintainers/2005-March/001556.html?utm_source=openai))\n\n---\n\n## Steps to switch from mail_spool \u2192 maildir_home\n\n1. **Open the config file**  \n   Edit `/etc/exim4/update-exim4.conf.conf` as root. For example:  \n   ```\n   sudo nano /etc/exim4/update-exim4.conf.conf\n   ```\n\n2. **Find the `dc_localdelivery=` line**  \n   It likely looks like this:\n   ```\n   dc_localdelivery='mail_spool'\n   ```\n\n3. **Change that value**  \n   Replace `mail_spool` with `maildir_home` so it reads:\n   ```\n   dc_localdelivery='maildir_home'\n   ```\n\n4. **(Optional) Configure the Maildir directory name**  \n   By default, `maildir_home` delivers to `~/Maildir`. If you want to use a different directory name inside user home (e.g., `.Maildir`, `Mail`, etc.), you can add or adjust the `dc_maildirlocalname=` setting in the same file. ([alioth-lists.debian.net](https://alioth-lists.debian.net/pipermail/pkg-exim4-maintainers/2005-March/001556.html?utm_source=openai))  \n   Example:\n   ```\n   dc_maildirlocalname='.Maildir'\n   ```\n\n5. **Apply changes**  \n   Regenerate the Exim configuration and restart Exim:\n   ```\n   sudo update-exim4.conf\n   sudo systemctl restart exim4\n   ```\n   or (on older systems):\n   ```\n   sudo /etc/init.d/exim4 restart\n   ```\n\n---\n\n## What actually gets changed\n\n- The setting `dc_localdelivery='maildir_home'` causes Exim4 to use a transport block defined in `/etc/exim4/conf.d/transport/30_exim4-config_maildir_home`. That transport writes messages in Maildir format under each user\u2019s `$home/Maildir` (by default). It uses `appendfile`, `maildir_format`, etc. ([lists.exim.org](https://lists.exim.org/lurker/message/20090902.222013.52445682.en.html?utm_source=openai))  \n- The `mail_spool` transport writes to a single mbox file in `/var/mail/user`. ([lists.exim.org](https://lists.exim.org/lurker/message/20090902.222013.52445682.en.html?utm_source=openai))\n\n---\n\n## Testing & things to watch out for\n\n- After switching, send a test email to a local user (cron mails, or `mail username`) and verify that a `Maildir/` directory appears in their home, with subfolders `new/`, `cur/`, `tmp/`.  \n- Permissions: Exim must have permission to create directories under user home directories. The default transport usually includes `create_directory` when needed. If user homes are on network storage or have special mount options, this can cause issues.  \n- Mailtools / MTA integrations expecting mbox may need configuration changes (e.g., your IMAP server might need to use Maildir format).  \n- Backups of existing mbox mail\u2014old mail in `/var/mail`\u2014will not automatically move. If you want seamless continuity, plan for migrating old mail into new Maildirs.\n\n---\n\nIf you tell me which distro (Debian, Ubuntu, etc.) and which Exim4 version you\u2019re running, I can give you the exact snippet of config to add (if split configuration) to ensure everything hooks up cleanly. Do you want me to pull that for your setup?"
    }
]