Factorize settings in the configuration file
The DEFAULT section
If you have redondant settings accross a lot of accounts, it’s possible to set a section named DEFAULT
.
Here, the Example
account has postsynchook = notifysync
.
[DEFAULT]
postsynchook = notifysync.sh
[Account Example]
localrepository = LocalExample
remoterepository = RemoteExample
autorefresh = 5
Be care that all the undefined options will make use of the DEFAULT
section.
Using interpolation
It’s possible to combine values from others.
[Account Example]
localrepository = LocalExample
remoterepository = RemoteExample
mailfilter = imapfilter -c
presynchook = %(mailfilter) someconfig.lua
Yes, I know this is not a very compelling sample. :-)
Be care to not introduce recursive references or an exception will be raised.
Mixing DEFAULT and interpolation
[DEFAULT]
mailfilter = imapfilter -c
[Account Example]
localrepository = LocalExample
remoterepository = RemoteExample
presynchook = %(mailfilter) someconfig.lua