<?xml version="1.0" encoding="utf-8"?>

<creole>

    <files>
        <file filelist='courier' name='/usr/share/eole/annuaire/password_files/mail.ini' mkdir='True' rm='True'/>
        <file filelist='courier' name='/etc/bareos/bareosfichiers.d/courier.conf' source='bareos-courier.conf' rm='True'/>
    </files>
    <containers>
        <container name='mail' id='13'>
            <package>eole-courier-pkg</package>
            <service servicelist='courier_imap'>courier-imap</service>
            <service servicelist='courier_imap'>courier-imap-ssl</service>
            <service_access service='courier_imap'>
                <port>143</port>
                <port>993</port>
            </service_access>
            <service servicelist='courier_pop'>courier-pop</service>
            <service servicelist='courier_pop'>courier-pop-ssl</service>
            <service_access service='courier_pop'>
                <port>110</port>
                <port>995</port>
            </service_access>
            <service servicelist='courier_authdaemon'>courier-authdaemon</service>
            <file filelist='courier' name='/etc/courier/authdaemonrc'/>
            <file filelist='courier' name='/etc/courier/authldaprc' mode='0600'/>
            <file filelist='courier' name='/etc/courier/imapd'/>
            <!-- pour courier-imaps -->
            <file filelist='courier' name='/etc/courier/imapd-ssl'/>
            <!-- pour courier-pops -->
            <file filelist='courier' name='/etc/courier/pop3d-ssl'/>
            <!-- pour courier-eolecas -->
            <file name='/etc/courier/authprog.conf' filelist='couriersso'/>
            <file name='/usr/share/php/configCAS/cas.inc.php' source='cas.inc.php.tmpl' filelist='couriersso' mkdir='True'/>
        </container>
    </containers>

    <variables>
        <family name='messagerie'>
            <variable name='activer_recuperation_courriel' redefine='True'>
                <value>local</value>
            </variable>
            <variable name='activer_courier_imap' type='oui/non' description="Activer le serveur IMAP de Courier">
                <value>oui</value>
            </variable>
            <variable name='activer_courier_pop' type='oui/non' description="Activer le serveur POP de Courier">
                <value>non</value>
            </variable>
            <variable name="activer_courier_commun" type='oui/non' description="Activer les services communs pour Courier"/>
            <variable name="activer_courier_imap_sso" type='oui/non' description="Autoriser l'authentification CAS pour le serveur IMAP de Courier">
                <value>oui</value>
            </variable>
            <variable name='adresse_imap_sso' type='domain' description="Adresse du serveur IMAP utilisé pour le client CAS/IMAP" mandatory="True"/>
        </family>
        <separators/>
    </variables>

    <constraints>
        <check name="valid_enum" target="activer_recuperation_courriel">
            <param>['non', 'local', 'distant']</param>
        </check>
        <condition name='disabled_if_in' source='activer_sso'>
            <param>non</param>
            <target type='filelist'>couriersso</target>
        </condition>
        <condition name='disabled_if_in' source='activer_courier_imap_sso'>
            <param>non</param>
            <target type='filelist'>couriersso</target>
        </condition>
        <condition name='disabled_if_in' source='activer_courier_imap'>
            <param>non</param>
            <target>activer_courier_imap_sso</target>
        </condition>
        <condition name='disabled_if_in' source='activer_courier_imap_sso'>
            <param>non</param>
            <target>adresse_imap_sso</target>
        </condition>
        <condition name='disabled_if_not_in' source='activer_recuperation_courriel'>
            <param>local</param>
            <target>activer_courier_imap</target>
            <target>activer_courier_pop</target>
            <target>activer_courier_commun</target>
        </condition>
        <condition name='disabled_if_not_in' source='activer_courier_commun'>
            <param>oui</param>
            <target type='servicelist'>courier_authdaemon</target>
            <target type='filelist'>courier</target>
        </condition>
        <condition name='disabled_if_in' source='activer_courier_imap'>
            <param>non</param>
            <target type='servicelist'>courier_imap</target>
        </condition>
        <condition name='disabled_if_in' source='activer_courier_pop'>
            <param>non</param>
            <target type='servicelist'>courier_pop</target>
        </condition>
        <fill name='calc_multi_condition' target='adresse_imap'>
            <param>local</param>
            <param type='eole' name='condition_1'>activer_recuperation_courriel</param>
            <param type='eole' name='match'>adresse_ip_mail</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <auto name='calc_multi_condition' target='activer_courier_commun'>
            <param>non</param>
            <param type='eole' name='condition_1'>activer_courier_imap</param>
            <param type='eole' name='condition_2'>activer_courier_pop</param>
            <param name='match'>non</param>
            <param name='mismatch'>oui</param>
        </auto>
        <fill name='calc_val' target='adresse_imap_sso'>
            <param type='eole'>adresse_imap</param>
        </fill>
        <condition name='frozen_if_in' source='activer_recuperation_courriel'>
            <param>local</param>
            <target type='variable'>adresse_imap</target>
        </condition>
    </constraints>

    <help>
        <variable name='activer_courier_imap'>Courier est un serveur d'échange de courrier électronique via le protocole IMAP</variable>
        <variable name='activer_courier_pop'>Courier est un serveur d'échange de courrier électronique via le protocole POP</variable>
        <variable name='adresse_imap_sso'>Il faut renseigner l'adresse du serveur IMAP définit sur le client IMAP avec authentification CAS (par exemple roundcube)</variable>
    </help>

</creole>
<!-- vim: ts=4 sw=4 expandtab
-->
