--- title: | Case of setting up InterIMAP with Dovecot and Mutt on Debian ... This case guide explains the setup of InterIMAP. The guide also covers the overview of configuration philosophy and strategy. Eventually how to configure the Mutt client is covered. # Overview A local IMAP server has a local mail store. InterIMAP always synchronises between two IMAP servers, *local* and *remote*. In this case the goal is to sync a remote IMAP server with a local one. The following software components are involved: * [Dovecot](https://dovecot.org) * [Mutt](http://mutt.org) * [InterIMAP](https://git.guilhem.org/interimap/about/) The environment is assumed to be Debian Stable, Debian 9 Stretch. For InterIMAP, however the Debian testing repository needs to be available for the purpose of installation. The mail client (Mutt) is served via IMAP from a local instance of Dovecot. Local storage will be Maildir format. Using the IMAP server to serve content to the mail client is preferred, compared to using the client's internal Maildir support. The setup corresponds to multiple running instances of Dovecot processes: Dovecot is invoked with a separate instance for every client session, as well as for the instance of InterIMAP. This is of course no problem. All process connect the same mail storage, including caching data, etc. On configuration, the setup is straight forward. Also, all configuration and services are user local. no system wide configuration changes will be needed. The system wide dovecot service is even disabled. # Install software Make sure testing is in sources. Install (run as root): apt-get install interimap dovecot-imapd What is the "fripost" abstraction? - private - work The use of "private" is for contrasting that to possible completing "work" accounts, or similar. Replace "private" in all of continuation with what describes your account. E.g. authors would use "fripost". ``` ACCOUNT=private ``` Note on delimiters. Below is referred to "separator". That has to do with the server-client IMAP communication and should not be confused with the Maildir mail folder delimiter. Maildir hierarchy delimiter will always be "." (period). # Setup Dovecot Disable the system wide Dovecot service (run as sudo): ``` systemctl stop dovecot systemctl disable dovecot ``` Provide local configuration for Dovecot: ``` mkdir -pm 0700 "${XDG_CONFIG_HOME:-$HOME/.config}/dovecot" tee "${XDG_CONFIG_HOME:-$HOME/.config}/dovecot/$ACCOUNT.conf" <<-EOF namespace inbox { location = maildir:~/Maildir/$ACCOUNT inbox = yes list = yes separator = / } EOF ``` Verify connectivity and setup with the following: doveadm -c "${XDG_CONFIG_HOME:-$HOME/.config}/dovecot/$ACCOUNT.conf" exec imap you should see long output pattern `* PREAUTH ... Logged in as ...`. The PREAUTH shows your authenticated at login. Type the command `a list "" "*"` to list your mailboxes. Logout with `b logout`. Create a wrapper for execution ``` install -m 0755 /dev/stdin ~/.local/bin/imap <