$header (shorthand for $message->header) is not known when this is a raw
[squirrelmail.git] / INSTALL
CommitLineData
d68a3926 1Installing SquirrelMail
2=======================
3
3b3d853f 4Table of Contents:
5 1. (PHP4) Configure your webserver to work with PHP4
6 2. (IMAP) Setting up IMAP (not covered)
7 3. (INSTALL) Obtaining and installing SquirrelMail
8 4. (RUN) Running SquirrelMail
9 5. (CHARSETS) Russian Charsets
10
11
12
13
17cec454 141. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP4
15---------------------------------------------
f8f9bed9 16
17cec454 17 If your webserver does not already have PHP4 you must configure it
18 to work with PHP4. SquirrelMail uses the standard suffix .php for
19 all PHP4 files. This is a quick and dirty guide to installing PHP4
20 to run as CGI under Apache. How you end up doing this is up to you
21 (your mileage may vary).
9b57e848 22
8905fa13 23 You will need at least PHP v4.0.6. If you need to upgrade please go
24 ahead and install it now.
eb0a8c50 25
17cec454 26a. Obtaining and compiling PHP4
f11c804f 27
e9c378fe 28 SquirrelMail has not been extensively tested for use with PHP 4.3.x.
29 See the ReleaseNotes file.
f8f9bed9 30
17cec454 31 Point your favorite webserver at http://www.php.net/version4/ and
32 download the source. Untar (tar xvfz filename-you-downloaded.tgz)
33 the source, cd into the directory and run configure. To make PHP4
34 work with SquirrelMail a commandline like this should do:
f8f9bed9 35
17cec454 36 ./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext
f8ba9180 37
17cec454 38 If you have a database like MySQL you might want to add something
39 like --with-mysql to get database functionality.
40
45c0a3a3 41 If you're going to use LDAP in the addressbook, you must compile PHP4
42 with --with-ldap (see the PHP4 docs for more information).
43
17cec454 44 Run make to build the binary file. This will generate a binary file
45 called "php". Move this file into a CGI-directory.
46
47 You might also want to read the INSTALL file in the PHP-distribution
48 :-)
49
2a32fc83 50b. Changing php.ini
51
52 PHP defaults to look for php.ini (PHP's configuration file) in
53 /usr/local/lib. However, for security reasons, it is suggested
54 that the location of this file is changed to someplace else. This
55 can be done at configure time with the configuration directive
56 --with-config-file-path=PATH.
57
a167feaf 58 Edit the php.ini file and make sure session.use_cookies is 1. Also
59 be sure to change the session.save_path to someplace that can only
60 be read and written to by the webserver. session.save_path is the
2a32fc83 61 location that PHP's session data will be written to.
62
a167feaf 63 SECURITY WARNING - If a user has access to write PHP scripts on your
64 system and knows the location where PHP stores session data, he
65 could get a listing of the sessions being used and then read a given
66 session's data with his own PHP script. Caution should be used when
67 setting up permissions and locations of php.ini and the session data.
2a32fc83 68
76911253 69 FILE UPLOADS - Note that sending attachments will not work if your
1067414d 70 "file_uploads" setting is "Off". Squirrelmail requires that setting
76911253 71 enabled in order to be able to attach files.
1067414d 72
2a32fc83 73c. Setting up .php files to use PHP4
17cec454 74
75 You need to create a .htaccess file in you SquirrelMail directory
76 that looks something like this:
77
78 AddType application/php4script .php
79 Action application/php4script /cgi-bin/php
80
81 You could also add these lines to your Apache configuration file.
82
2a32fc83 83d. Running into trouble
17cec454 84
85 Setting up Apache with PHP4 can be a non-trivial task. Read the PHP4
86 and Apache documentation carefully if you run into trouble. If you
87 have an experienced system administrator around ask her/him to help
88 you.
89
902. SETTING UP IMAP
91------------------
92
93 This is not covered here :-/
94
953. OBTAINING AND INSTALLING SQUIRRELMAIL
96----------------------------------------
97
98 SquirrelMail is still under development. Therefore you should always
99 get the newest version around. Look at
429f8906 100 http://www.squirrelmail.org/index.php3?page=5 to see what it
17cec454 101 is. If you want to be bleeding edge you might want to consider using
102 the latest CVS version (with the latest and most fashionable of
103 bugs).
104
105a. Download SquirrelMail
106
107 Get SquirrelMail from the address above if you do not have it or are
108 uncertain if you have the newest version. Untar (again tar xvfz
109 filename.tgz) SquirrelMail in a directory that is readable for your
110 webserver.
111
112b. Setting up directories
113
114 SquirrelMail uses two directories to store user configuration and
115 attachments that are about to be sent. You might want to have these
116 directories outside of your web tree.
117
118 The data directory is used for storing user preferences, like
119 signature, name and theme. When unpacking the sources this directory
b731cd83 120 is created as data/ in your SquirrelMail directory. This directory
17cec454 121 must be writable by the webserver. If your webserver is running as
b731cd83 122 the user "nobody" you can fix this by running:
65b14f90 123
390372b4 124 $ chown -R nobody data
125 $ chgrp -R nobody data
4bc627ae 126
127 Keep in mind that with different installations, the web server could
ff65039a 128 typically run as userid/groupid of nobody/nobody, nobody/nogroup,
129 apache/apache or www-data/www-data. The best way to find out is to read
130 the web server's configuration file.
4bc627ae 131
17cec454 132 There also needs to be a directory where attachments are stored
133 before they are sent. Since personal mail is stored in this
134 directory you might want to be a bit careful about how you set it
135 up. It should be owned by another user than the webserver is running
136 as (root might be a good choice) and the webserver should have write
137 and execute permissions on the directory, but should not have read
138 permissions. You could do this by running these commands (still
139 granted that the webserver is running as nobody/nobody)
140
390372b4 141 $ cd /var/some/place
142 $ mkdir SomeDirectory
143 $ chgrp -R nobody SomeDirectory
144 $ chmod 730 SomeDirectory
17cec454 145
146 If you trust all the users on you system not to read mail they are
147 not supposed to read change the last line to chmod 777 SomeDirectory
390372b4 148 or simply use /tmp as you attachments directory.
149
4bc627ae 150 If a user is aborting a mail but has uploaded some attachments to it
390372b4 151 the files will be lying around in this directory forever if you do not
152 remove them. To fix this, it is recommended to create a cron job that
153 deletes everything in the attachment directory. Something similar
4bc627ae 154 to the following will be good enough:
390372b4 155
156 $ cd /var/attach/directory
157 $ rm -f *
4bc627ae 158
159 However, this will delete attachments that are currently in use by people
160 sending email when the cron job runs. You can either (1) make sure that
161 the cron job runs at an obscure hour and hope that nobody gets upset, or
162 (2) you can run a modified version of the commands above. Check out the
163 man pages for other commands such as 'find' or 'tmpreaper'.
164
165 One sample script you could set up that would erase all attachments, but
166 wouldn't erase preferences, address books, or the like (just in case your
167 attachment directory is the same as your data directory) might look like
168 this:
169
170 $ rm `find /var/attach/directory -atime +2 | grep -v "\." | grep -v _`
171
172 Remember to be careful with whatever method you do use, and to test out
173 the command before it potentially wipes out everyone's preferences.
17cec454 174
175c. Setting up SquirrelMail
176
be8e07f8 177 There are two ways to configure Squirrelmail. In the config/ directory,
178 there is a perl script called conf.pl that will aid you in the
390372b4 179 configuration process. This is the recommended way of handling
be8e07f8 180 the config.
181
390372b4 182 You can also copy the config/config_default.php file to config/config.php
be8e07f8 183 and edit that manually.
65b14f90 184
17cec454 1854. RUNNING SQUIRRELMAIL
186-----------------------
65b14f90 187
429f8906 188 Point your browser at the URL at which SquirrelMail is installed. A
189 possible example of this is:
190 http://www.yourdomain.com/squirrelmail
191
3d8fe250 192 It should be pretty straight forward to use. Some more documentation
429f8906 193 might show up one day or another.
8c086db6 194
195
1965. RUSSIAN CHARSETS
197-------------------
198
199 For information on how to make SquirrelMail work with Russian
200 Apache, see the README.russian_apache in the doc/ subdirectory.