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