[Dovecot] [PATCH] include parameters can handle globbing

Thomas GUTHMANN mailinglists at iinet.com.au
Sat Jul 11 13:41:01 EEST 2009


Hey guys,

This patch will allow you to include different configuration files in 
the main dovecot.conf by using globbing [1] (like Apache for instance).

!include = conf.d/*.conf
!include_try = /etc/dovecot/extra*

So with this you can split the dovecot.conf in different smaller 
configuration files. It's more the debian way to do that. But it's very 
handy if you have to generate dynamically parts of dovecot.conf based on 
a centralized main configuration (imagine you have 10 servers and you 
want to change the default quota for instance, do a script which update 
that based on the data contained in SQL/LDAP/XML/whatever).

I designed this for my personal use with dovecot 1.2.1. It does the job. 
But I warn you :) My code may hurt your eyes. If so either close them or 
improve/fix my code or ... "Hare Krishna" [2] :)

The include features has been done and almost kept hidden by Timo :) 
I've just add the globbing feature to !include and !include_try.

The patch will modify
- src/lib-settings/settings.c
- dovecot-example.conf

$ cd dovecot-1.2.1
$ patch -p1 < includepatch.diff

It has been test with GNU/Linux Debian dunno if it compiles on 
FreeBSD/AIX/MacOSX but everything is POSIX compliant so... it should :)

Cheers,
Thomas

[1]: Thanks Aria for the tip about the glob() function. It's cleaner.
[2]: Rumor has it that Hare Krishna means hire a consultant in Hindi.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: includepatch.diff
Type: text/x-diff
Size: 3131 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20090711/285720ff/attachment.bin 


More information about the dovecot mailing list