README 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. Master Change Password plugin
  2. -----------------------------
  3. WHAT'S THIS?
  4. This plugin is a general framework for enabling the user to
  5. change his/her password. It allows for different backend
  6. to perform this task on different systems.
  7. STATUS
  8. Development
  9. REQUIREMENTS:
  10. - SquirrelMail 1.4.3 or later. (plugin is included in SquirrelMail
  11. 1.5.0 and later versions).
  12. - ldap backend needs PHP LDAP extension. It might need PHP
  13. Mhash extension and system crypt libraries that support crypto
  14. used on LDAP server. It might need PHP LDAP extension with SSL
  15. support, if LDAP server requires it.
  16. - mysql backend needs PHP MySQL extension and PHP 4.3 or later.
  17. - merak backend needs PHP Curl extension.
  18. - peardb backend needs PHP Pear DB libraries (v.1.6.0 or newer) and
  19. PHP extension that is used to connect to database.
  20. - poppassd backend needs poppassd server that supports authentication
  21. used by IMAP server.
  22. - vmailmgrd backend needs vmailmgr PHP library (vmail.inc) and
  23. vmailmgrd service running on tcp port or unix socket. It also
  24. requires SquirrelMail 1.4.4 or 1.5.1.
  25. CONFIGURATION
  26. Edit the file config.php to set the backend you want to use.
  27. Backends can use special arrays that override default values set
  28. in backend/<yourbackend>.php. Check description of backend that
  29. you use.
  30. BACKENDS
  31. - ldap
  32. Default settings are supplied in backends/ldap.php.
  33. You don't have to change any configuration vars in
  34. backend/ldap.php - instead, create an $cpw_ldap array in
  35. config.php containing the variable you want to override.
  36. See more information in "About LDAP backend" chapter.
  37. - mysql
  38. Default settings are supplied in backends/mysql.php.
  39. You do not have to change any configuration vars in
  40. backend/mysql.php - instead, create an $cpw_mysql array in
  41. config.php containing the variable you want to override,
  42. for example:
  43. To override the server name ($mysql_server), you would add
  44. $cpw_mysql['server'] = 'remote_servername';
  45. to config.php.
  46. See more information in "About MySQL backend" chapter.
  47. - merak
  48. Default settings are supplied in backends/merak.php.
  49. Site configuration is controlled in config.php $cpw_merak
  50. array. You can use 'url','selfpage' and 'action' array
  51. keys to override default values.
  52. * 'url'
  53. override sets address of merak interface. URL is used
  54. by webserver's libraries. If it points at localhost,
  55. plugin tries to connect to administrative interface on
  56. same machine that hosts SquirrelMail scripts.
  57. Defaults to 'http://localhost:32000/'.
  58. * 'selfpage'
  59. override sets page that is used to change password.
  60. Defaults to 'self.html'.
  61. * 'action'
  62. override sets action that is used during password change.
  63. Defaults to 'self_edit'.
  64. For example:
  65. $cpw_merak['url']='http://example.com:32000';
  66. - peardb
  67. Default settings are supplied in backends/peardb.php.
  68. Site configuration is controlled in config.php $cpw_peardb
  69. array. Used configuration overrides:
  70. * 'dsn' - (required) DSN used for connection to database.
  71. See PHP Pear DB manual.
  72. * 'connect_opts' - (optional) Pear DB connection options.
  73. See PHP Pear DB manual.
  74. * 'table' - (required) table that stores user information.
  75. * 'uid_field' - (optional) field that stores username.
  76. Defaults to 'userid'.
  77. * 'domain_field' - (optional) field that stores domain
  78. information. Used for setups that split username into
  79. user and domain parts. Option is ignored if set to empty
  80. string. Defaults to empty string.
  81. * 'password_field' - (optional) field that stores password.
  82. Defaults to 'password'.
  83. * 'crypted_passwd' - (optional) boolean variable that is
  84. used to switch between plaintext and encoded passwords.
  85. If variable is set to false, backend works with plain
  86. text passwords. If variable is set to true, backend
  87. tries to detect crypto used in password and uses
  88. detected crypto. Backend defaults to plain text
  89. passwords.
  90. * 'debug' - (optional) boolean variable that is used to control
  91. display of debugging information. If set to true, backend
  92. might display more information about connection errors.
  93. Debug information can contain SQL connection options and
  94. password information. Don't enable it on production system.
  95. Backend disables display of debug information by default.
  96. Supported password schemas:
  97. * plaintext - passwords are stored as clear text.
  98. * crypt - passwords use system crypt libraries. Backend should be
  99. able to use standard DES, extended DES, MD5 crypt and blowfish
  100. algorithms, if system libraries support them. {crypt} prefix
  101. is optional.
  102. * plain-md5 - passwords are hashed with MD5 and use {plain-md5}
  103. prefix.
  104. * digest-md5 - hash stores MD5 hash of username:domain:password
  105. string and is prefixed with {digest-md5} string.
  106. Tested configurations:
  107. * Dovecot 0.99.14 with mysql authentication module.
  108. - poppassd
  109. Default settings are supplied in backends/poppassd.php.
  110. Site configuration is controlled in config.php $cpw_poppassd
  111. array. You can use 'server' array key to override address
  112. of poppassd server. Backend uses address of IMAP server, if
  113. variable is set to empty string. It uses address of IMAP
  114. server by default.
  115. For example:
  116. $cpw_poppassd['server'] = 'remote_servername';
  117. Available poppass servers:
  118. * Qualcomm qpopper's poppassd -
  119. http://www.eudora.com/products/unsupported/qpopper/index.html
  120. original implementation of poppass protocol
  121. * poppassd-seti - http://echelon.pl/pubs/poppassd.html
  122. poppass server with shadow password and PAM support
  123. * courierpassd - http://www.arda.homeunix.net/store/
  124. poppass server used with courier authentication system.
  125. * ldap poppassd - http://works.agni.com/ldap-poppassd.html
  126. poppass server for LDAP
  127. * yppoppassd - http://cns.georgetown.edu/~ric/software/yppoppassd/
  128. poppass server for NIS/YP
  129. * kpoppassd - http://kpoppassd.sourceforge.net/
  130. poppass server for Kerberos
  131. * Mercury32 poppassd - http://www.pmail.com/
  132. poppass server that is part of Mercury Mail Transport
  133. System.
  134. * FreeBSD includes two poppass servers in ports collection.
  135. http://www.freebsd.org/cgi/cvsweb.cgi/ports/mail/poppassd
  136. http://www.freebsd.org/cgi/cvsweb.cgi/ports/mail/poppwd
  137. - vmailmgrd
  138. Default settings are supplied in backends/vmailmgrd.php.
  139. Site configuration is controlled in config.php $cpw_vmailmgrd
  140. array. Backend uses 'vmail_inc_path', 'vm_tcphost',
  141. 'vm_tcphost_port' and '8bitpw' array keys.
  142. 'vmail_inc_path' sets path to vmail.inc. 'vm_tcphost' sets
  143. vmailmgrd tcp service ip address or dns name. Plugin uses
  144. vmailmgrd socket, if it is not set. 'vm_tcphost_port' sets
  145. port of vmailmrgd service. Plugin uses port 322, if it is
  146. not set. '8bitpw' controls use of 8bit passwords. If it
  147. is not set, interface does not allow new passwords with
  148. 8bit symbols.
  149. $cpw_vmailmgrd['vmail_inc_path'] setting is required.
  150. Tested configurations:
  151. - Linux Debian Woody, vmailmgr 0.96.9, stock Woody's courier-imap
  152. with vmailmgr authentication module.
  153. AUTHORS:
  154. ldap, peardb and - Tomas Kuliavas <tokul@users.sourceforge.net>
  155. vmailmgrd backends used code from phpldapadmin and squirrelmail
  156. ldapquery plugin.
  157. merak backend - Edwin van Elk <Edwin@eve-software.com>
  158. mysql backend - Thijs Kinkhorst <kink@squirrelmail.org>
  159. poppassd backend - Seth Randall <sethr@missoulafcu.org>
  160. ------------------
  161. ABOUT LDAP BACKEND
  162. ------------------
  163. List of supported overrides
  164. * 'server'
  165. overrides address of LDAP server. use any syntax that is supported
  166. by your PHP LDAP extension. Defaults to address of IMAP server.
  167. * 'port'
  168. overrides port of LDAP server. Defaults to 389.
  169. * 'basedn'
  170. (required) LDAP BaseDN used for binding to LDAP server. If set to
  171. empty string, it blocks use of backend. Defaults to empty string.
  172. * 'connect_opts'
  173. controls LDAP_OPT_* settings that are set with ldap_set_option()
  174. function. See available options at http://www.php.net/ldap-set-option.
  175. LDAP_OPT_ prefix must be omitted in $cpw_ldap['connect_opts']
  176. overrides. No connection options are enabled by default.
  177. You can use this option only when your PHP LDAP extension supports
  178. ldap_set_option() function.
  179. * 'use_tls'
  180. enables or disables use of TLS in LDAP connection. Requires PHP
  181. 4.2+, PHP LDAP extension with SSL support and PROTOCOL_VERSION => 3
  182. setting in $cpw_ldap_connect_opts. Backend does not enable TLS by
  183. default.
  184. * 'binddn'
  185. unprivileged BindDN. should be able to search LDAP directory and
  186. find DN used by user. Uses anonymous bind, if set to empty string.
  187. You should not use DN with write access to LDAP directory here.
  188. Defaults to anonymous bind.
  189. * 'bindpw'
  190. password used for unprivileged bind
  191. * 'admindn'
  192. bind DN that should be able to change password.
  193. WARNING: usually user has enough privileges to change own password.
  194. If you leave default value, plugin will try to connect with DN that
  195. is detected in $cpw_ldap_username_attr=$username search and current
  196. user password will be used for authentication.
  197. * 'adminpw'
  198. password for binding with 'admindn'
  199. * 'userid_attr'
  200. LDAP attribute that stores username. Defaults to 'uid'
  201. * 'default_crypto'
  202. crypto that is used to encode new password. If set to empty string,
  203. system tries to keep same encoding/hashing algorithm. Currently
  204. backend supports:
  205. - MD4 - used name 'md4'. Implemented in PHP Mhash extension functions.
  206. - MD5 - used name 'md5'. Implemented in standard PHP functions.
  207. - SMD5 - used name 'smd5'. Implemented in PHP Mhash extension functions.
  208. Minimal php version = 4.0.4.
  209. - RIPEMD-160 - used name 'rmd160'. Implemented in PHP Mhash extension functions.
  210. - SHA - used name 'sha'. Implemented in PHP Mhash extension functions
  211. and PHP 4.3.0+ sha1() function. Mhash extension is used only when
  212. sha1() function is unavailable.
  213. - SSHA - used name 'ssha'. Implemented in PHP Mhash extension functions.
  214. Minimal PHP version = 4.0.4.
  215. - MD5 crypt - used name 'md5crypt'. Uses PHP crypt function. Depends on
  216. MD5 support in system crypt libraries. Should work on Linux glibc2 systems
  217. and BSD systems.
  218. - blowfish crypt - used name 'blowfish'. Uses PHP crypt function. Depends on
  219. blowfish support in system crypt libraries. Should work on BSD systems.
  220. Is not supported by glibc 2.3.2. (Tested on OpenBSD 3.5)
  221. - extended DES crypt - used name 'extcrypt'. Uses PHP crypt function. Depends on
  222. extended DES support in system crypt libraries. Should work on BSD systems.
  223. Is not supported by glibc 2.3.2. (Tested on OpenBSD 3.5)
  224. - standard DES crypt - used name 'crypt'. Uses PHP crypt function. Depends on
  225. standard DES support in system crypt libraries. Should work on libc systems
  226. and BSD systems.
  227. - plain text passwords - used name 'plaintext'.
  228. If you use admindn, plugin should support all encryption/hashing
  229. algorithms used in your LDAP server.
  230. WARNINGS:
  231. * don't enforce any crypto that is not supported by LDAP server, if admindn
  232. override is not used in backend configuration.
  233. * don't enforce extcrypt, md5crypt or blowfish, if they are not supported
  234. by LDAP server and web server crypt libraries.
  235. Safest setting options:
  236. * If web server and LDAP server is on same OS, make sure that Mhash
  237. extension is present in PHP.
  238. * If web server and LDAP server is on same OS and Mhash extension is
  239. not present, enforce MD5 passwords or any crypt password algorithm
  240. supported by your OS. Remember that standard DES crypt is limited
  241. to eight symbols. Don't use admindn override, if LDAP server
  242. supports MD4, RIPEMD-160, SHA, SSHA or SMD5.
  243. * If crypt libraries differ on web server and LDAP server -
  244. enforce MD5 passwords or any crypt password algorithm supported by
  245. web server and LDAP server. Don't use admindn override, if LDAP
  246. server supports MD4, RIPEMD-160, SHA, SSHA or SMD5 and Mhash extension
  247. is not present.
  248. Configuration example:
  249. $cpw_ldap['basedn']='ou=users,dc=example,dc=com'; // sets base dn
  250. $cpw_ldap['connect_opts']['PROTOCOL_VERSION']=3; // forces v3 bind protocol
  251. Tested configurations:
  252. - Linux Debian Sarge, OpenLDAP v.2.1.30, Qmail LDAP 20050401a, courier-imap
  253. v.3.0.8 using qmail-ldap auth-imap authentication. NS-MTA-MD5 crypto is not
  254. implemented in backend. Crypted passwords need {crypt} prefix.
  255. -------------------
  256. ABOUT MYSQL BACKEND
  257. ------------_------
  258. List of supported overrides:
  259. * 'server'
  260. address of MySQL server. Defaults to localhost.
  261. * 'database'
  262. database that stores user information. Defaults to 'email'.
  263. * 'table'
  264. database table that stores user information. Defaults to 'users'.
  265. * 'userid_field'
  266. field that stores user's ID. Defaults to 'id'.
  267. * 'password_field'
  268. field that stores password. Defaults to 'password'.
  269. * 'manager_id'
  270. username that is used to log into MySQL with (must have rights).
  271. Defaults to 'email_admin'.
  272. * 'manager_pw'
  273. password that is used to log into MySQL.
  274. * 'saslcrypt'
  275. boolean value that controls use of SASL (MySQL) crypt in passwords.
  276. It is not enabled by default.
  277. * 'unixcrypt'
  278. boolean value that controls use of unix crypt() in passwords.
  279. Setting is ignored, if saslcrypt is enabled. It is not enabled
  280. by default.
  281. If saslcrypt and unixcrypt are not enabled, plugin defaults to plaintext
  282. passwords.
  283. $Id$