Thomas GUTHMANN
2009-Jul-11 10:41 UTC
[Dovecot] [PATCH] include parameters can handle globbing
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
Re,> The include features has been done and almost kept hidden by Timo :)Just to clarify my sentence. This feature is not clearly documented and is _NOT_ kept hidden in purpose by Timo. The include features will be mainline in dovecot 2.0. In the meantime, now you know that's possible even if not documented. Cheers, Thomas
Timo Sirainen
2009-Jul-27 01:00 UTC
[Dovecot] [PATCH] include parameters can handle globbing
On Sat, 2009-07-11 at 20:41 +1000, Thomas GUTHMANN wrote:> 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*Committed with some changes: http://hg.dovecot.org/dovecot-1.2/rev/1aec43edab2d -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090726/e9af7d70/attachment-0002.bin>