暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

usr_share_z-push_backend_imap_config.php.j2 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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/>.
  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 custom port (993)
  31. define('IMAP_PORT', 993);
  32. // best cross-platform compatibility (see http://php.net/imap_open for options)
  33. define('IMAP_OPTIONS', '/ssl/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', 'inbox');
  75. // Inbox will have the preffix preppend (3 & 4 to true)
  76. define('IMAP_FOLDER_PREFIX_IN_INBOX', true);
  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', 'Junk');
  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_EMAIL', '#mail_address');
  118. define('IMAP_FROM_SQL_FROM', '#first_name #last_name <#mail_address>');
  119. define('IMAP_FROM_SQL_FULLNAME', '#first_name #last_name');
  120. // SERVER: ldap server
  121. // SERVER_PORT: ldap port
  122. // USER: dn to use for connecting
  123. // PASSWORD: password
  124. // QUERY: query to execute
  125. // FIELDS: columns in the query
  126. // FROM: string that will be the from, replacing the field names with the values
  127. define('IMAP_FROM_LDAP_SERVER', 'localhost');
  128. define('IMAP_FROM_LDAP_SERVER_PORT', '389');
  129. define('IMAP_FROM_LDAP_USER', 'cn=zpush,ou=servers,dc=zpush,dc=org');
  130. define('IMAP_FROM_LDAP_PASSWORD', 'password');
  131. define('IMAP_FROM_LDAP_BASE', 'dc=zpush,dc=org');
  132. define('IMAP_FROM_LDAP_QUERY', '(mail=#username@#domain)');
  133. define('IMAP_FROM_LDAP_FIELDS', serialize(array('givenname', 'sn', 'mail')));
  134. define('IMAP_FROM_LDAP_EMAIL', '#mail');
  135. define('IMAP_FROM_LDAP_FROM', '#givenname #sn <#mail>');
  136. define('IMAP_FROM_LDAP_FULLNAME', '#givenname #sn');
  137. // Method used for sending mail
  138. // mail => mail() php function
  139. // sendmail => sendmail executable
  140. // smtp => direct connection against SMTP
  141. define('IMAP_SMTP_METHOD', 'mail');
  142. global $imap_smtp_params;
  143. // SMTP Parameters
  144. // mail : no params
  145. $imap_smtp_params = array();
  146. // sendmail
  147. //$imap_smtp_params = array('sendmail_path' => '/usr/bin/sendmail', 'sendmail_args' => '-i');
  148. // smtp
  149. // "host" - The server to connect. Default is localhost.
  150. // "port" - The port to connect. Default is 25.
  151. // "auth" - Whether or not to use SMTP authentication. Default is FALSE.
  152. // "username" - The username to use for SMTP authentication. "imap_username" for using the same username as the imap server
  153. // "password" - The password to use for SMTP authentication. "imap_password" for using the same password as the imap server
  154. // "localhost" - The value to give when sending EHLO or HELO. Default is localhost
  155. // "timeout" - The SMTP connection timeout. Default is NULL (no timeout).
  156. // "verp" - Whether to use VERP or not. Default is FALSE.
  157. // "debug" - Whether to enable SMTP debug mode or not. Default is FALSE.
  158. // "persist" - Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.
  159. // "pipelining" - Indicates whether or not the SMTP commands pipelining should be used.
  160. // "verify_peer" - Require verification of SSL certificate used. Default is TRUE.
  161. // "verify_peer_name" - Require verification of peer name. Default is TRUE.
  162. // "allow_self_signed" - Allow self-signed certificates. Requires verify_peer. Default is FALSE.
  163. //$imap_smtp_params = array('host' => 'localhost', 'port' => 25, 'auth' => false);
  164. // 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
  165. // IMPORTANT: To use SSL you must use PHP 5.1 or later, install openssl libs and use ssl:// within the host variable
  166. // IMPORTANT: To use SSL with PHP 5.6 you should set verify_peer, verify_peer_name and allow_self_signed
  167. //$imap_smtp_params = array('host' => 'ssl://localhost', 'port' => 465, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password');
  168. // If you are using IMAP_SMTP_METHOD = mail or sendmail and your sent messages are not correctly displayed you can change this to "\n".
  169. // BUT, it doesn't comply with RFC 2822 and will break if using smtp method
  170. define('MAIL_MIMEPART_CRLF', "\r\n");
  171. // A file containing file mime types->extension mappings.
  172. // SELINUX users: make sure the file has a security context accesible by your apache/php-fpm process
  173. define('SYSTEM_MIME_TYPES_MAPPING', '/etc/mime.types');
  174. // Use BackendCalDAV for Meetings. You cannot hope to get that functionality working without a caldav backend.
  175. define('IMAP_MEETING_USE_CALDAV', false);
  176. // If your IMAP server allows authenticating via GSSAPI, php-imap will not fall back properly to other authentication
  177. // methods and you will be unable to log in. Uncomment the following line to disable that authentication method.
  178. // Multiple methods can be specified as a comma-separated string.
  179. // define('IMAP_DISABLE_AUTHENTICATOR', 'GSSAPI');