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