Hello dear Dovecot users
I have a somewhat special request: I have a single file in mbox format which I want to make accessible via IMAP to anonymous logins. The mbox file is being updated outside of Dovecot and should not be changeable by Dovecot.
So far I created a Docker container based on the official image (https://hub.docker.com/r/dovecot/dovecot) and configured the Dovecot according to https://doc.dovecot.org/configuration_manual/shared_mailboxes/public_shared/. The volume with the mbox file is mounted in the running container under /var/mail. Each time a client tries to access this public mailbox the following error is logged and no content is returned: May 26 21:57:06 imap(mutt)<16><Rkpg0Z/8pLfAqDAB>: Error: Mailbox Public/archive: open() failed with mbox: Read-only file system.
Note that I don't need the file to be a shared mailbox. Instead I would also be happy to have all (anonymous) users mapped to the read-only mbox somewhere in the filesystem.
Dockerfile: FROM dovecot/dovecot
RUN mkdir -p /var/indexes/public RUN chown 1000:1000 /var/indexes/public ADD dovecot.conf /etc/dovecot/dovecot.conf
/etc/dovecot/dovecot.conf: ## You should mount /etc/dovecot if you want to ## manage this file
mail_home=/srv/mail/%Lu mail_location=sdbox:~/Mail mail_uid=1000 mail_gid=1000
#protocols = imap pop3 submission sieve lmtp protocols = imap
first_valid_uid = 1000 last_valid_uid = 1000
passdb { driver = static args = password=pass }
ssl=yes ssl_cert=<cert.pem ssl_key=<key.pem
namespace { type = private inbox = yes separator = / }
namespace { type = public prefix = Public/ location = mbox:/var/mail/:INDEX=/var/indexes/public subscriptions = no }
listen = *
log_path=/dev/stdout info_log_path=/dev/stdout debug_log_path=/dev/stdout