--- /dev/null
+---
+title: Case of setting up InterIMAP with Dovecot and Mutt for Fripost account on Debian
+...
+
+
+# Overview
+
+Lolcal IMAP servier has a local mail store. InterIMAP works only
+between two IMAP servers. In this case eventually the interest is to
+sync between multiple IMAP servers to cover the case of work and
+private setup.
+
+# Configuration introduction
+
+*TODO Fundamental philosophy ...*
+
+## Namespaces
+
+*TODO Why not ...?*
+
+# Install software
+
+Make sure testing is in sources.
+
+ sudo apt-get install interimap dovecot-imapd
+
+# Structure of Maildir locally
+
+# Setup Dovecot
+
+
+Disable dovecot:
+
+```
+# systemctl stop dovecot
+# systemctl disable dovecot
+```
+
+Verify connectivity and setup with the following:
+
+ /usr/lib/dovecot/imap -o "mail_location=maildir:~/Maildir/fripost-dovecot"
+
+you should see long output pattern `* PREAUTH ... Logged in as
+...`. The PREAUTH shows your authenticated at login. No type command
+`a list "" "*"` to list your mailboxes.
+
+Create a wrapper for execution
+
+```
+install -m 0755 /dev/stdin ~/.local/bin/imap-fripost-dovecot <<EOF
+#!/bin/sh
+exec /usr/lib/dovecot/imap \
+ -o "mail_location=maildir:~/Maildir/fripost-dovecot" \
+ -o "namespace/inbox/separator=/"
+EOF
+```
+
+# Configure email client (mutt)
+
+Put in your mutt configuration:
+
+```
+set tunnel = "~/.local/bin/imap-fripost-dovecot"
+set folder = "imap://foo"
+set spoolfile = "imap://foo"
+```
+
+# Configure InterIMAP
+
+Prepare config.
+
+*TODO The following should be replaced with a setup of multiple
+configuration files due to the "multiple account" setup.*
+
+```
+mkdir -m 0700 -p ~/.config/interimap
+install -m 0600 /usr/share/doc/interimap/interimap.sample ~/.config/interimap/config
+```
+
+Edit *~/.config/interimap/config*:
+
+ * Remove *list-select-opts* option
+ * Edit *local* and *remote* sections
+
+```
+[local]
+type = tunnel
+command = /home/gustav/.local/bin/imap-fripost-dovecot
+null-stderr = YES
+
+[remote]
+#type = imaps
+host = imap.fripost.org
+#port = 993
+#proxy = socks5h://localhost:9050
+username = gustav.eek
+password = xxxxxxxxxxxxxxxx
+#compress = YES
+```
+
+# Systemd setup
+
+*TODO The following should be replaced with a template version due to
+the "multiple account" setup.*
+
+Enable the service for your user.
+
+```
+systemctl --user start interimap
+systemctl --user enable interimap
+```
+
+In need of configuration change override the system wide configuration
+(in */usr/lib/systemd/user/interimap.service*), e.g:
+
+
+```
+mkdir -m 0755 -p /home/gustav/.config/systemd/user/interimap.service.d
+install -m 0644 /dev/stdin ~/.config/systemd/user/interimap.service.d/override.conf <<EOF
+[Service]
+ExecStart=
+ExecStart=/usr/bin/interimap --watch=20
+EOF
+systemctl --user daemon-reload
+```
+
+This is standard Systemd configuration. See "systemd.unit(5)".
+
+# Dovecot morals
+
+Stop read here if all works.
+
+Above configuration assumes that you will disable all of dovecot. As a
+precaution take a few security measures regarding the service in case
+you happen to start it (or need it for purposes not presented here).
+
+Edit */etc/dovecot/conf.d/10-ssl.conf*. The latter to `ssl = no`
+
+Make sure dovecot is not exposed on Internet on ports. Edit
+*/etc/dovecot/conf.d/10-master.conf*:
+
+
+```
+service imap-login {
+ inet_listener imap {
+ port = 0
+ }
+ inet_listener imaps {
+ port = 0
+ }
+}
+
+```
+
+Restart and verify with `ss -ptln` that nothing listens on port 143 or
+993.