[Kolab-devel] gunnar: server/kolab-filter/filter config.php, 1.3, 1.4 kolabfilter.php, 1.2, 1.3 kolabmailboxfilter.php, 1.2, 1.3

Richard Bos ml at radoeka.nl
Thu Nov 29 13:29:13 CET 2007


Hi,

Op Thursday 29 November 2007 11:25:12 schreef Gunnar Wrobel:
> > It looks like filter/config.php is used as to determine default
> > values that are shown to a user on a for example a configuration
> > webpage.
>
> The "@@@variable@@@" is solely used in Kolab templates and I won't add
> these to the dummy config.php in kolab-filter/filter.
>
> Of course the config.php in kolab-filter/filter get's ultimately
> rewritten with the template contents but that only happens on a Kolab
> Server.
>
> If we desire to distribute source packages these should be clean
> source packages and not tainted by some very specific Kolab concepts.
>
> Let's assume somebody else is interested in the Kolab specific
> resource management and the corresponding postfix filters provided
> with kolab-filter. That person would download the package and look at
> the configuration file and would probably wonder about the "@@@"
> stuff. Without a Kolab server these do not make much sense but the
> package itself does.

Ah I understand the purpose now.  It's only there as a source and not to be 
used by any of the kolab scripts, right?

So, actually what you really want is a script, that converts the resmgr conf 
template in this config.php isn't it.  I tried to accomplish that, and I'm 
almost there, but the @@@if etc thingies.  Perhaps someone else knows a 
solution for that??  I have attached the script, just run it from the 
templates directory, or from another directory but than you need to specify 
the location of the templates directory.

After I ran the script, and compared the the result, the diff is as follows:
kolab-filter/filter> diff config.php out
75c75,79
< $conf['filter']['verify_from_header'] = true;
---
> @@@if kolabfilter-verify-from-header@@@
> $params['verify_from_header'] = ('true'=='TRUE');
> @@@else@@@
> $params['verify_from_header'] = false;
> @@@endif@@@
83c87,91
< $conf['filter']['allow_sender_header'] = true;
---
> @@@if kolabfilter-allow-sender-header@@@
> $params['allow_sender_header'] = ('true'=='TRUE');
> @@@else@@@
> $params['allow_sender_header'] = false;
> @@@endif@@@
88c96,100
< $conf['filter']['reject_forged_from_header'] = false;
---
> @@@if kolabfilter-reject-forged-from-header@@@
> $params['reject_forged_from_header'] = ('false'=='TRUE');
> @@@else@@@
> $params['reject_forged_from_header'] = false;
> @@@endif@@@


The variables in the @@@ construction are called $params in the resmgr conf 
file, but in config.php $conf, is that correct?


121c133
< $conf['filter']['priv_key_file'] = '@sysconfdir@/kolab/res_priv.pem';
---
> $conf['filter']['priv_key_file'] = '/kolab/etc/kolab/res_priv.pem';

Is a clear mistake.


130c142
< $conf['filter']['freebusy_url'] 
= 'http://kolab.example.com/freebusy/${USER}.xfb';
---
> $conf['filter']['freebusy_url'] = 'kolab.example.com/freebusy/${USER}.xfb';

Shouldn't there be an http:// in the resmgr config file?

133c145
< $conf['filter']['pfb_trigger_url'] 
= 'http://@@@fqdnhostname@@@/freebusy/trigger/${USER}/${FOLDER}.xpfb';
---
> $conf['filter']['pfb_trigger_url'] 
= 'https://kolab.example.com/freebusy/trigger/${USER}/${FOLDER}.xpfb';

Is it http or https?

I think that the diff shows, that it might be good to have a conversion script 
to create the config.php file.  But than the script should be able to coop 
with the @@@ thingies....


-- 
Richard Bos
We are borrowing the world of our children,
It is not inherited from our parents.
-------------- next part --------------
#/bin/bash

PATH=/usr/bin

sed \
  -e s%@@@connect_addr@@@%localhost%g \
  -e s%@@@fqdnhostname@@@%kolab.example.com%g \
  -e s%@@@kolabfilter-allow-sender-header@@@%true%g \
  -e s%@@@kolabfilter-reject-forged-from-header@@@%false%g -e s%@@@kolabfilter-verify-from-header@@@%true%g \
  -e s%@@@kolabhost.*@@@%one.example.com,two.example.com,three.example.com%g \
  -e s%@@@ldap_uri@@@%ldaps://ldap.example.com%g \
  -e s%@@@local_addr@@@%localhost%g \
  -e s%@@@php_dn@@@%cn=nobody,cn=internal,dc=example,dc=com%g \
  -e s%@@@php_pw@@@%xyz%g \
  -e s%@@@postfix-mydomain@@@%example.com%g \
  -e s%@@@base_dn@@@%dc=example,dc=com%g \
  -e s%@@@calendar_id@@@%calendar%g \
  -e s%@@@calendar_pw@@@%zyx%g \
  -e s%@webserver_web_prefix@%%g \
  -e s%@resmgr_logdir@%/kolab/var/kolab-filter/log%g \
  -e s%@resmgr_tmpdir@%%g \
  -e s%@sysconfdir@%/kolab/etc%g \
  -e /^[KPOT].*/d \
  ${1:-.}/resmgr.conf.template.in


More information about the devel mailing list