Настройка почтовой системы. Веб интерфейс Roundcube

Опубликовано nekit - вс, 24/02/2013 - 12:43
  1. Основные термины
  2. Введение
  3. Структура таблиц в базе данных
  4. Агент доставки почты Dovecot
  5. Агент пересылки почты Exim
  6. Веб интерфейс Roundcube
  7. Заключение
  8. Список литературы
  9. Комментарии

5. Веб интерфейс Roundcube

Roundcube — это клиент для работы с электронной почтой с веб-интерфейсом, написанный на языке PHP с использованием CSS и XHTML и технологии AJAX. Roundсube предоставляет возможность работы с почтовыми ящиками по протоколам IMAP и SMTP. Для хранения своей служебной информации может использовать любую поддерживаемую базу данных (PostgreSQL, MySQL и т.д.). Позволяет подключать адресную книгу, хранящуюся в LDAP, а также возможно ведение своей адресной книги для каждого пользователя отдельно.

В данной конфигурации Roundcube используется, как основное средство доступа к почтовым ящикам и управления ими для пользователей почтовой системы. Roundcube имеет интерфейс для написания собственных плагинов, расширяющих его функциональность, что может оказаться очень полезным при необходимости. Также хорошим моментом является то, что в нем имеется плагин для управления фильтрами Sieve, совместимый с Dovecot.

5.1 Установка

Установка Roundcube ничем не отличается от установки другого софта из портов. При необходимости его можно установить руками в удобное для вас место, скачав дистрибутив с официального сайта. В системе портов он располагается здесь — /usr/ports/mail/roundcube.

После установки Roundcube необходимо создать базу данных, создать пользователя и дать ему права на созданную ранее базу данных. Далее необходимо создать структуру таблиц в базе данных, взять ее для своей базы данных можно в папке SQL (смотреть файл db.initial.sql, где db - ваша СУБД).

5.2 Настройка

Конфигурационные файлы Roundcube находятся в папке "config", относительно корня установки. Настройка Roundcube заключается в правке двух конфигурационных файлов: main.inc.php — основной конфигурационный файл и db.inc.php — здесь указываются параметры доступа к базе данных. Стоит отметить, что при использовании некоторых плагинов, может потребоваться правка конфигурационных файлов этих плагинов.

В файле db.inc.php я поправил всего одну строчку:
  1. $rcmail_config['db_dsnw'] = 'driver://user:pass@localhost/dbname';
Содержимое файла main.inc.php (переводить было лень, думаю, со временем переведется):
  1. <?php
  2.  
  3. /*
  4.  +-----------------------------------------------------------------------+
  5.  | Main configuration file                                               |
  6.  |                                                                       |
  7.  | This file is part of the Roundcube Webmail client                     |
  8.  | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
  9.  |                                                                       |
  10.  | Licensed under the GNU General Public License version 3 or            |
  11.  | any later version with exceptions for skins & plugins.                |
  12.  | See the README file for a full license statement.                     |
  13.  |                                                                       |
  14.  +-----------------------------------------------------------------------+
  15.  
  16. */
  17.  
  18. $rcmail_config = array();
  19.  
  20. // ----------------------------------
  21. // LOGGING/DEBUGGING
  22. // ----------------------------------
  23.  
  24. // system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
  25. $rcmail_config['debug_level'] = 1;
  26.  
  27. // log driver:  'syslog' or 'file'.
  28. $rcmail_config['log_driver'] = 'file';
  29.  
  30. // date format for log entries
  31. // (read http://php.net/manual/en/function.date.php for all format characters)  
  32. $rcmail_config['log_date_format'] = 'd-M-Y H:i:s O';
  33.  
  34. // Syslog ident string to use, if using the 'syslog' log driver.
  35. $rcmail_config['syslog_id'] = 'roundcube';
  36.  
  37. // Syslog facility to use, if using the 'syslog' log driver.
  38. // For possible values see installer or http://php.net/manual/en/function.openlog.php
  39. $rcmail_config['syslog_facility'] = LOG_USER;
  40.  
  41. // Log sent messages to <log_dir>/sendmail or to syslog
  42. $rcmail_config['smtp_log'] = true;
  43.  
  44. // Log successful logins to <log_dir>/userlogins or to syslog
  45. $rcmail_config['log_logins'] = false;
  46.  
  47. // Log session authentication errors to <log_dir>/session or to syslog
  48. $rcmail_config['log_session'] = false;
  49.  
  50. // Log SQL queries to <log_dir>/sql or to syslog
  51. $rcmail_config['sql_debug'] = false;
  52.  
  53. // Log IMAP conversation to <log_dir>/imap or to syslog
  54. $rcmail_config['imap_debug'] = false;
  55.  
  56. // Log LDAP conversation to <log_dir>/ldap or to syslog
  57. $rcmail_config['ldap_debug'] = false;
  58.  
  59. // Log SMTP conversation to <log_dir>/smtp or to syslog
  60. $rcmail_config['smtp_debug'] = false;
  61.  
  62. // ----------------------------------
  63. // IMAP
  64. // ----------------------------------
  65.  
  66. // the mail host chosen to perform the log-in
  67. // leave blank to show a textbox at login, give a list of hosts
  68. // to display a pulldown menu or set one host as string.
  69. // To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
  70. // Supported replacement variables:
  71. // %n - http hostname ($_SERVER['SERVER_NAME'])
  72. // %d - domain (http hostname without the first part)
  73. // %s - domain name after the '@' from e-mail address provided at login screen
  74. // For example %n = mail.domain.tld, %d = domain.tld
  75. $rcmail_config['default_host'] = 'localhost';
  76.  
  77. // TCP port used for IMAP connections
  78. $rcmail_config['default_port'] = 143;
  79.  
  80. // IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
  81. // best server supported one)
  82. $rcmail_config['imap_auth_type'] = 'PLAIN';
  83.  
  84. // If you know your imap's folder delimiter, you can specify it here.
  85. // Otherwise it will be determined automatically
  86. $rcmail_config['imap_delimiter'] = null;
  87.  
  88. // If IMAP server doesn't support NAMESPACE extension, but you're
  89. // using shared folders or personal root folder is non-empty, you'll need to
  90. // set these options. All can be strings or arrays of strings.
  91. // Folders need to be ended with directory separator, e.g. "INBOX."
  92. // (special directory "~" is an exception to this rule)
  93. // These can be used also to overwrite server's namespaces
  94. $rcmail_config['imap_ns_personal'] = null;
  95. $rcmail_config['imap_ns_other']    = null;
  96. $rcmail_config['imap_ns_shared']   = null;
  97.  
  98. // By default IMAP capabilities are readed after connection to IMAP server
  99. // In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
  100. // after login. Set to True if you've got this case.
  101. $rcmail_config['imap_force_caps'] = false;
  102.  
  103. // By default list of subscribed folders is determined using LIST-EXTENDED
  104. // extension if available. Some servers (dovecot 1.x) returns wrong results
  105. // for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225
  106. // Enable this option to force LSUB command usage instead.
  107. $rcmail_config['imap_force_lsub'] = false;
  108.  
  109. // Some server configurations (e.g. Courier) doesn't list folders in all namespaces
  110. // Enable this option to force listing of folders in all namespaces
  111. $rcmail_config['imap_force_ns'] = false;
  112.  
  113. // IMAP connection timeout, in seconds. Default: 0 (no limit)
  114. $rcmail_config['imap_timeout'] = 0;
  115.  
  116. // Optional IMAP authentication identifier to be used as authorization proxy
  117. $rcmail_config['imap_auth_cid'] = null;
  118.  
  119. // Optional IMAP authentication password to be used for imap_auth_cid
  120. $rcmail_config['imap_auth_pw'] = null;
  121.  
  122. // Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'.
  123. $rcmail_config['imap_cache'] = false;
  124.  
  125. // Enables messages cache. Only 'db' cache is supported.
  126. $rcmail_config['messages_cache'] = false;
  127.  
  128.  
  129. // ----------------------------------
  130. // SMTP
  131. // ----------------------------------
  132.  
  133. // SMTP server host (for sending mails).
  134. // To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
  135. // If left blank, the PHP mail() function is used
  136. // Supported replacement variables:
  137. // %h - user's IMAP hostname
  138. // %n - http hostname ($_SERVER['SERVER_NAME'])
  139. // %d - domain (http hostname without the first part)
  140. // %z - IMAP domain (IMAP hostname without the first part)
  141. // For example %n = mail.domain.tld, %d = domain.tld
  142. $rcmail_config['smtp_server'] = 'localhost';
  143.  
  144. // SMTP port (default is 25; use 587 for STARTTLS or 465 for the
  145. // deprecated SSL over SMTP (aka SMTPS))
  146. $rcmail_config['smtp_port'] = 25;
  147.  
  148. // SMTP username (if required) if you use %u as the username Roundcube
  149. // will use the current username for login
  150. $rcmail_config['smtp_user'] = '';
  151.  
  152. // SMTP password (if required) if you use %p as the password Roundcube
  153. // will use the current user's password for login
  154. $rcmail_config['smtp_pass'] = '';
  155.  
  156. // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
  157. // best server supported one)
  158. $rcmail_config['smtp_auth_type'] = 'PLAIN';
  159.  
  160. // Optional SMTP authentication identifier to be used as authorization proxy
  161. $rcmail_config['smtp_auth_cid'] = null;
  162.  
  163. // Optional SMTP authentication password to be used for smtp_auth_cid
  164. $rcmail_config['smtp_auth_pw'] = null;
  165.  
  166. // SMTP HELO host
  167. // Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages
  168. // Leave this blank and you will get the server variable 'server_name' or
  169. // localhost if that isn't defined.
  170. $rcmail_config['smtp_helo_host'] = '';
  171.  
  172. // SMTP connection timeout, in seconds. Default: 0 (no limit)
  173. $rcmail_config['smtp_timeout'] = 0;
  174.  
  175. // ----------------------------------
  176. // SYSTEM
  177. // ----------------------------------
  178.  
  179. // THIS OPTION WILL ALLOW THE INSTALLER TO RUN AND CAN EXPOSE SENSITIVE CONFIG DATA.
  180. // ONLY ENABLE IT IF YOU'RE REALLY SURE WHAT YOU'RE DOING!
  181. $rcmail_config['enable_installer'] = false;
  182.  
  183. // provide an URL where a user can get support for this Roundcube installation
  184. // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
  185. $rcmail_config['support_url'] = 'http://www.info-x.org/forum/index.html';
  186.  
  187. // replace Roundcube logo with this image
  188. // specify an URL relative to the document root of this Roundcube installation
  189. $rcmail_config['skin_logo'] = null;
  190.  
  191. // automatically create a new Roundcube user when log-in the first time.
  192. // a new user will be created once the IMAP login succeeds.
  193. // set to false if only registered users can use this service
  194. $rcmail_config['auto_create_user'] = true;
  195.  
  196. // use this folder to store log files (must be writeable for apache user)
  197. // This is used by the 'file' log driver.
  198. $rcmail_config['log_dir'] = 'logs/';
  199.  
  200. // use this folder to store temp files (must be writeable for apache user)
  201. $rcmail_config['temp_dir'] = 'temp/';
  202.  
  203. // lifetime of message cache
  204. // possible units: s, m, h, d, w
  205. $rcmail_config['message_cache_lifetime'] = '10d';
  206.  
  207. // enforce connections over https
  208. // with this option enabled, all non-secure connections will be redirected.
  209. // set the port for the ssl connection as value of this option if it differs from the default 443
  210. $rcmail_config['force_https'] = true;
  211.  
  212. // tell PHP that it should work as under secure connection
  213. // even if it doesn't recognize it as secure ($_SERVER['HTTPS'] is not set)
  214. // e.g. when you're running Roundcube behind a https proxy
  215. // this option is mutually exclusive to 'force_https' and only either one of them should be set to true.
  216. $rcmail_config['use_https'] = false;
  217.  
  218. // Allow browser-autocompletion on login form.
  219. // 0 - disabled, 1 - username and host only, 2 - username, host, password
  220. $rcmail_config['login_autocomplete'] = 0;
  221.  
  222. // Forces conversion of logins to lower case.
  223. // 0 - disabled, 1 - only domain part, 2 - domain and local part.
  224. // If users authentication is not case-sensitive this must be enabled.
  225. // After enabling it all user records need to be updated, e.g. with query:
  226. // UPDATE users SET username = LOWER(username);
  227. $rcmail_config['login_lc'] = 2;
  228.  
  229. // Includes should be interpreted as PHP files
  230. $rcmail_config['skin_include_php'] = false;
  231.  
  232. // display software version on login screen
  233. $rcmail_config['display_version'] = false;
  234.  
  235. // Session lifetime in minutes
  236. // must be greater than 'keep_alive'/60
  237. $rcmail_config['session_lifetime'] = 10;
  238.  
  239. // session domain: .example.org
  240. $rcmail_config['session_domain'] = '';
  241.  
  242. // session name. Default: 'roundcube_sessid'
  243. $rcmail_config['session_name'] = null;
  244.  
  245. // Backend to use for session storage. Can either be 'db' (default) or 'memcache'
  246. // If set to memcache, a list of servers need to be specified in 'memcache_hosts'
  247. // Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed
  248. $rcmail_config['session_storage'] = 'db';
  249.  
  250. // Use these hosts for accessing memcached
  251. // Define any number of hosts in the form of hostname:port or unix:///path/to/sock.file
  252. $rcmail_config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.12:11211', 'unix:///var/tmp/memcached.sock' );
  253.  
  254. // check client IP in session athorization
  255. $rcmail_config['ip_check'] = true;
  256.  
  257. // check referer of incoming requests
  258. $rcmail_config['referer_check'] = false;
  259.  
  260. // X-Frame-Options HTTP header value sent to prevent from Clickjacking.
  261. // Possible values: sameorigin|deny. Set to false in order to disable sending them
  262. $rcmail_config['x_frame_options'] = 'sameorigin';
  263.  
  264. // this key is used to encrypt the users imap password which is stored
  265. // in the session record (and the client cookie if remember password is enabled).
  266. // please provide a string of exactly 24 chars.
  267. $rcmail_config['des_key'] = 'rcmail-!24ByteDESkey*Str';
  268.  
  269. // Automatically add this domain to user names for login
  270. // Only for IMAP servers that require full e-mail addresses for login
  271. // Specify an array with 'host' => 'domain' values to support multiple hosts
  272. // Supported replacement variables:
  273. // %h - user's IMAP hostname
  274. // %n - http hostname ($_SERVER['SERVER_NAME'])
  275. // %d - domain (http hostname without the first part)
  276. // %z - IMAP domain (IMAP hostname without the first part)
  277. // For example %n = mail.domain.tld, %d = domain.tld
  278. $rcmail_config['username_domain'] = '';
  279.  
  280. // This domain will be used to form e-mail addresses of new users
  281. // Specify an array with 'host' => 'domain' values to support multiple hosts
  282. // Supported replacement variables:
  283. // %h - user's IMAP hostname
  284. // %n - http hostname ($_SERVER['SERVER_NAME'])
  285. // %d - domain (http hostname without the first part)
  286. // %z - IMAP domain (IMAP hostname without the first part)
  287. // For example %n = mail.domain.tld, %d = domain.tld
  288. $rcmail_config['mail_domain'] = '';
  289.  
  290. // Password charset.
  291. // Use it if your authentication backend doesn't support UTF-8.
  292. // Defaults to ISO-8859-1 for backward compatibility
  293. $rcmail_config['password_charset'] = 'ISO-8859-1';
  294.  
  295. // How many seconds must pass between emails sent by a user
  296. $rcmail_config['sendmail_delay'] = 0;
  297.  
  298. // Maximum number of recipients per message. Default: 0 (no limit)
  299. $rcmail_config['max_recipients'] = 10;
  300.  
  301. // Maximum allowednumber of members of an address group. Default: 0 (no limit)
  302. // If 'max_recipients' is set this value should be less or equal
  303. $rcmail_config['max_group_members'] = 0;
  304.  
  305. // add this user-agent to message headers when sending
  306. $rcmail_config['useragent'] = 'Roundcube Webmail/'.RCMAIL_VERSION;
  307.  
  308. // use this name to compose page titles
  309. $rcmail_config['product_name'] = 'www.info-x.org';
  310.  
  311. // try to load host-specific configuration
  312. // see http://trac.roundcube.net/wiki/Howto_Config for more details
  313. $rcmail_config['include_host_config'] = false;
  314.  
  315. // path to a text file which will be added to each sent message
  316. // paths are relative to the Roundcube root folder
  317. $rcmail_config['generic_message_footer'] = '';
  318.  
  319. // path to a text file which will be added to each sent HTML message
  320. // paths are relative to the Roundcube root folder
  321. $rcmail_config['generic_message_footer_html'] = '';
  322.  
  323. // add a received header to outgoing mails containing the creators IP and hostname
  324. $rcmail_config['http_received_header'] = false;
  325.  
  326. // Whether or not to encrypt the IP address and the host name
  327. // these could, in some circles, be considered as sensitive information;
  328. // however, for the administrator, these could be invaluable help
  329. // when tracking down issues.
  330. $rcmail_config['http_received_header_encrypt'] = false;
  331.  
  332. // This string is used as a delimiter for message headers when sending
  333. // a message via mail() function. Leave empty for auto-detection
  334. $rcmail_config['mail_header_delimiter'] = NULL;
  335.  
  336. // number of chars allowed for line when wrapping text.
  337. // text wrapping is done when composing/sending messages
  338. $rcmail_config['line_length'] = 72;
  339.  
  340. // send plaintext messages as format=flowed
  341. $rcmail_config['send_format_flowed'] = true;
  342.  
  343. // don't allow these settings to be overriden by the user
  344. $rcmail_config['dont_override'] = array();
  345.  
  346. // Set identities access level:
  347. // 0 - many identities with possibility to edit all params
  348. // 1 - many identities with possibility to edit all params but not email address
  349. // 2 - one identity with possibility to edit all params
  350. // 3 - one identity with possibility to edit all params but not email address
  351. $rcmail_config['identities_level'] = 0;
  352.  
  353. // Mimetypes supported by the browser.
  354. // attachments of these types will open in a preview window
  355. // either a comma-separated list or an array: 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/pdf'
  356. $rcmail_config['client_mimetypes'] = null;  # null == default
  357.  
  358. // mime magic database
  359. $rcmail_config['mime_magic'] = '/usr/share/misc/magic';
  360.  
  361. // path to imagemagick identify binary
  362. $rcmail_config['im_identify_path'] = null;
  363.  
  364. // path to imagemagick convert binary
  365. $rcmail_config['im_convert_path'] = null;
  366.  
  367. // maximum size of uploaded contact photos in pixel
  368. $rcmail_config['contact_photo_size'] = 160;
  369.  
  370. // Enable DNS checking for e-mail address validation
  371. $rcmail_config['email_dns_check'] = false;
  372.  
  373. // ----------------------------------
  374. // PLUGINS
  375. // ----------------------------------
  376.  
  377. // List of active plugins (in plugins/ directory)
  378. $rcmail_config['plugins'] = array('emoticons',
  379.                                   'jqueryui',
  380.                                   'managesieve',
  381.                                   'markasjunk',
  382.                                   'password',
  383.                                   'userinfo');
  384.  
  385. // ----------------------------------
  386. // USER INTERFACE
  387. // ----------------------------------
  388.  
  389. // default messages sort column. Use empty value for default server's sorting,
  390. // or 'arrival', 'date', 'subject', 'from', 'to', 'fromto', 'size', 'cc'
  391. $rcmail_config['message_sort_col'] = 'date';
  392.  
  393. // default messages sort order
  394. $rcmail_config['message_sort_order'] = 'DESC';
  395.  
  396. // These cols are shown in the message list. Available cols are:
  397. // subject, from, to, fromto, cc, replyto, date, size, status, flag, attachment, 'priority'
  398. $rcmail_config['list_cols'] = array('subject', 'status', 'fromto', 'date', 'size', 'flag', 'attachment');
  399.  
  400. // the default locale setting (leave empty for auto-detection)
  401. // RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
  402. $rcmail_config['language'] = 'ru_RU';
  403.  
  404. // use this format for date display (date or strftime format)
  405. $rcmail_config['date_format'] = 'Y-m-d';
  406.  
  407. // give this choice of date formats to the user to select from
  408. $rcmail_config['date_formats'] = array('Y-m-d', 'd-m-Y', 'Y/m/d', 'm/d/Y', 'd/m/Y', 'd.m.Y', 'j.n.Y');
  409.  
  410. // use this format for time display (date or strftime format)
  411. $rcmail_config['time_format'] = 'H:i';
  412.  
  413. // give this choice of time formats to the user to select from
  414. $rcmail_config['time_formats'] = array('G:i', 'H:i', 'g:i a', 'h:i A');
  415.  
  416. // use this format for short date display (derived from date_format and time_format)
  417. $rcmail_config['date_short'] = 'D H:i';
  418.  
  419. // use this format for detailed date/time formatting (derived from date_format and time_format)
  420. $rcmail_config['date_long'] = 'Y-m-d H:i';
  421.  
  422. // store draft message is this mailbox
  423. // leave blank if draft messages should not be stored
  424. // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
  425. $rcmail_config['drafts_mbox'] = 'Drafts';
  426.  
  427. // store spam messages in this mailbox
  428. // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
  429. $rcmail_config['junk_mbox'] = 'Junk';
  430.  
  431. // store sent message is this mailbox
  432. // leave blank if sent messages should not be stored
  433. // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
  434. $rcmail_config['sent_mbox'] = 'Sent';
  435.  
  436. // move messages to this folder when deleting them
  437. // leave blank if they should be deleted directly
  438. // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
  439. $rcmail_config['trash_mbox'] = 'Trash';
  440.  
  441. // display these folders separately in the mailbox list.
  442. // these folders will also be displayed with localized names
  443. // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
  444. $rcmail_config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
  445.  
  446. // automatically create the above listed default folders on first login
  447. $rcmail_config['create_default_folders'] = false;
  448.  
  449. // protect the default folders from renames, deletes, and subscription changes
  450. $rcmail_config['protect_default_folders'] = true;
  451.  
  452. // if in your system 0 quota means no limit set this option to true
  453. $rcmail_config['quota_zero_as_unlimited'] = false;
  454.  
  455. // Make use of the built-in spell checker. It is based on GoogieSpell.
  456. // Since Google only accepts connections over https your PHP installatation
  457. // requires to be compiled with Open SSL support
  458. $rcmail_config['enable_spellcheck'] = true;
  459.  
  460. // Enables spellchecker exceptions dictionary.
  461. // Setting it to 'shared' will make the dictionary shared by all users.
  462. $rcmail_config['spellcheck_dictionary'] = false;
  463.  
  464. // Set the spell checking engine. 'googie' is the default. 'pspell' is also available,
  465. // but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here.
  466. $rcmail_config['spellcheck_engine'] = 'googie';
  467.  
  468. // For a locally installed Nox Spell Server, please specify the URI to call it.
  469. // Get Nox Spell Server from http://orangoo.com/labs/?page_id=72
  470. // Leave empty to use the Google spell checking service, what means
  471. // that the message content will be sent to Google in order to check spelling
  472. $rcmail_config['spellcheck_uri'] = '';
  473.  
  474. // These languages can be selected for spell checking.
  475. // Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch');
  476. // Leave empty for default set of available language.
  477. $rcmail_config['spellcheck_languages'] = array('en' => 'English', 'ru' => 'Russian');
  478.  
  479. // Makes that words with all letters capitalized will be ignored (e.g. GOOGLE)
  480. $rcmail_config['spellcheck_ignore_caps'] = false;
  481.  
  482. // Makes that words with numbers will be ignored (e.g. g00gle)
  483. $rcmail_config['spellcheck_ignore_nums'] = false;
  484.  
  485. // Makes that words with symbols will be ignored (e.g. g@@gle)
  486. $rcmail_config['spellcheck_ignore_syms'] = false;
  487.  
  488. // Use this char/string to separate recipients when composing a new message
  489. $rcmail_config['recipients_separator'] = ',';
  490.  
  491. // don't let users set pagesize to more than this value if set
  492. $rcmail_config['max_pagesize'] = 200;
  493.  
  494. // Minimal value of user's 'keep_alive' setting (in seconds)
  495. // Must be less than 'session_lifetime'
  496. $rcmail_config['min_keep_alive'] = 60;
  497.  
  498. // Enables files upload indicator. Requires APC installed and enabled apc.rfc1867 option.
  499. // By default refresh time is set to 1 second. You can set this value to true
  500. // or any integer value indicating number of seconds.
  501. $rcmail_config['upload_progress'] = false;
  502.  
  503. // Specifies for how many seconds the Undo button will be available
  504. // after object delete action. Currently used with supporting address book sources.
  505. // Setting it to 0, disables the feature.
  506. $rcmail_config['undo_timeout'] = 0;
  507.  
  508. // ----------------------------------
  509. // ADDRESSBOOK SETTINGS
  510. // ----------------------------------
  511.  
  512. // This indicates which type of address book to use. Possible choises:
  513. // 'sql' (default) and 'ldap'.
  514. // If set to 'ldap' then it will look at using the first writable LDAP
  515. // address book as the primary address book and it will not display the
  516. // SQL address book in the 'Address Book' view.
  517. $rcmail_config['address_book_type'] = 'sql';
  518.  
  519. // In order to enable public ldap search, configure an array like the Verisign
  520. // example further below. if you would like to test, simply uncomment the example.
  521. // Array key must contain only safe characters, ie. a-zA-Z0-9_
  522. $rcmail_config['ldap_public'] = array();
  523.  
  524. // If you are going to use LDAP for individual address books, you will need to
  525. // set 'user_specific' to true and use the variables to generate the appropriate DNs to access it.
  526. //
  527. // The recommended directory structure for LDAP is to store all the address book entries
  528. // under the users main entry, e.g.:
  529. //
  530. //  o=root
  531. //   ou=people
  532. //    uid=user@domain
  533. //  mail=contact@contactdomain
  534. //
  535. // So the base_dn would be uid=%fu,ou=people,o=root
  536. // The bind_dn would be the same as based_dn or some super user login.
  537. /*
  538.  * example config for Verisign directory
  539.  *
  540. $rcmail_config['ldap_public']['Verisign'] = array(
  541.   'name'          => 'Verisign.com',
  542.   // Replacement variables supported in host names:
  543.   // %h - user's IMAP hostname
  544.   // %n - http hostname ($_SERVER['SERVER_NAME'])
  545.   // %d - domain (http hostname without the first part)
  546.   // %z - IMAP domain (IMAP hostname without the first part)
  547.   // For example %n = mail.domain.tld, %d = domain.tld
  548.   'hosts'         => array('directory.verisign.com'),
  549.   'port'          => 389,
  550.   'use_tls'       => false,
  551.   'ldap_version'  => 3,       // using LDAPv3
  552.   'user_specific' => false,   // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
  553.   // %fu - The full username provided, assumes the username is an email
  554.   //       address, uses the username_domain value if not an email address.
  555.   // %u  - The username prior to the '@'.
  556.   // %d  - The domain name after the '@'.
  557.   // %dc - The domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
  558.   // %dn - DN found by ldap search when search_filter/search_base_dn are used
  559.   'base_dn'       => '',
  560.   'bind_dn'       => '',
  561.   'bind_pass'     => '',
  562.   // It's possible to bind for an individual address book
  563.   // The login name is used to search for the DN to bind with
  564.   'search_base_dn' => '',
  565.   'search_filter'  => '',   // e.g. '(&(objectClass=posixAccount)(uid=%u))'
  566.   // DN and password to bind as before searching for bind DN, if anonymous search is not allowed
  567.   'search_bind_dn' => '',
  568.   'search_bind_pw' => '',
  569.   // Default for %dn variable if search doesn't return DN value
  570.   'search_dn_default' => '',
  571.   // Optional authentication identifier to be used as SASL authorization proxy
  572.   // bind_dn need to be empty
  573.   'auth_cid'       => '',
  574.   // SASL authentication method (for proxy auth), e.g. DIGEST-MD5
  575.   'auth_method'    => '',
  576.   // Indicates if the addressbook shall be hidden from the list.
  577.   // With this option enabled you can still search/view contacts.
  578.   'hidden'        => false,
  579.   // Indicates if the addressbook shall not list contacts but only allows searching.
  580.   'searchonly'    => false,
  581.   // Indicates if we can write to the LDAP directory or not.
  582.   // If writable is true then these fields need to be populated:
  583.   // LDAP_Object_Classes, required_fields, LDAP_rdn
  584.   'writable'       => false,
  585.   // To create a new contact these are the object classes to specify
  586.   // (or any other classes you wish to use).
  587.   'LDAP_Object_Classes' => array('top', 'inetOrgPerson'),
  588.   // The RDN field that is used for new entries, this field needs
  589.   // to be one of the search_fields, the base of base_dn is appended
  590.   // to the RDN to insert into the LDAP directory.
  591.   'LDAP_rdn'       => 'cn',
  592.   // The required fields needed to build a new contact as required by
  593.   // the object classes (can include additional fields not required by the object classes).
  594.   'required_fields' => array('cn', 'sn', 'mail'),
  595.   'search_fields'   => array('mail', 'cn'),  // fields to search in
  596.   // mapping of contact fields to directory attributes
  597.   //   for every attribute one can specify the number of values (limit) allowed.
  598.   //   default is 1, a wildcard * means unlimited
  599.   'fieldmap' => array(
  600.     // Roundcube  => LDAP:limit
  601.     'name'        => 'cn',
  602.     'surname'     => 'sn',
  603.     'firstname'   => 'givenName',
  604.     'title'       => 'title',
  605.     'email'       => 'mail:*',
  606.     'phone:home'  => 'homePhone',
  607.     'phone:work'  => 'telephoneNumber',
  608.     'phone:mobile' => 'mobile',
  609.     'phone:pager' => 'pager',
  610.     'street'      => 'street',
  611.     'zipcode'     => 'postalCode',
  612.     'region'      => 'st',
  613.     'locality'    => 'l',
  614. // if you uncomment country, you need to modify 'sub_fields' above
  615. //    'country'     => 'c',
  616.     'department'  => 'departmentNumber',
  617.     'notes'       => 'description',
  618. // these currently don't work:
  619. //    'phone:workfax' => 'facsimileTelephoneNumber',
  620. //    'photo'        => 'jpegPhoto',
  621. //    'organization' => 'o',
  622. //    'manager'      => 'manager',
  623. //    'assistant'    => 'secretary',
  624.   ),
  625.   // Map of contact sub-objects (attribute name => objectClass(es)), e.g. 'c' => 'country'
  626.   'sub_fields' => array(),
  627.   'sort'          => 'cn',    // The field to sort the listing by.
  628.   'scope'         => 'sub',   // search mode: sub|base|list
  629.   'filter'        => '(objectClass=inetOrgPerson)',      // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
  630.   'fuzzy_search'  => true,    // server allows wildcard search
  631.   'vlv'           => false,   // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
  632.   'numsub_filter' => '(objectClass=organizationalUnit)',   // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting
  633.   'sizelimit'     => '0',     // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
  634.   'timelimit'     => '0',     // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
  635.   'referrals'     => true|false,  // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups
  636.  
  637.   // definition for contact groups (uncomment if no groups are supported)
  638.   // for the groups base_dn, the user replacements %fu, %u, $d and %dc work as for base_dn (see above)
  639.   // if the groups base_dn is empty, the contact base_dn is used for the groups as well
  640.   // -> in this case, assure that groups and contacts are separated due to the concernig filters!
  641.   'groups'        => array(
  642.     'base_dn'     => '',
  643.     'scope'       => 'sub',   // search mode: sub|base|list
  644.     'filter'      => '(objectClass=groupOfNames)',
  645.     'object_classes' => array("top", "groupOfNames"),
  646.     'member_attr'  => 'member',   // name of the member attribute, e.g. uniqueMember
  647.     'name_attr'    => 'cn',       // attribute to be used as group name
  648.   ),
  649. );
  650. */
  651.  
  652. // An ordered array of the ids of the addressbooks that should be searched
  653. // when populating address autocomplete fields server-side. ex: array('sql','Verisign');
  654. $rcmail_config['autocomplete_addressbooks'] = array('sql');
  655.  
  656. // The minimum number of characters required to be typed in an autocomplete field
  657. // before address books will be searched. Most useful for LDAP directories that
  658. // may need to do lengthy results building given overly-broad searches
  659. $rcmail_config['autocomplete_min_length'] = 1;
  660.  
  661. // Number of parallel autocomplete requests.
  662. // If there's more than one address book, n parallel (async) requests will be created,
  663. // where each request will search in one address book. By default (0), all address
  664. // books are searched in one request.
  665. $rcmail_config['autocomplete_threads'] = 0;
  666.  
  667. // Max. numer of entries in autocomplete popup. Default: 15.
  668. $rcmail_config['autocomplete_max'] = 15;
  669.  
  670. // show address fields in this order
  671. // available placeholders: {street}, {locality}, {zipcode}, {country}, {region}
  672. $rcmail_config['address_template'] = '{street}<br/>{locality} {zipcode}<br/>{country} {region}';
  673.  
  674. // Matching mode for addressbook search (including autocompletion)
  675. // 0 - partial (*abc*), default
  676. // 1 - strict (abc)
  677. // 2 - prefix (abc*)
  678. // Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
  679. $rcmail_config['addressbook_search_mode'] = 0;
  680.  
  681. // ----------------------------------
  682. // USER PREFERENCES
  683. // ----------------------------------
  684.  
  685. // Use this charset as fallback for message decoding
  686. $rcmail_config['default_charset'] = 'ISO-8859-1';
  687.  
  688. // skin name: folder from skins/
  689. $rcmail_config['skin'] = 'larry';
  690.  
  691. // show up to X items in messages list view
  692. $rcmail_config['mail_pagesize'] = 50;
  693.  
  694. // show up to X items in contacts list view
  695. $rcmail_config['addressbook_pagesize'] = 50;
  696.  
  697. // sort contacts by this col (preferably either one of name, firstname, surname)
  698. $rcmail_config['addressbook_sort_col'] = 'surname';
  699.  
  700. // the way how contact names are displayed in the list
  701. // 0: display name
  702. // 1: (prefix) firstname middlename surname (suffix)
  703. // 2: (prefix) surname firstname middlename (suffix)
  704. // 3: (prefix) surname, firstname middlename (suffix)
  705. $rcmail_config['addressbook_name_listing'] = 0;
  706.  
  707. // use this timezone to display date/time
  708. // valid timezone identifers are listed here: php.net/manual/en/timezones.php
  709. // 'auto' will use the browser's timezone settings
  710. $rcmail_config['timezone'] = 'auto';
  711.  
  712. // prefer displaying HTML messages
  713. $rcmail_config['prefer_html'] = true;
  714.  
  715. // display remote inline images
  716. // 0 - Never, always ask
  717. // 1 - Ask if sender is not in address book
  718. // 2 - Always show inline images
  719. $rcmail_config['show_images'] = 0;
  720.  
  721. // compose html formatted messages by default
  722. // 0 - never, 1 - always, 2 - on reply to HTML message only
  723. $rcmail_config['htmleditor'] = 0;
  724.  
  725. // show pretty dates as standard
  726. $rcmail_config['prettydate'] = true;
  727.  
  728. // save compose message every 300 seconds (5min)
  729. $rcmail_config['draft_autosave'] = 300;
  730.  
  731. // default setting if preview pane is enabled
  732. $rcmail_config['preview_pane'] = false;
  733.  
  734. // Mark as read when viewed in preview pane (delay in seconds)
  735. // Set to -1 if messages in preview pane should not be marked as read
  736. $rcmail_config['preview_pane_mark_read'] = 0;
  737.  
  738. // Clear Trash on logout
  739. $rcmail_config['logout_purge'] = false;
  740.  
  741. // Compact INBOX on logout
  742. $rcmail_config['logout_expunge'] = false;
  743.  
  744. // Display attached images below the message body
  745. $rcmail_config['inline_images'] = true;
  746.  
  747. // Encoding of long/non-ascii attachment names:
  748. // 0 - Full RFC 2231 compatible
  749. // 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
  750. // 2 - Full 2047 compatible
  751. $rcmail_config['mime_param_folding'] = 1;
  752.  
  753. // Set true if deleted messages should not be displayed
  754. // This will make the application run slower
  755. $rcmail_config['skip_deleted'] = false;
  756.  
  757. // Set true to Mark deleted messages as read as well as deleted
  758. // False means that a message's read status is not affected by marking it as deleted
  759. $rcmail_config['read_when_deleted'] = true;
  760.  
  761. // Set to true to never delete messages immediately
  762. // Use 'Purge' to remove messages marked as deleted
  763. $rcmail_config['flag_for_deletion'] = false;
  764.  
  765. // Default interval for keep-alive/check-recent requests (in seconds)
  766. // Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
  767. $rcmail_config['keep_alive'] = 60;
  768.  
  769. // If true all folders will be checked for recent messages
  770. $rcmail_config['check_all_folders'] = false;
  771.  
  772. // If true, after message delete/move, the next message will be displayed
  773. $rcmail_config['display_next'] = false;
  774.  
  775. // 0 - Do not expand threads
  776. // 1 - Expand all threads automatically
  777. // 2 - Expand only threads with unread messages
  778. $rcmail_config['autoexpand_threads'] = 0;
  779.  
  780. // When replying place cursor above original message (top posting)
  781. $rcmail_config['top_posting'] = false;
  782.  
  783. // When replying strip original signature from message
  784. $rcmail_config['strip_existing_sig'] = true;
  785.  
  786. // Show signature:
  787. // 0 - Never
  788. // 1 - Always
  789. // 2 - New messages only
  790. // 3 - Forwards and Replies only
  791. $rcmail_config['show_sig'] = 1;
  792.  
  793. // When replying or forwarding place sender's signature above existing message
  794. $rcmail_config['sig_above'] = false;
  795.  
  796. // Use MIME encoding (quoted-printable) for 8bit characters in message body
  797. $rcmail_config['force_7bit'] = false;
  798.  
  799. // Defaults of the search field configuration.
  800. // The array can contain a per-folder list of header fields which should be considered when searching
  801. // The entry with key '*' stands for all folders which do not have a specific list set.
  802. // Please note that folder names should to be in sync with $rcmail_config['default_folders']
  803. $rcmail_config['search_mods'] = null;  // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
  804.  
  805. // Defaults of the addressbook search field configuration.
  806. $rcmail_config['addressbook_search_mods'] = null;  // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
  807.  
  808. // 'Delete always'
  809. // This setting reflects if mail should be always deleted
  810. // when moving to Trash fails. This is necessary in some setups
  811. // when user is over quota and Trash is included in the quota.
  812. $rcmail_config['delete_always'] = false;
  813.  
  814. // Directly delete messages in Junk instead of moving to Trash
  815. $rcmail_config['delete_junk'] = false;
  816.  
  817. // Behavior if a received message requests a message delivery notification (read receipt)
  818. // 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
  819. // 3 = send automatically if sender is in addressbook, otherwise ask the user
  820. // 4 = send automatically if sender is in addressbook, otherwise ignore
  821. $rcmail_config['mdn_requests'] = 0;
  822.  
  823. // Return receipt checkbox default state
  824. $rcmail_config['mdn_default'] = 0;
  825.  
  826. // Delivery Status Notification checkbox default state
  827. $rcmail_config['dsn_default'] = 0;
  828.  
  829. // Place replies in the folder of the message being replied to
  830. $rcmail_config['reply_same_folder'] = false;
  831.  
  832. // Sets default mode of Forward feature to "forward as attachment"
  833. $rcmail_config['forward_attachment'] = false;
  834.  
  835. // Defines address book (internal index) to which new contacts will be added
  836. // By default it is the first writeable addressbook.
  837. // Note: Use '0' for built-in address book.
  838. $rcmail_config['default_addressbook'] = null;
  839.  
  840. // Enables spell checking before sending a message.
  841. $rcmail_config['spellcheck_before_send'] = false;
  842.  
  843. // Skip alternative email addresses in autocompletion (show one address per contact)
  844. $rcmail_config['autocomplete_single'] = false;
  845.  
  846. // Default font for composed HTML message.
  847. // Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
  848. // Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
  849. $rcmail_config['default_font'] = '';
  850.  
  851. // end of config file
Для работы плагина managesieve нужно нарисовать конфиг, который должен лежать тут — plugins/managesieve/config.inc.php:
  1. <?php
  2.  
  3. // managesieve server port
  4. $rcmail_config['managesieve_port'] = 4190;
  5.  
  6. // managesieve server address, default is localhost.
  7. // Replacement variables supported in host name:
  8. // %h - user's IMAP hostname
  9. // %n - http hostname ($_SERVER['SERVER_NAME'])
  10. // %d - domain (http hostname without the first part)
  11. // For example %n = mail.domain.tld, %d = domain.tld
  12. $rcmail_config['managesieve_host'] = 'localhost';
  13.  
  14. // authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL
  15. // or none. Optional, defaults to best method supported by server.
  16. $rcmail_config['managesieve_auth_type'] = 'PLAIN';
  17.  
  18. // Optional managesieve authentication identifier to be used as authorization proxy.
  19. // Authenticate as a different user but act on behalf of the logged in user.
  20. // Works with PLAIN and DIGEST-MD5 auth.
  21. $rcmail_config['managesieve_auth_cid'] = null;
  22.  
  23. // Optional managesieve authentication password to be used for imap_auth_cid
  24. $rcmail_config['managesieve_auth_pw'] = null;
  25.  
  26. // use or not TLS for managesieve server connection
  27. // it's because I've problems with TLS and dovecot's managesieve plugin
  28. // and it's not needed on localhost
  29. $rcmail_config['managesieve_usetls'] = false;
  30.  
  31. // default contents of filters script (eg. default spam filter)
  32. $rcmail_config['managesieve_default'] = '/etc/dovecot/sieve/global';
  33.  
  34. // The name of the script which will be used when there's no user script
  35. $rcmail_config['managesieve_script_name'] = 'managesieve';
  36.  
  37. // Sieve RFC says that we should use UTF-8 endcoding for mailbox names,
  38. // but some implementations does not covert UTF-8 to modified UTF-7.
  39. // Defaults to UTF7-IMAP
  40. $rcmail_config['managesieve_mbox_encoding'] = 'UTF-8';
  41.  
  42. // I need this because my dovecot (with listescape plugin) uses
  43. // ':' delimiter, but creates folders with dot delimiter
  44. $rcmail_config['managesieve_replace_delimiter'] = '';
  45.  
  46. // disabled sieve extensions (body, copy, date, editheader, encoded-character,
  47. // envelope, environment, ereject, fileinto, ihave, imap4flags, index,
  48. // mailbox, mboxmetadata, regex, reject, relational, servermetadata,
  49. // spamtest, spamtestplus, subaddress, vacation, variables, virustest, etc.
  50. // Note: not all extensions are implemented
  51. $rcmail_config['managesieve_disabled_extensions'] = array();
  52.  
  53. // Enables debugging of conversation with sieve server. Logs it into <log_dir>/sieve
  54. $rcmail_config['managesieve_debug'] = false;
  55.  
  56. // Enables features described in http://wiki.kolab.org/KEP:14
  57. $rcmail_config['managesieve_kolab_master'] = false;
  58.  
  59. // Script name extension used for scripts including. Dovecot uses '.sieve',
  60. // Cyrus uses '.siv'. Doesn't matter if you have managesieve_kolab_master disabled.
  61. $rcmail_config['managesieve_filename_extension'] = '.sieve';
  62.  
  63. // List of reserved script names (without extension).
  64. // Scripts listed here will be not presented to the user.
  65. $rcmail_config['managesieve_filename_exceptions'] = array();
  66.  
  67. ?>
Также конфиг нужно нарисовать для плагина password (конфиг должен лежать тут — plugins/password/config.inc.php):
  1. <?php
  2.  
  3. // Password Plugin options
  4. // -----------------------
  5. // A driver to use for password change. Default: "sql".
  6. // See README file for list of supported driver names.
  7. $rcmail_config['password_driver'] = 'sql';
  8.  
  9. // Determine whether current password is required to change password.
  10. // Default: false.
  11. $rcmail_config['password_confirm_current'] = true;
  12.  
  13. // Require the new password to be a certain length.
  14. // set to blank to allow passwords of any length
  15. $rcmail_config['password_minimum_length'] = 3;
  16.  
  17. // Require the new password to contain a letter and punctuation character
  18. // Change to false to remove this check.
  19. $rcmail_config['password_require_nonalpha'] = false;
  20.  
  21. // Enables logging of password changes into logs/password
  22. $rcmail_config['password_log'] = false;
  23.  
  24. // Comma-separated list of login exceptions for which password change
  25. // will be not available (no Password tab in Settings)
  26. $rcmail_config['password_login_exceptions'] = null;
  27.  
  28.  
  29. // SQL Driver options
  30. // ------------------
  31. // PEAR database DSN for performing the query. By default
  32. // Roundcube DB settings are used.
  33. $rcmail_config['password_db_dsn'] = '';
  34.  
  35. // The SQL query used to change the password.
  36. // The query can contain the following macros that will be expanded as follows:
  37. //      %p is replaced with the plaintext new password
  38. //      %c is replaced with the crypt version of the new password, MD5 if available
  39. //         otherwise DES.
  40. //      %D is replaced with the dovecotpw-crypted version of the new password
  41. //      %o is replaced with the password before the change
  42. //      %n is replaced with the hashed version of the new password
  43. //      %q is replaced with the hashed password before the change
  44. //      %h is replaced with the imap host (from the session info)
  45. //      %u is replaced with the username (from the session info)
  46. //      %l is replaced with the local part of the username
  47. //         (in case the username is an email address)
  48. //      %d is replaced with the domain part of the username
  49. //         (in case the username is an email address)
  50. // Escaping of macros is handled by this module.
  51. // Default: "SELECT update_passwd(%c, %u)"
  52. //$rcmail_config['password_query'] = 'SELECT update_passwd(%c, %u)';
  53. $rcmail_config['password_query'] = '
  54.   UPDATE "users_tb" SET
  55.     "passwd" = MD5(%p)
  56.   WHERE
  57.     "username" = %l AND
  58.     "passwd" = MD5(%o) AND
  59.     "domain_id" = (SELECT "id" FROM "domains_tb" WHERE "domainname" = %d LIMIT 1);
  60. ';
  61.  
  62.  
  63. // By default domains in variables are using unicode.
  64. // Enable this option to use punycoded names
  65. $rcmail_config['password_idn_ascii'] = false;
  66.  
  67. // Path for dovecotpw (if not in $PATH)
  68. // $rcmail_config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw';
  69.  
  70. // Dovecot method (dovecotpw -s 'method')
  71. $rcmail_config['password_dovecotpw_method'] = 'CRAM-MD5';
  72.  
  73. // Enables use of password with crypt method prefix in %D, e.g. {MD5}$1$LUiMYWqx$fEkg/ggr/L6Mb2X7be4i1/
  74. $rcmail_config['password_dovecotpw_with_method'] = false;
  75.  
  76. // Using a password hash for %n and %q variables.
  77. // Determine which hashing algorithm should be used to generate
  78. // the hashed new and current password for using them within the
  79. // SQL query. Requires PHP's 'hash' extension.
  80. $rcmail_config['password_hash_algorithm'] = 'sha1';
  81.  
  82. // You can also decide whether the hash should be provided
  83. // as hex string or in base64 encoded format.
  84. $rcmail_config['password_hash_base64'] = false;
  85.  
  86.  
  87. // Poppassd Driver options
  88. // -----------------------
  89. // The host which changes the password
  90. $rcmail_config['password_pop_host'] = 'localhost';
  91.  
  92. // TCP port used for poppassd connections
  93. $rcmail_config['password_pop_port'] = 106;
  94.  
  95.  
  96. // SASL Driver options
  97. // -------------------
  98. // Additional arguments for the saslpasswd2 call
  99. $rcmail_config['password_saslpasswd_args'] = '';
  100.  
  101.  
  102. // LDAP and LDAP_SIMPLE Driver options
  103. // -----------------------------------
  104. // LDAP server name to connect to.
  105. // You can provide one or several hosts in an array in which case the hosts are tried from left to right.
  106. // Exemple: array('ldap1.exemple.com', 'ldap2.exemple.com');
  107. // Default: 'localhost'
  108. $rcmail_config['password_ldap_host'] = 'localhost';
  109.  
  110. // LDAP server port to connect to
  111. // Default: '389'
  112. $rcmail_config['password_ldap_port'] = '389';
  113.  
  114. // TLS is started after connecting
  115. // Using TLS for password modification is recommanded.
  116. // Default: false
  117. $rcmail_config['password_ldap_starttls'] = false;
  118.  
  119. // LDAP version
  120. // Default: '3'
  121. $rcmail_config['password_ldap_version'] = '3';
  122.  
  123. // LDAP base name (root directory)
  124. // Exemple: 'dc=exemple,dc=com'
  125. $rcmail_config['password_ldap_basedn'] = 'dc=exemple,dc=com';
  126.  
  127. // LDAP connection method
  128. // There is two connection method for changing a user's LDAP password.
  129. // 'user': use user credential (recommanded, require password_confirm_current=true)
  130. // 'admin': use admin credential (this mode require password_ldap_adminDN and password_ldap_adminPW)
  131. // Default: 'user'
  132. $rcmail_config['password_ldap_method'] = 'user';
  133.  
  134. // LDAP Admin DN
  135. // Used only in admin connection mode
  136. // Default: null
  137. $rcmail_config['password_ldap_adminDN'] = null;
  138.  
  139. // LDAP Admin Password
  140. // Used only in admin connection mode
  141. // Default: null
  142. $rcmail_config['password_ldap_adminPW'] = null;
  143.  
  144. // LDAP user DN mask
  145. // The user's DN is mandatory and as we only have his login,
  146. // we need to re-create his DN using a mask
  147. // '%login' will be replaced by the current roundcube user's login
  148. // '%name' will be replaced by the current roundcube user's name part
  149. // '%domain' will be replaced by the current roundcube user's domain part
  150. // '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
  151. // Exemple: 'uid=%login,ou=people,dc=exemple,dc=com'
  152. $rcmail_config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com';
  153.  
  154. // LDAP search DN
  155. // The DN roundcube should bind with to find out user's DN
  156. // based on his login. Note that you should comment out the default
  157. // password_ldap_userDN_mask setting for this to take effect.
  158. // Use this if you cannot specify a general template for user DN with
  159. // password_ldap_userDN_mask. You need to perform a search based on
  160. // users login to find his DN instead. A common reason might be that
  161. // your users are placed under different ou's like engineering or
  162. // sales which cannot be derived from their login only.
  163. $rcmail_config['password_ldap_searchDN'] = 'cn=roundcube,ou=services,dc=example,dc=com';
  164.  
  165. // LDAP search password
  166. // If password_ldap_searchDN is set, the password to use for
  167. // binding to search for user's DN. Note that you should comment out the default
  168. // password_ldap_userDN_mask setting for this to take effect.
  169. // Warning: Be sure to set approperiate permissions on this file so this password
  170. // is only accesible to roundcube and don't forget to restrict roundcube's access to
  171. // your directory as much as possible using ACLs. Should this password be compromised
  172. // you want to minimize the damage.
  173. $rcmail_config['password_ldap_searchPW'] = 'secret';
  174.  
  175. // LDAP search base
  176. // If password_ldap_searchDN is set, the base to search in using the filter below.
  177. // Note that you should comment out the default password_ldap_userDN_mask setting
  178. // for this to take effect.
  179. $rcmail_config['password_ldap_search_base'] = 'ou=people,dc=example,dc=com';
  180.  
  181. // LDAP search filter
  182. // If password_ldap_searchDN is set, the filter to use when
  183. // searching for user's DN. Note that you should comment out the default
  184. // password_ldap_userDN_mask setting for this to take effect.
  185. // '%login' will be replaced by the current roundcube user's login
  186. // '%name' will be replaced by the current roundcube user's name part
  187. // '%domain' will be replaced by the current roundcube user's domain part
  188. // '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
  189. // Example: '(uid=%login)'
  190. // Example: '(&(objectClass=posixAccount)(uid=%login))'
  191. $rcmail_config['password_ldap_search_filter'] = '(uid=%login)';
  192.  
  193. // LDAP password hash type
  194. // Standard LDAP encryption type which must be one of: crypt,
  195. // ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
  196. // Please note that most encodage types require external libraries
  197. // to be included in your PHP installation, see function hashPassword in drivers/ldap.php for more info.
  198. // Default: 'crypt'
  199. $rcmail_config['password_ldap_encodage'] = 'crypt';
  200.  
  201. // LDAP password attribute
  202. // Name of the ldap's attribute used for storing user password
  203. // Default: 'userPassword'
  204. $rcmail_config['password_ldap_pwattr'] = 'userPassword';
  205.  
  206. // LDAP password force replace
  207. // Force LDAP replace in cases where ACL allows only replace not read
  208. // See http://pear.php.net/package/Net_LDAP2/docs/latest/Net_LDAP2/Net_LDAP2_Entry.html#methodreplace
  209. // Default: true
  210. $rcmail_config['password_ldap_force_replace'] = true;
  211.  
  212. // LDAP Password Last Change Date
  213. // Some places use an attribute to store the date of the last password change
  214. // The date is meassured in "days since epoch" (an integer value)
  215. // Whenever the password is changed, the attribute will be updated if set (e.g. shadowLastChange)
  216. $rcmail_config['password_ldap_lchattr'] = '';
  217.  
  218. // LDAP Samba password attribute, e.g. sambaNTPassword
  219. // Name of the LDAP's Samba attribute used for storing user password
  220. $rcmail_config['password_ldap_samba_pwattr'] = '';
  221.  
  222. // LDAP Samba Password Last Change Date attribute, e.g. sambaPwdLastSet
  223. // Some places use an attribute to store the date of the last password change
  224. // The date is meassured in "seconds since epoch" (an integer value)
  225. // Whenever the password is changed, the attribute will be updated if set
  226. $rcmail_config['password_ldap_samba_lchattr'] = '';
  227.  
  228.  
  229. // DirectAdmin Driver options
  230. // --------------------------
  231. // The host which changes the password
  232. // Use 'ssl://host' instead of 'tcp://host' when running DirectAdmin over SSL.
  233. // The host can contain the following macros that will be expanded as follows:
  234. //     %h is replaced with the imap host (from the session info)
  235. //     %d is replaced with the domain part of the username (if the username is an email)
  236. $rcmail_config['password_directadmin_host'] = 'tcp://localhost';
  237.  
  238. // TCP port used for DirectAdmin connections
  239. $rcmail_config['password_directadmin_port'] = 2222;
  240.  
  241.  
  242. // vpopmaild Driver options
  243. // -----------------------
  244. // The host which changes the password
  245. $rcmail_config['password_vpopmaild_host'] = 'localhost';
  246.  
  247. // TCP port used for vpopmaild connections
  248. $rcmail_config['password_vpopmaild_port'] = 89;
  249.  
  250.  
  251. // cPanel Driver options
  252. // --------------------------
  253. // The cPanel Host name
  254. $rcmail_config['password_cpanel_host'] = 'host.domain.com';
  255.  
  256. // The cPanel admin username
  257. $rcmail_config['password_cpanel_username'] = 'username';
  258.  
  259. // The cPanel admin password
  260. $rcmail_config['password_cpanel_password'] = 'password';
  261.  
  262. // The cPanel port to use
  263. $rcmail_config['password_cpanel_port'] = 2082;
  264.  
  265. // Using ssl for cPanel connections?
  266. $rcmail_config['password_cpanel_ssl'] = true;
  267.  
  268. // The cPanel theme in use
  269. $rcmail_config['password_cpanel_theme'] = 'x';
  270.  
  271.  
  272. // XIMSS (Communigate server) Driver options
  273. // -----------------------------------------
  274. // Host name of the Communigate server
  275. $rcmail_config['password_ximss_host'] = 'mail.example.com';
  276.  
  277. // XIMSS port on Communigate server
  278. $rcmail_config['password_ximss_port'] = 11024;
  279.  
  280.  
  281. // chpasswd Driver options
  282. // ---------------------
  283. // Command to use
  284. $rcmail_config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';
  285.  
  286.  
  287. // XMail Driver options
  288. // ---------------------
  289. $rcmail_config['xmail_host'] = 'localhost';
  290. $rcmail_config['xmail_user'] = 'YourXmailControlUser';
  291. $rcmail_config['xmail_pass'] = 'YourXmailControlPass';
  292. $rcmail_config['xmail_port'] = 6017;
  293.  
  294.  
  295. // hMail Driver options
  296. // -----------------------
  297. // Remote hMailServer configuration
  298. // true:  HMailserver is on a remote box (php.ini: com.allow_dcom = true)
  299. // false: Hmailserver is on same box as PHP
  300. $rcmail_config['hmailserver_remote_dcom'] = false;
  301. // Windows credentials
  302. $rcmail_config['hmailserver_server'] = array(
  303.     'Server' => 'localhost', // hostname or ip address
  304.     'Username' => 'administrator', // windows username
  305.     'Password' => 'password' // windows user password
  306. );
  307.  
  308.  
  309. // Virtualmin Driver options
  310. // -------------------------
  311. // Username format:
  312. // 0: username@domain
  313. // 1: username%domain
  314. // 2: username.domain
  315. // 3: domain.username
  316. // 4: username-domain
  317. // 5: domain-username
  318. // 6: username_domain
  319. // 7: domain_username
  320. // 8: username@domain; mbox.username
  321. $rcmail_config['password_virtualmin_format'] = 8;
  322.  
  323.  
  324. // pw_usermod Driver options
  325. // --------------------------
  326. // Use comma delimited exlist to disable password change for users
  327. // Add the following line to visudo to tighten security:
  328. // www  ALL=NOPASSWORD: /usr/sbin/pw
  329. $rcmail_config['password_pw_usermod_cmd'] = 'sudo /usr/sbin/pw usermod -h 0 -n';
  330.  
  331.  
  332. // DBMail Driver options
  333. // -------------------
  334. // Additional arguments for the dbmail-users call
  335. $rcmail_config['password_dbmail_args'] = '-p sha512';
  336.  
  337.  
  338. // Expect Driver options
  339. // ---------------------
  340. // Location of expect binary
  341. $rcmail_config['password_expect_bin'] = '/usr/bin/expect';
  342.  
  343. // Location of expect script (see helpers/passwd-expect)
  344. $rcmail_config['password_expect_script'] = '';
  345.  
  346. // Arguments for the expect script. See the helpers/passwd-expect file for details.
  347. // This is probably a good starting default:
  348. //   -telent -host localhost -output /tmp/passwd.log -log /tmp/passwd.log
  349. $rcmail_config['password_expect_params'] = '';
  350.  
  351.  
  352. // smb Driver options
  353. // ---------------------
  354. // Samba host (default: localhost)
  355. $rcmail_config['password_smb_host'] = 'localhost';
  356. // Location of smbpasswd binary
  357. $rcmail_config['password_smb_cmd'] = '/usr/bin/smbpasswd';

5.3 Проверка конфигурации

Проверка работоспособности Roundcube заключается попыткой подключения к какому-нибудь почтовому ящику. Если что-то не работает, то смотрите в логи веб сервера или куда у вас там PHP выводит отладочные сообщения. Для примера приведу пару скриншотов рабочего интерфейса (жмякните на картинку, чтобы увеличить ее):

Интерфейс Roundcube
На рисунке представлен интерфейс Roundcube в работе.

Интерфейс Roundcube
На рисунке представлен интерфейс для управления пользовательскими фильтрами.

Заключение

Статья получилась довольно большая, причем я старался рассказывать только по делу и все самое необходимое для понимания и настройки рабочей почтовой системы. Следовательно, желающим как следует разобраться в работе почтовых серверов придется еще много попотеть, поскольку область очень большая, технологий достаточно, софта также не мало, а информации еще больше. Ниже я приведу некоторые полезные ссылки на тот базис знаний, который должен знать администратор почтового сервера.

Что в итоге? В итоге у нас есть вполне работоспособная почтовая система, позволяющая обслуживать большое количество клиентов (есть у меня один из почтовых серверов, имеющий в ключевых местах похожие конфиги и обрабатывающий почти 1000 писем в день, по сути это совсем немного, но все же показатель), в состоянии отшибать спам (около 95%) без использования дополнительных средств фильтрации (таких как SpamAssasin, DSPAM и других), имеющая возможность проверки почты антивирусом и доступом к ней через удобный веб интерфейс. Надеюсь, больше ничего не забыл указать из ключевых возможностей.

Приветствуется любая конструктивная критика, связанная с темой/областью статьи, которую можно "высказать", через форму комментариев ниже. Все вопросы, типа: почему у меня тут почему-то и что-то не работает или не получается...?, просьба задавать в соответствующей ветке форума.



Назад | Начало

ср, 19/06/2013 - 00:42

ср, 19/06/2013 - 09:58

ср, 24/07/2013 - 11:38

ср, 24/07/2013 - 13:28

пн, 02/09/2013 - 11:20

пн, 02/09/2013 - 18:54

пн, 25/11/2013 - 12:40

пн, 25/11/2013 - 18:54

пт, 07/02/2014 - 20:52

ср, 09/04/2014 - 17:58

ср, 14/05/2014 - 18:36

ср, 14/05/2014 - 21:57

ср, 01/10/2014 - 14:30

сб, 08/11/2014 - 10:36

вс, 30/11/2014 - 22:30

пн, 01/12/2014 - 11:29

ср, 03/12/2014 - 17:18

пт, 01/04/2016 - 16:58

сб, 02/04/2016 - 20:16

ср, 19/09/2018 - 11:36

Добавить комментарий

Этот вопрос задается для того, чтобы выяснить, являетесь ли Вы человеком или представляете из себя автоматическую спам-рассылку.

Кто разработал периодическую систему химических элементов? (Фамилия)