[Dovecot] short-cut for install prefix in conf file?

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Wed Jul 1 15:20:46 EEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

is there a way to shortcut the absolute path in the dovecot.conf file for 
the various referenced files? Something like:

Now:
   acl = pgsql:/usr/local/dovecot-1.2.rc8acl-hook2/etc/dovecot-dict-acl-sql.conf
   mail_executable = 	\
     /usr/local/dovecot-1.2.rc8acl-hook2/libexec/dovecot/rawlog 	\
     /usr/local/dovecot-1.2.rc8acl-hook2/libexec/dovecot/imap

Short #1 - relative to dir of conf file
   acl = pgsql:dovecot-dict-acl-sql.conf
   mail_executable = ../libexec/dovecot/rawlog ../libexec/dovecot/imap

Relative paths are currently evaluated relative to /tmp or '.', it looks 
like. Because of the different useages of the .conf file, this variant 
will be troublesome, I guess.

Short #2 - use variables as in the shell
   INSTALL := /usr/local/dovecot-1.2.rc8acl-hook2
   acl = pgsql:$INSTALL/etc/dovecot-dict-acl-sql.conf
   mail_executable = 	\
     $INSTALL/libexec/dovecot/rawlog 	\
     $INSTALL/libexec/dovecot/imap

So you need to define the path just one time in the file.
Maybe use %$INSTALL instead of $INSTALL, in order to _not_ introduce 
another metacharacter and break backwards compatibly.

Short #3 - pseudo variable (%* here) with modifier (I == installpath)
   acl = pgsql:%I*/etc/dovecot-dict-acl-sql.conf

The background is to support multiple parallel installations,
e.g. during testing, I cannot rely on symlinks, but want that all
stuff in a conf file is referenced to the same install tree.

Bye,

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBSktUoHWSIuGy1ktrAQIMYAf/dfRvO5Q8FitDR6vlSkehjKU+LkZtDv4H
1GjmjBill9Aewuwsb4v8AqNqaoXgsIovQMPZzWGTLzT1MTp36ckOame60PiXFmbZ
V7DK6LKR+oeRHVKErwu/iauzj7jmjwAUzPaKd7xavt6UdTw+4MqPFHcg42yjPJAC
VF1XQC2l6Wk4rdp/1ijfpkGSYyfzgqXePzjQK8zywyAeZquB90jsfF2cDg07Bhn9
jXTDDPKB7eivEQaWKgTAwKO/vN4BNCaqdhLq20ZHAurP3aXRRbfTk/AZFebDxi5K
HU5VO6xfrk8MYE0XU7M91lOi6gwwWvIBMxuEoXAQS4C7NNYFx/JtBA==
=T1yk
-----END PGP SIGNATURE-----


More information about the dovecot mailing list