Back to index

d-push  2.0
config.php
Go to the documentation of this file.
00001 <?php
00002 /***********************************************
00003 * File      :   backend/combined/config.php
00004 * Project   :   Z-Push
00005 * Descr     :   configuration file for the
00006 *               combined backend.
00007 *
00008 * Created   :   29.11.2010
00009 *
00010 * Copyright 2007 - 2010 Zarafa Deutschland GmbH
00011 *
00012 * This program is free software: you can redistribute it and/or modify
00013 * it under the terms of the GNU Affero General Public License, version 3,
00014 * as published by the Free Software Foundation with the following additional
00015 * term according to sec. 7:
00016 *
00017 * According to sec. 7 of the GNU Affero General Public License, version 3,
00018 * the terms of the AGPL are supplemented with the following terms:
00019 *
00020 * "Zarafa" is a registered trademark of Zarafa B.V.
00021 * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
00022 * The licensing of the Program under the AGPL does not imply a trademark license.
00023 * Therefore any rights, title and interest in our trademarks remain entirely with us.
00024 *
00025 * However, if you propagate an unmodified version of the Program you are
00026 * allowed to use the term "Z-Push" to indicate that you distribute the Program.
00027 * Furthermore you may use our trademarks where it is necessary to indicate
00028 * the intended purpose of a product or service provided you use it in accordance
00029 * with honest practices in industrial or commercial matters.
00030 * If you want to propagate modified versions of the Program under the name "Z-Push",
00031 * you may only do so if you have a written permission by Zarafa Deutschland GmbH
00032 * (to acquire a permission please contact Zarafa at trademark@zarafa.com).
00033 *
00034 * This program is distributed in the hope that it will be useful,
00035 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00036 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00037 * GNU Affero General Public License for more details.
00038 *
00039 * You should have received a copy of the GNU Affero General Public License
00040 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00041 *
00042 * Consult LICENSE file for details
00043 ************************************************/
00044 
00045 class BackendCombinedConfig {
00046 
00047     // *************************
00048     //  BackendZarafa settings
00049     // *************************
00050     public static $BackendZarafa_config = array('MAPI_SERVER' => MAPI_SERVER);
00051 
00052     // *************************
00053     //  BackendIMAP settings
00054     // *************************
00055     public static $BackendIMAP_config = array(
00056         // Defines the server to which we want to connect
00057         'IMAP_SERVER' => IMAP_SERVER,
00058         // connecting to default port (143)
00059         'IMAP_PORT' => IMAP_PORT,
00060         // best cross-platform compatibility (see http://php.net/imap_open for options)
00061         'IMAP_OPTIONS' => IMAP_OPTIONS,
00062         // overwrite the "from" header if it isn't set when sending emails
00063         // options: 'username'    - the username will be set (usefull if your login is equal to your emailaddress)
00064         //        'domain'    - the value of the "domain" field is used
00065         //        '@mydomain.com' - the username is used and the given string will be appended
00066         'IMAP_DEFAULTFROM' => IMAP_DEFAULTFROM,
00067         // copy outgoing mail to this folder. If not set z-push will try the default folders
00068         'IMAP_SENTFOLDER' => IMAP_SENTFOLDER,
00069         // forward messages inline (default false - as attachment)
00070         'IMAP_INLINE_FORWARD' => IMAP_INLINE_FORWARD,
00071         // use imap_mail() to send emails (default) - if false mail() is used
00072         'IMAP_USE_IMAPMAIL' => IMAP_USE_IMAPMAIL,
00073     );
00074 
00075     // *************************
00076     //  BackendMaildir settings
00077     // *************************
00078     public static $BackendMaildir_config = array(
00079         'MAILDIR_BASE' => MAILDIR_BASE,
00080         'MAILDIR_SUBDIR' => MAILDIR_SUBDIR,
00081     );
00082 
00083     // *************************
00084     //  BackendVCardDir settings
00085     // *************************
00086     public static $BackendVCardDir_config = array('VCARDDIR_DIR' => VCARDDIR_DIR);
00087 
00088     // *************************
00089     //  BackendCombined settings
00090     // *************************
00098     public static function GetBackendCombinedConfig() {
00099         //use a function for it because php does not allow
00100         //assigning variables to the class members (expecting T_STRING)
00101         return array(
00102             //the order in which the backends are loaded.
00103             //login only succeeds if all backend return true on login
00104             //sending mail: the mail is sent with first backend that is able to send the mail
00105             'backends' => array(
00106                 'i' => array(
00107                     'name' => 'BackendIMAP',
00108                     'config' => self::$BackendIMAP_config,
00109                 ),
00110                 'z' => array(
00111                     'name' => 'BackendZarafa',
00112                     'config' => self::$BackendZarafa_config
00113                 ),
00114                 'm' => array(
00115                     'name' => 'BackendMaildir',
00116                     'config' => self::$BackendMaildir_config,
00117                 ),
00118                 'v' => array(
00119                     'name' => 'BackendVCardDir',
00120                     'config' => self::$BackendVCardDir_config,
00121                 ),
00122             ),
00123             'delimiter' => '/',
00124             //force one type of folder to one backend
00125             //it must match one of the above defined backends
00126             'folderbackend' => array(
00127                 SYNC_FOLDER_TYPE_INBOX => 'i',
00128                 SYNC_FOLDER_TYPE_DRAFTS => 'i',
00129                 SYNC_FOLDER_TYPE_WASTEBASKET => 'i',
00130                 SYNC_FOLDER_TYPE_SENTMAIL => 'i',
00131                 SYNC_FOLDER_TYPE_OUTBOX => 'i',
00132                 SYNC_FOLDER_TYPE_TASK => 'z',
00133                 SYNC_FOLDER_TYPE_APPOINTMENT => 'z',
00134                 SYNC_FOLDER_TYPE_CONTACT => 'z',
00135                 SYNC_FOLDER_TYPE_NOTE => 'z',
00136                 SYNC_FOLDER_TYPE_JOURNAL => 'z',
00137                 SYNC_FOLDER_TYPE_OTHER => 'i',
00138                 SYNC_FOLDER_TYPE_USER_MAIL => 'i',
00139                 SYNC_FOLDER_TYPE_USER_APPOINTMENT => 'z',
00140                 SYNC_FOLDER_TYPE_USER_CONTACT => 'z',
00141                 SYNC_FOLDER_TYPE_USER_TASK => 'z',
00142                 SYNC_FOLDER_TYPE_USER_JOURNAL => 'z',
00143                 SYNC_FOLDER_TYPE_USER_NOTE => 'z',
00144                 SYNC_FOLDER_TYPE_UNKNOWN => 'z',
00145             ),
00146             //creating a new folder in the root folder should create a folder in one backend
00147             'rootcreatefolderbackend' => 'i',
00148         );
00149     }
00150 }
00151 ?>