d68a3926 |
1 | Installing SquirrelMail |
2 | ======================= |
3 | |
a009670c |
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 | |
3b3d853f |
11 | Table of Contents: |
46f33521 |
12 | 0. (QUICK!) Quick install guide |
238d4cfc |
13 | 1. (PHP) Configure your webserver to work with PHP |
3b3d853f |
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 |
46f33521 |
18 | 6. (LOCALES) Translations of SquirrelMail |
c650b678 |
19 | 7. (PLUGINS) Installation of included plugins |
3b3d853f |
20 | |
21 | |
46f33521 |
22 | 0. QUICK INSTALL GUIDE |
23 | ---------------------- |
17cec454 |
24 | |
46f33521 |
25 | Each of these steps is covered in detail below. |
17cec454 |
26 | |
238d4cfc |
27 | - Install webserver and PHP (at least 4.1.0). |
46f33521 |
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 |
512d4b31 |
32 | runs as (e.g. www-data). The attachment dir (for uploading files as |
46f33521 |
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). |
a3bb5005 |
38 | - Browse to http://example.com/yourwebmaillocation/src/configtest.php |
46f33521 |
39 | to test your configuration for common errors. |
a3bb5005 |
40 | - Browse to http://example.com/yourwebmaillocation/ to log in. |
2a32fc83 |
41 | |
1067414d |
42 | |
238d4cfc |
43 | 1. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP |
44 | -------------------------------------------- |
17cec454 |
45 | |
46f33521 |
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 |
238d4cfc |
48 | the standard suffix .php for all PHP files. |
598294a7 |
49 | |
a3bb5005 |
50 | You can find PHP at http://php.net. See the documentation that |
46f33521 |
51 | comes with PHP for instructions how to set it up. |
17cec454 |
52 | |
512d4b31 |
53 | The PHP IMAP extension is NOT necessary at all (but won't harm)! |
46f33521 |
54 | Below is a list of optional PHP extensions: |
17cec454 |
55 | |
0dc92cda |
56 | --with-ldap |
57 | Required for LDAP addressbooks |
bee552c7 |
58 | |
9dbc09d5 |
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. |
0dc92cda |
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 |
bee552c7 |
81 | Required for Japanese translation. Optional for translations that |
0dc92cda |
82 | use non-ISO-8859-1 charset |
17cec454 |
83 | |
962a6686 |
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. |
46f33521 |
88 | If you want your users to attach files to their mails, make sure |
89 | File Uploads in php.ini is set to On. |
17cec454 |
90 | |
17cec454 |
91 | |
92 | 2. SETTING UP IMAP |
93 | ------------------ |
94 | |
46f33521 |
95 | This depends a lot on the server your choose. See the documentation |
96 | that comes with your server. |
598294a7 |
97 | |
46f33521 |
98 | If you're concerned about people accessing it directly, you can |
99 | limit access to only the IP of the webserver. |
100 | |
17cec454 |
101 | |
102 | 3. OBTAINING AND INSTALLING SQUIRRELMAIL |
103 | ---------------------------------------- |
104 | |
ef1932a4 |
105 | SquirrelMail is constantly being improved. Therefore you should always |
a3bb5005 |
106 | get the newest version around. Look at http://squirrelmail.org |
ef1932a4 |
107 | to see what it is. If you want to be bleeding edge you might want to |
8fea605c |
108 | consider using the latest SVN version (with the latest and most |
46f33521 |
109 | fashionable bugs). |
17cec454 |
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 |
368ab966 |
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: |
65b14f90 |
131 | |
e71e5745 |
132 | $ chown -R nobody:nobody /var/local/squirrelmail/data |
4bc627ae |
133 | |
134 | Keep in mind that with different installations, the web server could |
598294a7 |
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 |
ff65039a |
137 | the web server's configuration file. |
4bc627ae |
138 | |
17cec454 |
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 |
e71e5745 |
143 | as (root might be a good choice) and the webserver should have directory |
144 | write and execute permissions, but should not have read |
17cec454 |
145 | permissions. You could do this by running these commands (still |
e71e5745 |
146 | granted that the webserver is running as nobody/nobody): |
17cec454 |
147 | |
e71e5745 |
148 | $ cd /var/local/squirrelmail/ |
149 | $ mkdir attach |
150 | $ chgrp -R nobody attach |
151 | $ chmod 730 attach |
17cec454 |
152 | |
e71e5745 |
153 | If you trust all the users at your system not to read mail they are |
368ab966 |
154 | not supposed to read, you can simply use /tmp as you attachments |
155 | directory. |
598294a7 |
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 |
390372b4 |
159 | remove them. To fix this, it is recommended to create a cron job that |
160 | deletes everything in the attachment directory. Something similar |
4bc627ae |
161 | to the following will be good enough: |
390372b4 |
162 | |
1e532e26 |
163 | $ cd /var/local/squirrelmail/attach && rm -f * |
598294a7 |
164 | |
4bc627ae |
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'. |
598294a7 |
170 | |
4bc627ae |
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 |
598294a7 |
173 | attachment directory is the same as your data directory) might look like |
4bc627ae |
174 | this: |
598294a7 |
175 | |
1e532e26 |
176 | $ find /var/local/squirrelmail/attach -type f -atime +2 -exec rm {} \; |
598294a7 |
177 | |
4bc627ae |
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. |
17cec454 |
180 | |
181 | c. Setting up SquirrelMail |
182 | |
86bb50f8 |
183 | There are three ways to configure SquirrelMail. In the config/ directory, |
be8e07f8 |
184 | there is a perl script called conf.pl that will aid you in the |
390372b4 |
185 | configuration process. This is the recommended way of handling |
be8e07f8 |
186 | the config. |
187 | |
86bb50f8 |
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 | |
390372b4 |
191 | You can also copy the config/config_default.php file to config/config.php |
be8e07f8 |
192 | and edit that manually. |
65b14f90 |
193 | |
cbd6543c |
194 | After you've created a configuration, you can use your webbrowser to |
13721b47 |
195 | browse to http://your-squirrelmail-location/src/configtest.php. |
e71e5745 |
196 | This will perform some basic checks on your configuration to make sure |
cbd6543c |
197 | everything works like it should. |
198 | |
199 | |
17cec454 |
200 | 4. RUNNING SQUIRRELMAIL |
201 | ----------------------- |
65b14f90 |
202 | |
429f8906 |
203 | Point your browser at the URL at which SquirrelMail is installed. A |
598294a7 |
204 | possible example of this is: |
a3bb5005 |
205 | http://example.com/squirrelmail |
598294a7 |
206 | |
3d8fe250 |
207 | It should be pretty straight forward to use. Some more documentation |
429f8906 |
208 | might show up one day or another. |
8c086db6 |
209 | |
210 | |
211 | 5. RUSSIAN CHARSETS |
212 | ------------------- |
213 | |
214 | For information on how to make SquirrelMail work with Russian |
77180a75 |
215 | Apache, see the russian_apache.txt in the doc/ subdirectory. |
2481e3c1 |
216 | |
46f33521 |
217 | |
2481e3c1 |
218 | 6. TRANSLATIONS |
219 | --------------- |
220 | |
598294a7 |
221 | In order to use translated versions of SquirrelMail, you need |
2481e3c1 |
222 | to download and install locale packages that contain translations |
598294a7 |
223 | that you want to use with SquirrelMail. |
224 | |
2481e3c1 |
225 | Locale packages can be downloaded from SquirrelMail SourceForge |
226 | project page. |
598294a7 |
227 | |
bee552c7 |
228 | http://sourceforge.net/project/showfiles.php?group_id=311&package_id=110388 |
598294a7 |
229 | |
512d4b31 |
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 |
86bb50f8 |
232 | extract the contents of a translation package into your SquirrelMail |
512d4b31 |
233 | directory. |
598294a7 |
234 | |
512d4b31 |
235 | NOTE No.1: *-src.tar.gz, *-src.tar.bz2 and *-src.zip archives do not contain |
86bb50f8 |
236 | compiled translation files. You will need to run the "compilelocales" script |
2481e3c1 |
237 | in order to get all gettext binary translations. |
598294a7 |
238 | |
2481e3c1 |
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. |
c650b678 |
241 | |
bee552c7 |
242 | |
c650b678 |
243 | 7. PLUGINS |
244 | ---------- |
245 | |
bee552c7 |
246 | The SquirrelMail package includes some standard plugins. These plugins can be |
512d4b31 |
247 | enabled in the SquirrelMail configuration script. |
c650b678 |
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 |
e71e5745 |
257 | The default configuration might not work at your server. |
c650b678 |
258 | * administrator |
bee552c7 |
259 | plugin must be setup correctly in order to detect administrative user. |
c650b678 |
260 | See plugins/administrator/INSTALL |