[Dovecot] [PATCH] Replace hard-coded PKG_STATEDIR with state_dir setting

Chris Webb chris at arachsys.com
Mon Aug 13 19:14:25 EEST 2012


Chris Webb <chris at arachsys.com> writes:

> Sharing an installed copy of dovecot between several users each running
> a daemon within their own account (or using the same binaries for a
> system daemon and a user daemon) is difficult because the compile-time
> directory PKG_STATEDIR (typically /var/lib/dovecot) is hard-coded as the
> location of things like the ssl-parameters.dat file and the replicator
> database.
> 
> Replace all these uses of PKG_STATEDIR with a state_dir setting which
> defaults to PKG_STATEDIR but can be overridden in dovecot.conf, in the
> same way base_dir can be used to override PKG_RUNDIR.

A little background to this patch:

I run a shell account box on which a number of users want to do customized
things with their own IMAP servers, and they previously ran their own copy of
Dovecot 1.0, using the system installed copy of dovecot but with their own
dovecot.conf overrode base_dir, used passwd-file, etc.

I've been looking at upgrading this machine, and encouraging SSL imap at the
same point, but replicating these users' setups with Dovecot 2.1.9 was 
harder than I expected because of hard-coded references to /var/lib/dovecot
that their config files couldn't override. This patch fixes that problem: 
they just create a ~/dovecot/dovecot.conf with something like

  base_dir = /home/foo/dovecot/run
  state_dir = /home/foo/dovecot/state
  [...]

run dovecot -c ~/dovecot/dovecot.conf as they did before, and they're away with
a completely self-contained IMAP server without having to compile a complete
separate copy of Dovecot each.

Best wishes,

Chris.



More information about the dovecot mailing list