项目作者: 17Halbe

项目描述 :
z-push docker image designed to work with tvial/docker-mailserver
高级语言: Shell
项目地址: git://github.com/17Halbe/z-push.git
创建时间: 2018-03-30T17:23:45Z
项目社区:https://github.com/17Halbe/z-push

开源协议:

下载


Z-Push Docker Image for tvial/docker-mailserver

This z-push docker image is designed to work in lieu with the tvial/docker-mailserver (see tomav/docker-mailserver for further information.)

The following variables are currently used:

  • TIMEZONE: in the format of Europe/Zurich
  • IMAP_SERVER: your imap server address/ip
  • IMAP_PORT: imap port
  • SMTP_SERVER: smtp server address/ip
  • SMTP_PORT: smtp port
  • DEBUG: [0/1] disables/enables verbose logging.

Device Setup

For a quick guide, how to setup up your mobile device, have a look at the Zarafa-Homepage

Configuration

If you need to change the default configuration, you can do so by placing a config.php and/or a imap.php into a folder which has to be mounted as a volume to /config/ inside the container.

Note: Those files just get appended to the container configuration files for now.

Example:

  1. docker run -d -name z-push \
  2. -v ./config:/config/ \
  3. -e TIMEZONE=Europe/Zurich \
  4. -e IMAP_SERVER=imap.yourdomain.tld \
  5. -e IMAP_PORT=143 \
  6. -e SMTP_SERVER=smtp.yourdomain.tld \
  7. -e SMTP_PORT=465 \
  8. -e DEBUG=1 \
  9. 17halbe/z-push`

The used configuration is being put out to the docker logs upon container start, and can be read by docker logs <your_container_name>

Here are the settings used at the time of writing:

config.php

  1. <?php
  2. /***********************************************
  3. * File : config.php
  4. * Project : Z-Push
  5. * Descr : Main configuration file
  6. *
  7. * Created : 01.10.2007
  8. *
  9. * Copyright 2007 - 2016 Zarafa Deutschland GmbH
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses></http:>.
  22. *
  23. * Consult LICENSE file for details
  24. ************************************************/
  25. /**********************************************************************************
  26. * Default settings
  27. */
  28. // Defines the default time zone, change e.g. to "Europe/London" if necessary
  29. define('TIMEZONE', '');
  30. // Defines the base path on the server
  31. define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/');
  32. // Try to set unlimited timeout
  33. define('SCRIPT_TIMEOUT', 0);
  34. // When accessing through a proxy, the "X-Forwarded-For" header contains the original remote IP
  35. define('USE_X_FORWARDED_FOR_HEADER', false);
  36. // When using client certificates, we can check if the login sent matches the owner of the certificate.
  37. // This setting specifies the owner parameter in the certificate to look at.
  38. define("CERTIFICATE_OWNER_PARAMETER", "SSL_CLIENT_S_DN_CN");
  39. /*
  40. * Whether to use the complete email address as a login name
  41. * (e.g. user@company.com) or the username only (user).
  42. * This is required for Z-Push to work properly after autodiscover.
  43. * Possible values:
  44. * false - use the username only.
  45. * true - string the mobile sends as username, e.g. full email address (default).
  46. */
  47. define('USE_FULLEMAIL_FOR_LOGIN', true);
  48. /**********************************************************************************
  49. * StateMachine setting
  50. *
  51. * These StateMachines can be used:
  52. * FILE - FileStateMachine (default). Needs STATE_DIR set as well.
  53. * SQL - SqlStateMachine has own configuration file. STATE_DIR is ignored.
  54. * State migration script is available, more informations: https://wiki.z-hub.io/x/xIAa
  55. */
  56. define('STATE_MACHINE', 'FILE');
  57. define('STATE_DIR', '/state/');
  58. /**********************************************************************************
  59. * IPC - InterProcessCommunication
  60. *
  61. * Is either provided by using shared memory on a single host or
  62. * using the memcache provider for multi-host environments.
  63. * When another implementation should be used, the class can be set here explicitly.
  64. * If empty Z-Push will try to use available providers.
  65. */
  66. define('IPC_PROVIDER', '');
  67. /**********************************************************************************
  68. * Logging settings
  69. *
  70. * The LOGBACKEND specifies where the logs are sent to.
  71. * Either to file ("filelog") or to a "syslog" server or a custom log class in core/log/logclass.
  72. * filelog and syslog have several options that can be set below.
  73. * For more information about the syslog configuration, see https://wiki.z-hub.io/x/HIAT
  74. * Possible LOGLEVEL and LOGUSERLEVEL values are:
  75. * LOGLEVEL_OFF - no logging
  76. * LOGLEVEL_FATAL - log only critical errors
  77. * LOGLEVEL_ERROR - logs events which might require corrective actions
  78. * LOGLEVEL_WARN - might lead to an error or require corrective actions in the future
  79. * LOGLEVEL_INFO - usually completed actions
  80. * LOGLEVEL_DEBUG - debugging information, typically only meaningful to developers
  81. * LOGLEVEL_WBXML - also prints the WBXML sent to/from the device
  82. * LOGLEVEL_DEVICEID - also prints the device id for every log entry
  83. * LOGLEVEL_WBXMLSTACK - also prints the contents of WBXML stack
  84. *
  85. * The verbosity increases from top to bottom. More verbose levels include less verbose
  86. * ones, e.g. setting to LOGLEVEL_DEBUG will also output LOGLEVEL_FATAL, LOGLEVEL_ERROR,
  87. * LOGLEVEL_WARN and LOGLEVEL_INFO level entries.
  88. *
  89. * LOGAUTHFAIL is logged to the LOGBACKEND.
  90. */
  91. define('LOGBACKEND', 'filelog');
  92. define('LOGLEVEL', LOGLEVEL_INFO);
  93. define('LOGAUTHFAIL', false);
  94. // To save e.g. WBXML data only for selected users, add the usernames to the array
  95. // The data will be saved into a dedicated file per user in the LOGFILEDIR
  96. // Users have to be encapusulated in quotes, several users are comma separated, like:
  97. // $specialLogUsers = array('info@domain.com', 'myusername');
  98. define('LOGUSERLEVEL', LOGLEVEL_DEVICEID);
  99. $specialLogUsers = array();
  100. // Filelog settings
  101. define('LOGFILEDIR', '/var/log/z-push/');
  102. define('LOGFILE', LOGFILEDIR . 'z-push.log');
  103. define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log');
  104. // Syslog settings
  105. // false will log to local syslog, otherwise put the remote syslog IP here
  106. define('LOG_SYSLOG_HOST', false);
  107. // Syslog port
  108. define('LOG_SYSLOG_PORT', 514);
  109. // Program showed in the syslog. Useful if you have more than one instance login to the same syslog
  110. define('LOG_SYSLOG_PROGRAM', 'z-push');
  111. // Syslog facility - use LOG_USER when running on Windows
  112. define('LOG_SYSLOG_FACILITY', LOG_LOCAL0);
  113. // Location of the trusted CA, e.g. '/etc/ssl/certs/EmailCA.pem'
  114. // Uncomment and modify the following line if the validation of the certificates fails.
  115. // define('CAINFO', '/etc/ssl/certs/EmailCA.pem');
  116. /**********************************************************************************
  117. * Mobile settings
  118. */
  119. // Device Provisioning
  120. define('PROVISIONING', true);
  121. // This option allows the 'loose enforcement' of the provisioning policies for older
  122. // devices which don't support provisioning (like WM 5 and HTC Android Mail) - dw2412 contribution
  123. // false (default) - Enforce provisioning for all devices
  124. // true - allow older devices, but enforce policies on devices which support it
  125. define('LOOSE_PROVISIONING', false);
  126. // The file containing the policies' settings.
  127. // Set a full path or relative to the z-push main directory
  128. define('PROVISIONING_POLICYFILE', 'policies.ini');
  129. // Default conflict preference
  130. // Some devices allow to set if the server or PIM (mobile)
  131. // should win in case of a synchronization conflict
  132. // SYNC_CONFLICT_OVERWRITE_SERVER - Server is overwritten, PIM wins
  133. // SYNC_CONFLICT_OVERWRITE_PIM - PIM is overwritten, Server wins (default)
  134. define('SYNC_CONFLICT_DEFAULT', SYNC_CONFLICT_OVERWRITE_PIM);
  135. // Global limitation of items to be synchronized
  136. // The mobile can define a sync back period for calendar and email items
  137. // For large stores with many items the time period could be limited to a max value
  138. // If the mobile transmits a wider time period, the defined max value is used
  139. // Applicable values:
  140. // SYNC_FILTERTYPE_ALL (default, no limitation)
  141. // SYNC_FILTERTYPE_1DAY, SYNC_FILTERTYPE_3DAYS, SYNC_FILTERTYPE_1WEEK, SYNC_FILTERTYPE_2WEEKS,
  142. // SYNC_FILTERTYPE_1MONTH, SYNC_FILTERTYPE_3MONTHS, SYNC_FILTERTYPE_6MONTHS
  143. define('SYNC_FILTERTIME_MAX', SYNC_FILTERTYPE_ALL);
  144. // Interval in seconds before checking if there are changes on the server when in Ping.
  145. // It means the highest time span before a change is pushed to a mobile. Set it to
  146. // a higher value if you have a high load on the server.
  147. define('PING_INTERVAL', 30);
  148. // Set the fileas (save as) order for contacts in the webaccess/webapp/outlook.
  149. // It will only affect new/modified contacts on the mobile which then are synced to the server.
  150. // Possible values are:
  151. // SYNC_FILEAS_FIRSTLAST - fileas will be "Firstname Middlename Lastname"
  152. // SYNC_FILEAS_LASTFIRST - fileas will be "Lastname, Firstname Middlename"
  153. // SYNC_FILEAS_COMPANYONLY - fileas will be "Company"
  154. // SYNC_FILEAS_COMPANYLAST - fileas will be "Company (Lastname, Firstname Middlename)"
  155. // SYNC_FILEAS_COMPANYFIRST - fileas will be "Company (Firstname Middlename Lastname)"
  156. // SYNC_FILEAS_LASTCOMPANY - fileas will be "Lastname, Firstname Middlename (Company)"
  157. // SYNC_FILEAS_FIRSTCOMPANY - fileas will be "Firstname Middlename Lastname (Company)"
  158. // The company-fileas will only be set if a contact has a company set. If one of
  159. // company-fileas is selected and a contact doesn't have a company set, it will default
  160. // to SYNC_FILEAS_FIRSTLAST or SYNC_FILEAS_LASTFIRST (depending on if last or first
  161. // option is selected for company).
  162. // If SYNC_FILEAS_COMPANYONLY is selected and company of the contact is not set
  163. // SYNC_FILEAS_LASTFIRST will be used
  164. define('FILEAS_ORDER', SYNC_FILEAS_LASTFIRST);
  165. // Maximum amount of items to be synchronized per request.
  166. // Normally this value is requested by the mobile. Common values are 5, 25, 50 or 100.
  167. // Exporting too much items can cause mobile timeout on busy systems.
  168. // Z-Push will use the lowest provided value, either set here or by the mobile.
  169. // MS Outlook 2013+ request up to 512 items to accelerate the sync process.
  170. // If you detect high load (also on subsystems) you could try a lower setting.
  171. // max: 512 - value used if mobile does not limit amount of items
  172. define('SYNC_MAX_ITEMS', 512);
  173. // The devices usually send a list of supported properties for calendar and contact
  174. // items. If a device does not includes such a supported property in Sync request,
  175. // it means the property's value will be deleted on the server.
  176. // However some devices do not send a list of supported properties. It is then impossible
  177. // to tell if a property was deleted or it was not set at all if it does not appear in Sync.
  178. // This parameter defines Z-Push behaviour during Sync if a device does not issue a list with
  179. // supported properties.
  180. // See also https://jira.z-hub.io/browse/ZP-302.
  181. // Possible values:
  182. // false - do not unset properties which are not sent during Sync (default)
  183. // true - unset properties which are not sent during Sync
  184. define('UNSET_UNDEFINED_PROPERTIES', false);
  185. // ActiveSync specifies that a contact photo may not exceed 48 KB. This value is checked
  186. // in the semantic sanity checks and contacts with larger photos are not synchronized.
  187. // This limitation is not being followed by the ActiveSync clients which set much bigger
  188. // contact photos. You can override the default value of the max photo size.
  189. // default: 5242880 - 5 MB default max photo size in bytes
  190. define('SYNC_CONTACTS_MAXPICTURESIZE', 5242880);
  191. // Over the WebserviceUsers command it is possible to retrieve a list of all
  192. // known devices and users on this Z-Push system. The authenticated user needs to have
  193. // admin rights and a public folder must exist.
  194. // In multicompany environments this enable an admin user of any company to retrieve
  195. // this full list, so this feature is disabled by default. Enable with care.
  196. define('ALLOW_WEBSERVICE_USERS_ACCESS', false);
  197. // Users with many folders can use the 'partial foldersync' feature, where the server
  198. // actively stops processing the folder list if it takes too long. Other requests are
  199. // then redirected to the FolderSync to synchronize the remaining items.
  200. // Device compatibility for this procedure is not fully understood.
  201. // NOTE: THIS IS AN EXPERIMENTAL FEATURE WHICH COULD PREVENT YOUR MOBILES FROM SYNCHRONIZING.
  202. define('USE_PARTIAL_FOLDERSYNC', false);
  203. // The minimum accepted time in second that a ping command should last.
  204. // It is strongly advised to keep this config to false. Some device
  205. // might not be able to send a higher value than the one specificied here and thus
  206. // unable to start a push connection.
  207. // If set to false, there will be no lower bound to the ping lifetime.
  208. // The minimum accepted value is 1 second. The maximum accepted value is 3540 seconds (59 minutes).
  209. define('PING_LOWER_BOUND_LIFETIME', false);
  210. // The maximum accepted time in second that a ping command should last.
  211. // If set to false, there will be no higher bound to the ping lifetime.
  212. // The minimum accepted value is 1 second. The maximum accepted value is 3540 seconds (59 minutes).
  213. define('PING_HIGHER_BOUND_LIFETIME', false);
  214. // Maximum response time
  215. // Mobiles implement different timeouts to their TCP/IP connections. Android devices for example
  216. // have a hard timeout of 30 seconds. If the server is not able to answer a request within this timeframe,
  217. // the answer will not be recieved and the device will send a new one overloading the server.
  218. // There are three categories
  219. // - Short timeout - server has up within 30 seconds - is automatically applied for not categorized types
  220. // - Medium timeout - server has up to 90 seconds to respond
  221. // - Long timeout - server has up to 4 minutes to respond
  222. // If a timeout is almost reached the server will break and sent the results it has until this
  223. // point. You can add DeviceType strings to the categories.
  224. // In general longer timeouts are better, because more data can be streamed at once.
  225. define('SYNC_TIMEOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI");
  226. define('SYNC_TIMEOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook");
  227. // Time in seconds the device should wait whenever the service is unavailable,
  228. // e.g. when a backend service is unavailable.
  229. // Z-Push sends a "Retry-After" header in the response with the here defined value.
  230. // It is up to the device to respect or not this directive so even if this option is set,
  231. // the device might not wait requested time frame.
  232. // Number of seconds before retry, to disable set to: false
  233. define('RETRY_AFTER_DELAY', 300);
  234. /**********************************************************************************
  235. * Backend settings
  236. */
  237. // the backend data provider
  238. define('BACKEND_PROVIDER', 'BackendIMAP');
  239. /**********************************************************************************
  240. * Search provider settings
  241. *
  242. * Alternative backend to perform SEARCH requests (GAL search)
  243. * By default the main Backend defines the preferred search functionality.
  244. * If set, the Search Provider will always be preferred.
  245. * Use 'BackendSearchLDAP' to search in a LDAP directory (see backend/searchldap/config.php)
  246. */
  247. define('SEARCH_PROVIDER', '');
  248. // Time in seconds for the server search. Setting it too high might result in timeout.
  249. // Setting it too low might not return all results. Default is 10.
  250. define('SEARCH_WAIT', 10);
  251. // The maximum number of results to send to the client. Setting it too high
  252. // might result in timeout. Default is 10.
  253. define('SEARCH_MAXRESULTS', 10);
  254. /**********************************************************************************
  255. * Kopano Outlook Extension - Settings
  256. *
  257. * The Kopano Outlook Extension (KOE) provides MS Outlook 2013 and newer with
  258. * functionality not provided by ActiveSync or not implemented by Outlook.
  259. * For more information, see: https://wiki.z-hub.io/x/z4Aa
  260. */
  261. // Global Address Book functionality
  262. define('KOE_CAPABILITY_GAB', true);
  263. // Synchronize mail flags from the server to Outlook/KOE
  264. define('KOE_CAPABILITY_RECEIVEFLAGS', true);
  265. // Encode flags when sending from Outlook/KOE
  266. define('KOE_CAPABILITY_SENDFLAGS', true);
  267. // Out-of-office support
  268. define('KOE_CAPABILITY_OOF', true);
  269. // Out-of-office support with start & end times (superseeds KOE_CAPABILITY_OOF)
  270. define('KOE_CAPABILITY_OOFTIMES', true);
  271. // Notes support
  272. define('KOE_CAPABILITY_NOTES', true);
  273. // Shared folder support
  274. define('KOE_CAPABILITY_SHAREDFOLDER', true);
  275. // Send-As support for Outlook/KOE and mobiles
  276. define('KOE_CAPABILITY_SENDAS', true);
  277. // Secondary Contact folders (own and shared)
  278. define('KOE_CAPABILITY_SECONDARYCONTACTS', true);
  279. // Copy WebApp signature into KOE
  280. define('KOE_CAPABILITY_SIGNATURES', true);
  281. // Delivery receipt requests
  282. define('KOE_CAPABILITY_RECEIPTS', true);
  283. // To synchronize the GAB KOE, the GAB store and folderid need to be specified.
  284. // Use the gab-sync script to generate this data. The name needs to
  285. // match the config of the gab-sync script.
  286. // More information here: https://wiki.z-hub.io/x/z4Aa (GAB Sync Script)
  287. define('KOE_GAB_STORE', 'SYSTEM');
  288. define('KOE_GAB_FOLDERID', '');
  289. define('KOE_GAB_NAME', 'Z-Push-KOE-GAB');
  290. /**********************************************************************************
  291. * Synchronize additional folders to all mobiles
  292. *
  293. * With this feature, special folders can be synchronized to all mobiles.
  294. * This is useful for e.g. global company contacts.
  295. *
  296. * This feature is supported only by certain devices, like iPhones.
  297. * Check the compatibility list for supported devices:
  298. * http://z-push.org/compatibility
  299. *
  300. * To synchronize a folder, add a section setting all parameters as below:
  301. * store: the ressource where the folder is located.
  302. * Kopano users use 'SYSTEM' for the 'Public Folder'
  303. * folderid: folder id of the folder to be synchronized
  304. * name: name to be displayed on the mobile device
  305. * type: supported types are:
  306. * SYNC_FOLDER_TYPE_USER_CONTACT
  307. * SYNC_FOLDER_TYPE_USER_APPOINTMENT
  308. * SYNC_FOLDER_TYPE_USER_TASK
  309. * SYNC_FOLDER_TYPE_USER_MAIL
  310. * SYNC_FOLDER_TYPE_USER_NOTE
  311. *
  312. * Additional notes:
  313. * - on Kopano systems use backend/kopano/listfolders.php script to get a list
  314. * of available folders
  315. *
  316. * - all Z-Push users must have at least reading permissions so the configured
  317. * folders can be synchronized to the mobile. Else they are ignored.
  318. *
  319. * - this feature is only partly suitable for multi-tenancy environments,
  320. * as ALL users from ALL tenents need access to the configured store & folder.
  321. * When configuring a public folder, this will cause problems, as each user has
  322. * a different public folder in his tenant, so the folder are not available.
  323. * - changing this configuration could cause HIGH LOAD on the system, as all
  324. * connected devices will be updated and load the data contained in the
  325. * added/modified folders.
  326. */
  327. $additionalFolders = array(
  328. // demo entry for the synchronization of contacts from the public folder.
  329. // uncomment (remove '/*' '*/') and fill in the folderid
  330. /*
  331. array(
  332. 'store' => "SYSTEM",
  333. 'folderid' => "",
  334. 'name' => "Public Contacts",
  335. 'type' => SYNC_FOLDER_TYPE_USER_CONTACT,
  336. ),
  337. */
  338. );

imap.php

  1. <?php
  2. /***********************************************
  3. * File : config.php
  4. * Project : Z-Push
  5. * Descr : IMAP backend configuration file
  6. *
  7. * Created : 27.11.2012
  8. *
  9. * Copyright 2007 - 2016 Zarafa Deutschland GmbH
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses></http:>.
  22. *
  23. * Consult LICENSE file for details
  24. ************************************************/
  25. // ************************
  26. // BackendIMAP settings
  27. // ************************
  28. // Defines the server to which we want to connect
  29. define('IMAP_SERVER', 'localhost');
  30. // connecting to default port (143)
  31. define('IMAP_PORT', '143');
  32. // best cross-platform compatibility (see http://php.net/imap_open for options)
  33. define('IMAP_OPTIONS', '/tls/norsh/novalidate-cert');
  34. // Mark messages as read when moving to Trash.
  35. // BE AWARE that you will lose the unread flag, but some mail clients do this so the Trash folder doesn't get boldened
  36. define('IMAP_AUTOSEEN_ON_DELETE', false);
  37. // IMPORTANT: BASIC IMAP FOLDERS [ask your mail admin]
  38. // We can have diferent cases (case insensitive):
  39. // 1.
  40. // inbox
  41. // sent
  42. // drafts
  43. // trash
  44. // 2.
  45. // inbox
  46. // common.sent
  47. // common.drafts
  48. // common.trash
  49. // 3.
  50. // common.inbox
  51. // common.sent
  52. // common.drafts
  53. // common.trash
  54. // 4.
  55. // common
  56. // common.sent
  57. // common.drafts
  58. // common.trash
  59. //
  60. // gmail is a special case, where the default folders are under the [gmail] prefix and the folders defined by the user are under INBOX.
  61. // This configuration seems to work:
  62. // define('IMAP_FOLDER_PREFIX', '');
  63. // define('IMAP_FOLDER_PREFIX_IN_INBOX', false);
  64. // define('IMAP_FOLDER_INBOX', 'INBOX');
  65. // define('IMAP_FOLDER_SENT', '[Gmail]/Sent');
  66. // define('IMAP_FOLDER_DRAFT', '[Gmail]/Drafts');
  67. // define('IMAP_FOLDER_TRASH', '[Gmail]/Trash');
  68. // define('IMAP_FOLDER_SPAM', '[Gmail]/Spam');
  69. // define('IMAP_FOLDER_ARCHIVE', '[Gmail]/All Mail');
  70. // Since I know you won't configure this, I will raise an error unless you do.
  71. // When configured set this to true to remove the error
  72. define('IMAP_FOLDER_CONFIGURED', true);
  73. // Folder prefix is the common part in your names (3, 4)
  74. define('IMAP_FOLDER_PREFIX', '');
  75. // Inbox will have the preffix preppend (3 & 4 to true)
  76. define('IMAP_FOLDER_PREFIX_IN_INBOX', false);
  77. // Inbox folder name (case doesn't matter) - (empty in 4)
  78. define('IMAP_FOLDER_INBOX', 'INBOX');
  79. // Sent folder name (case doesn't matter)
  80. define('IMAP_FOLDER_SENT', 'SENT');
  81. // Draft folder name (case doesn't matter)
  82. define('IMAP_FOLDER_DRAFT', 'DRAFTS');
  83. // Trash folder name (case doesn't matter)
  84. define('IMAP_FOLDER_TRASH', 'TRASH');
  85. // Spam folder name (case doesn't matter). Only showed as special by iOS devices
  86. define('IMAP_FOLDER_SPAM', 'SPAM');
  87. // Archive folder name (case doesn't matter). Only showed as special by iOS devices
  88. define('IMAP_FOLDER_ARCHIVE', 'ARCHIVE');
  89. // forward messages inline (default true - inlined)
  90. define('IMAP_INLINE_FORWARD', true);
  91. // list of folders we want to exclude from sync. Names, or part of it, separated by |
  92. // example: dovecot.sieve|archive|spam
  93. define('IMAP_EXCLUDED_FOLDERS', '');
  94. // overwrite the "from" header with some value
  95. // options:
  96. // '' - do nothing, use the From header
  97. // 'username' - the username will be set (usefull if your login is equal to your emailaddress)
  98. // 'domain' - the value of the "domain" field is used
  99. // 'sql' - the username will be the result of a sql query. REMEMBER TO INSTALL PHP-PDO AND PHP-DATABASE
  100. // 'ldap' - the username will be the result of a ldap query. REMEMBER TO INSTALL PHP-LDAP!!
  101. // '@mydomain.com' - the username is used and the given string will be appended
  102. define('IMAP_DEFAULTFROM', '');
  103. // DSN: formatted PDO connection string
  104. // mysql:host=xxx;port=xxx;dbname=xxx
  105. // USER: username to DB
  106. // PASSWORD: password to DB
  107. // OPTIONS: array with options needed
  108. // QUERY: query to execute
  109. // FIELDS: columns in the query
  110. // FROM: string that will be the from, replacing the column names with the values
  111. define('IMAP_FROM_SQL_DSN', '');
  112. define('IMAP_FROM_SQL_USER', '');
  113. define('IMAP_FROM_SQL_PASSWORD', '');
  114. define('IMAP_FROM_SQL_OPTIONS', serialize(array(PDO::ATTR_PERSISTENT => true)));
  115. define('IMAP_FROM_SQL_QUERY', "select first_name, last_name, mail_address from users where mail_address = '#username@#domain'");
  116. define('IMAP_FROM_SQL_FIELDS', serialize(array('first_name', 'last_name', 'mail_address')));
  117. define('IMAP_FROM_SQL_FROM', '#first_name #last_name <#mail_address>');
  118. define('IMAP_FROM_SQL_FULLNAME', '#first_name #last_name');
  119. // SERVER: ldap server
  120. // SERVER_PORT: ldap port
  121. // USER: dn to use for connecting
  122. // PASSWORD: password
  123. // QUERY: query to execute
  124. // FIELDS: columns in the query
  125. // FROM: string that will be the from, replacing the field names with the values
  126. define('IMAP_FROM_LDAP_SERVER', 'localhost');
  127. define('IMAP_FROM_LDAP_SERVER_PORT', '389');
  128. define('IMAP_FROM_LDAP_USER', 'cn=zpush,ou=servers,dc=zpush,dc=org');
  129. define('IMAP_FROM_LDAP_PASSWORD', 'password');
  130. define('IMAP_FROM_LDAP_BASE', 'dc=zpush,dc=org');
  131. define('IMAP_FROM_LDAP_QUERY', '(mail=#username@#domain)');
  132. define('IMAP_FROM_LDAP_FIELDS', serialize(array('givenname', 'sn', 'mail')));
  133. define('IMAP_FROM_LDAP_FROM', '#givenname #sn <#mail>');
  134. define('IMAP_FROM_LDAP_FULLNAME', '#givenname #sn');
  135. // Method used for sending mail
  136. // mail => mail() php function
  137. // sendmail => sendmail executable
  138. // smtp => direct connection against SMTP
  139. define('IMAP_SMTP_METHOD', 'smtp');
  140. global $imap_smtp_params;
  141. // SMTP Parameters
  142. // mail : no params
  143. $imap_smtp_params = array('host' => 'tls://localhost', 'port' => '465', 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password', 'verify_peer_name' => false, 'verify_peer' => false, 'allow_self_signed' => true);
  144. // sendmail
  145. //$imap_smtp_params = array('sendmail_path' => '/usr/bin/sendmail', 'sendmail_args' => '-i');
  146. // smtp
  147. // "host" - The server to connect. Default is localhost.
  148. // "port" - The port to connect. Default is 25.
  149. // "auth" - Whether or not to use SMTP authentication. Default is FALSE.
  150. // "username" - The username to use for SMTP authentication. "imap_username" for using the same username as the imap server
  151. // "password" - The password to use for SMTP authentication. "imap_password" for using the same password as the imap server
  152. // "localhost" - The value to give when sending EHLO or HELO. Default is localhost
  153. // "timeout" - The SMTP connection timeout. Default is NULL (no timeout).
  154. // "verp" - Whether to use VERP or not. Default is FALSE.
  155. // "debug" - Whether to enable SMTP debug mode or not. Default is FALSE.
  156. // "persist" - Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.
  157. // "pipelining" - Indicates whether or not the SMTP commands pipelining should be used.
  158. // "verify_peer" - Require verification of SSL certificate used. Default is TRUE.
  159. // "verify_peer_name" - Require verification of peer name. Default is TRUE.
  160. // "allow_self_signed" - Allow self-signed certificates. Requires verify_peer. Default is FALSE.
  161. //$imap_smtp_params = array('host' => 'localhost', 'port' => 25, 'auth' => false);
  162. // If you want to use SSL with port 25 or port 465 you must preppend "ssl://" before the hostname or IP of your SMTP server
  163. // IMPORTANT: To use SSL you must use PHP 5.1 or later, install openssl libs and use ssl:// within the host variable
  164. // IMPORTANT: To use SSL with PHP 5.6 you should set verify_peer, verify_peer_name and allow_self_signed
  165. //$imap_smtp_params = array('host' => 'ssl://localhost', 'port' => 465, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password');
  166. // If you are using IMAP_SMTP_METHOD = mail or sendmail and your sent messages are not correctly displayed you can change this to "\n".
  167. // BUT, it doesn't comply with RFC 2822 and will break if using smtp method
  168. define('MAIL_MIMEPART_CRLF', "\r\n");
  169. // A file containing file mime types->extension mappings.
  170. // SELINUX users: make sure the file has a security context accesible by your apache/php-fpm process
  171. define('SYSTEM_MIME_TYPES_MAPPING', '/etc/mime.types');
  172. // Use BackendCalDAV for Meetings. You cannot hope to get that functionality working without a caldav backend.
  173. define('IMAP_MEETING_USE_CALDAV', false);