Dovecot IMAP Read Only Archive

Published: Wednesday, Dec 4, 2013 Last modified: Monday, Dec 9, 2024

http://wiki2.dovecot.org/HowTo/ReadOnlyArchive is outdated.

/etc/dovecot/dovecot.conf

$ sudo doveconf -n
# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.9.4-1-ARCH x86_64
auth_mechanisms = plain anonymous
log_path = /home/example/readonly/dovecot.log
mail_location = Maildir:~/mail/inbox
mail_log_prefix = %Us(%r):
passdb {
  args = /etc/anon.passwd
  driver = passwd-file
}
service auth {
  user = nobody
}
ssl = no
userdb {
  args = /etc/anon.passwd
  driver = passwd-file
}
valid_chroot_dirs = /home/example/readonly

For debugging purposes, tail /home/example/readonly/dovecot.log

/etc/anon.passwd

anonymous:{PLAIN}:501:501::/home/example/readonly/::nopassword=1

/home/example/readonly

Permissions are important. You will be doing sudo chown -R 501:501 .

$ tree -ugp readonly
readonly
|-- [-rw-r--r-- root     root    ]  dovecot.conf
|-- [-rw------- 501      501     ]  dovecot.log
`-- [dr-xr-xr-x 501      501     ]  mail
	`-- [drwxr-xr-x 501      501     ]  inbox
		|-- [dr-xr-xr-x 501      501     ]  cur
		|   |-- [-r--r--r-- 501      501     ]  1386050966.M540929P13587.sg.webconverger.com,S=315,W=328:2,S
		|   |-- [-r--r--r-- 501      501     ]  1386051008.M248603P13703.sg.webconverger.com,S=2081,W=2125:2,RS
		|   |-- [-r--r--r-- 501      501     ]  1386051093.M840486P13614.sg.webconverger.com,S=694,W=711:2,S
		|   |-- [-r--r--r-- 501      501     ]  1386051118.M789320P13725.sg.webconverger.com,S=2084,W=2127:2,S
		|   `-- [-r--r--r-- 501      501     ]  1386051172.M378951P13760.sg.webconverger.com,S=1881,W=1920:2,S
		|-- [-rw-r--r-- 501      501     ]  dovecot-uidlist
		|-- [-rw-r--r-- 501      501     ]  dovecot-uidvalidity
		|-- [-rw-r--r-- 501      501     ]  dovecot-uidvalidity.529d7573
		|-- [-rw-r--r-- 501      501     ]  dovecot.index.cache
		|-- [-rw-r--r-- 501      501     ]  dovecot.index.log
		|-- [-rw-r--r-- 501      501     ]  dovecot.index.thread
		|-- [-r--r--r-- 501      501     ]  inbox
		|-- [dr-xr-xr-x 501      501     ]  new
		`-- [dr-xr-xr-x 501      501     ]  tmp

5 directories, 14 files

.muttrc test

$ cat mutt-econv-test
set spoolfile=imap://anonymous@imap.dabase.com
set folder=imap://anonymous@imap.dabase.com
set sort=threads
set sort_aux=reverse-last-date-received

To test:

$ mutt -F mutt-econv-test

See https://github.com/kaihendry/econversations for why am I doing this.