Update docs
[squirrelmail.git] / doc / INSTALL
1 Installing SquirrelMail
2 =======================
3
4 NOTE! More thorough and possibly up-to-date information about how
5 to install, use and maintain SquirrelMail is available in our online
6 documentation here:
7
8 http://squirrelmail.org/docs/admin/admin.html
9
10
11 Table of Contents:
12 0. (QUICK!) Quick install guide
13 1. (PHP) Configure your webserver to work with PHP
14 2. (IMAP) Setting up IMAP (not covered)
15 3. (INSTALL) Obtaining and installing SquirrelMail
16 4. (RUN) Running SquirrelMail
17 5. (CHARSETS) Russian Charsets
18 6. (LOCALES) Translations of SquirrelMail
19 7. (PLUGINS) Installation of included plugins
20
21
22 0. QUICK INSTALL GUIDE
23 ----------------------
24
25 Each of these steps is covered in detail below.
26
27 - Install webserver and PHP (at least 4.1.0).
28 - Install IMAP server (see docs of that server).
29 - Unpack the SquirrelMail package in a web-accessible location.
30 - Select a data-dir and attachment dir, outside the webtree (e.g. in /var).
31 The data-dir (for user prefs) should be owned by the user the webserver
32 runs as (e.g. www-data). The attachment dir (for uploading files as
33 attachments) should be file mode 0730 and in the same group as the
34 webserver.
35 - Run config/conf.pl from the command line. Use the D option to load
36 predefined options for specific IMAP servers, and edit at least the
37 Server Settings and General Options (datadir).
38 - Browse to http://example.com/yourwebmaillocation/src/configtest.php
39 to test your configuration for common errors.
40 - Browse to http://example.com/yourwebmaillocation/ to log in.
41
42
43 1. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP
44 --------------------------------------------
45
46 If your webserver does not already have PHP you must configure it
47 to work with PHP. You need at least PHP v4.1.0. SquirrelMail uses
48 the standard suffix .php for all PHP files.
49
50 You can find PHP at http://php.net. See the documentation that
51 comes with PHP for instructions how to set it up.
52
53 The PHP IMAP extension is NOT necessary at all (but won't harm)!
54 Below is a list of optional PHP extensions:
55
56 --with-ldap
57 Required for LDAP addressbooks
58
59 --with-pear
60 If you do not have PHP PDO (which should come preinstalled with
61 PHP version 5.1 and above) and you plan to store user preferences
62 or address books in a database, you will need PHP compiled with
63 the above option. ALSO, you need to build the database driver
64 relevant to your database:
65 --with-mysql for MySQL
66 --with-pgsql for PostgreSQL
67 Again, this is only required for versions of PHP that do not
68 have PDO.
69
70 --with-openssl
71 Required for encrypted IMAP or SMTP connections (TLS)
72
73 --with-mcrypt
74 Can be used by SquirrelSpell plugin for encryption of personal
75 dictionaries
76
77 --with-iconv or --with-recode
78 Can be used by Eastern charset decoding functions
79
80 --enable-mbstring
81 Required for Japanese translation. Optional for translations that
82 use non-ISO-8859-1 charset
83
84 It is highly advised to NOT turn on register_globals, as this can lead
85 to security holes. If you must use register_globals for some applications,
86 turn it on locally for only those directories, or turn it off for the
87 SquirrelMail folder.
88 If you want your users to attach files to their mails, make sure
89 File Uploads in php.ini is set to On.
90
91
92 2. SETTING UP IMAP
93 ------------------
94
95 This depends a lot on the server your choose. See the documentation
96 that comes with your server.
97
98 If you're concerned about people accessing it directly, you can
99 limit access to only the IP of the webserver.
100
101
102 3. OBTAINING AND INSTALLING SQUIRRELMAIL
103 ----------------------------------------
104
105 SquirrelMail is constantly being improved. Therefore you should always
106 get the newest version around. Look at http://squirrelmail.org
107 to see what it is. If you want to be bleeding edge you might want to
108 consider using the latest SVN version (with the latest and most
109 fashionable bugs).
110
111 a. Download SquirrelMail
112
113 Get SquirrelMail from the address above if you do not have it or are
114 uncertain if you have the newest version. Untar (again tar xvfz
115 filename.tgz) SquirrelMail in a directory that is readable for your
116 webserver.
117
118 b. Setting up directories
119
120 SquirrelMail uses two directories to store user configuration and
121 attachments that are about to be sent. You might want to have these
122 directories outside of your web tree.
123
124 The data directory is used for storing user preferences, like
125 signature, name and theme. You need to create this directory yourself.
126 Recommended location is under /var, for example:
127 /var/local/squirrelmail/data
128 This directory must be writable by the webserver. If your webserver is
129 running as the user "nobody" and group "nobody" you can fix this by
130 running:
131
132 $ chown -R nobody:nobody /var/local/squirrelmail/data
133
134 Keep in mind that with different installations, the web server could
135 typically run as userid/groupid of nobody/nobody, nobody/nogroup,
136 apache/apache or www-data/www-data. The best way to find out is to read
137 the web server's configuration file.
138
139 There also needs to be a directory where attachments are stored
140 before they are sent. Since personal mail is stored in this
141 directory you might want to be a bit careful about how you set it
142 up. It should be owned by another user than the webserver is running
143 as (root might be a good choice) and the webserver should have directory
144 write and execute permissions, but should not have read
145 permissions. You could do this by running these commands (still
146 granted that the webserver is running as nobody/nobody):
147
148 $ cd /var/local/squirrelmail/
149 $ mkdir attach
150 $ chgrp -R nobody attach
151 $ chmod 730 attach
152
153 If you trust all the users at your system not to read mail they are
154 not supposed to read, you can simply use /tmp as you attachments
155 directory.
156
157 If a user is aborting a mail but has uploaded some attachments to it
158 the files will be lying around in this directory forever if you do not
159 remove them. To fix this, it is recommended to create a cron job that
160 deletes everything in the attachment directory. Something similar
161 to the following will be good enough:
162
163 $ cd /var/local/squirrelmail/attach && rm -f *
164
165 However, this will delete attachments that are currently in use by people
166 sending email when the cron job runs. You can either (1) make sure that
167 the cron job runs at an obscure hour and hope that nobody gets upset, or
168 (2) you can run a modified version of the commands above. Check out the
169 man pages for other commands such as 'find' or 'tmpreaper'.
170
171 One sample script you could set up that would erase all attachments, but
172 wouldn't erase preferences, address books, or the like (just in case your
173 attachment directory is the same as your data directory) might look like
174 this:
175
176 $ find /var/local/squirrelmail/attach -type f -atime +2 -exec rm {} \;
177
178 Remember to be careful with whatever method you do use, and to test out
179 the command before it potentially wipes out everyone's preferences.
180
181 c. Setting up SquirrelMail
182
183 There are three ways to configure SquirrelMail. In the config/ directory,
184 there is a perl script called conf.pl that will aid you in the
185 configuration process. This is the recommended way of handling
186 the config.
187
188 There's also a plugin called 'administrator' for the webinterface but you'll
189 have to be able to at least log in to SquirrelMail first.
190
191 You can also copy the config/config_default.php file to config/config.php
192 and edit that manually.
193
194 After you've created a configuration, you can use your webbrowser to
195 browse to http://your-squirrelmail-location/src/configtest.php.
196 This will perform some basic checks on your configuration to make sure
197 everything works like it should.
198
199
200 4. RUNNING SQUIRRELMAIL
201 -----------------------
202
203 Point your browser at the URL at which SquirrelMail is installed. A
204 possible example of this is:
205 http://example.com/squirrelmail
206
207 It should be pretty straight forward to use. Some more documentation
208 might show up one day or another.
209
210
211 5. RUSSIAN CHARSETS
212 -------------------
213
214 For information on how to make SquirrelMail work with Russian
215 Apache, see the russian_apache.txt in the doc/ subdirectory.
216
217
218 6. TRANSLATIONS
219 ---------------
220
221 In order to use translated versions of SquirrelMail, you need
222 to download and install locale packages that contain translations
223 that you want to use with SquirrelMail.
224
225 Locale packages can be downloaded from SquirrelMail SourceForge
226 project page.
227
228 http://sourceforge.net/project/showfiles.php?group_id=311&package_id=110388
229
230 Each translation contains an install script that copies the required files
231 into their appropriate locations. If you can't run that script, you can
232 extract the contents of a translation package into your SquirrelMail
233 directory.
234
235 NOTE No.1: *-src.tar.gz, *-src.tar.bz2 and *-src.zip archives do not contain
236 compiled translation files. You will need to run the "compilelocales" script
237 in order to get all gettext binary translations.
238
239 NOTE No.2: You might need to restart your webserver before using translations.
240 If you can't do that, install your translations _before_ you use SquirrelMail.
241
242
243 7. PLUGINS
244 ----------
245
246 The SquirrelMail package includes some standard plugins. These plugins can be
247 enabled in the SquirrelMail configuration script.
248
249 Included plugins can use additional configuration files:
250 * change_password
251 configuration file is required. Without it plugin defaults to invalid
252 backend. See plugins/change_password/README
253 * filters, fortune, mail_fetch, newmail, translate
254 configuration files are optional. See README files in plugin directories.
255 * squirrelspell
256 configuration is stored in plugins/squirrelspell/sqspell_config.php
257 The default configuration might not work at your server.
258 * administrator
259 plugin must be setup correctly in order to detect administrative user.
260 See plugins/administrator/INSTALL