1 Installing SquirrelMail
2 =======================
4 NOTE! More thorough and possibly up-to-date information about how
5 to install, use and maintain SquirrelMail is available in our online
8 http://squirrelmail.org/docs/admin/admin.html
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
22 0. QUICK INSTALL GUIDE
23 ----------------------
25 Each of these steps is covered in detail below.
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
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.
43 1. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP
44 --------------------------------------------
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.
50 You can find PHP at http://php.net. See the documentation that
51 comes with PHP for instructions how to set it up.
53 The PHP IMAP extension is NOT necessary at all (but won't harm)!
54 Below is a list of optional PHP extensions:
57 Required for LDAP addressbooks
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.
66 Required for encrypted IMAP or SMTP connections (TLS)
69 Can be used by SquirrelSpell plugin for encryption of personal
72 --with-iconv or --with-recode
73 Can be used by Eastern charset decoding functions
76 Required for Japanese translation. Optional for translations that
77 use non-ISO-8859-1 charset
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
83 If you want your users to attach files to their mails, make sure
84 File Uploads in php.ini is set to On.
90 This depends a lot on the server your choose. See the documentation
91 that comes with your server.
93 If you're concerned about people accessing it directly, you can
94 limit access to only the IP of the webserver.
97 3. OBTAINING AND INSTALLING SQUIRRELMAIL
98 ----------------------------------------
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
106 a. Download SquirrelMail
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
113 b. Setting up directories
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.
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
127 $ chown -R nobody:nobody /var/local/squirrelmail/data
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.
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):
143 $ cd /var/local/squirrelmail/
145 $ chgrp -R nobody attach
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
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:
158 $ cd /var/local/squirrelmail/attach && rm -f *
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'.
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
171 $ find /var/local/squirrelmail/attach -type f -atime +2 -exec rm {} \;
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.
176 c. Setting up SquirrelMail
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
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.
186 You can also copy the config/config_default.php file to config/config.php
187 and edit that manually.
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.
195 4. RUNNING SQUIRRELMAIL
196 -----------------------
198 Point your browser at the URL at which SquirrelMail is installed. A
199 possible example of this is:
200 http://example.com/squirrelmail
202 It should be pretty straight forward to use. Some more documentation
203 might show up one day or another.
209 For information on how to make SquirrelMail work with Russian
210 Apache, see the russian_apache.txt in the doc/ subdirectory.
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.
220 Locale packages can be downloaded from SquirrelMail SourceForge
223 http://sourceforge.net/project/showfiles.php?group_id=311&package_id=110388
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
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.
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.
241 The SquirrelMail package includes some standard plugins. These plugins can be
242 enabled in the SquirrelMail configuration script.
244 Included plugins can use additional configuration files:
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.
251 configuration is stored in plugins/squirrelspell/sqspell_config.php
252 The default configuration might not work at your server.
254 plugin must be setup correctly in order to detect administrative user.
255 See plugins/administrator/INSTALL