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