Squirrelmail for Windows

Brad Robinson gets his
cremaster muscle in a twist and has a ball driving himself nuts, trying to get Mercury to interface with SquirrelMail, while managing to stay out of the sack, despite feeling a bit knackered and somewhat testy, and comes to the conclusion that WebMail really is the dog's bollocks. After his great success, Brad plans to withdraw to the countryside with a couple of acres and take up professional pocket billiards..
Webmail is a method of accessing email through a Web Browser. Although limited in options compared to full email clients such as Outlook, Eudora and the like, webmail has obvious advantages. Email can be read and sent from anywhere with an internet connection. Additionally, email can be accessed through firewalls which allow port 80 throughput, which most of them do.
Squirrel Mail on a Windows Box
Windows 95/98/Me/NT/2k/XP: While Apache and PHP will run on Windows 95/98/ME, I recommend using a more stable NT-based version of Windows. You do not necessarily need Windows NT or 2000 Server, since Apache will run fine on a Workstation, allowing unlimited connections (although IIS on Workstation is limited to 10 connections). If you're not sure what to go with, use Windows 2000 Pro. It has been around a while and is well supported by PHP. Note Windows XP has a known problem when handling some php intensive applications.
Apache
- Download the lastest version of Apache (2.0.*) for Win32 from Apache
- Choose Custom Install for Apache and install into the root of C:\ (yep, select C:\) rather than the default C:\Program Files\Apache Group. Apache will then be in C:\apache2, which is a lot easier to type
- Once Apache is installed, open up a browser window and type http://127.0.0.1 in the address bar. You should see the default Apache webpage. Do not proceed any further until you can see this default page
- At this point, stop Apache from running until instructed to start it again
- Edit Apache's httpd.conf file. Locate the following file: \Apache2\conf\httpd.conf
- Add the following two lines to the bottom of the httpd.conf file:
LoadModule php4_module "c:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php
[Note the path in line 1 above; change it if you change it..]
PHP
a. Installation and file management
- Download the lastest Windows Binary File, i.e. 4.3.6-win32 from PHP.net
- Extract the files to the root of C:\ This will create the directory C:\php-4.3.x-Win32
- Rename this folder to C:\PHP
- Copy the file php4ts.dll from C:\PHP to:
C:\windows\system (for Windows 9x/Me)
C:\winnt\system32 (for Windows NT/2000/XP) directory, overwriting any older file
- Copy the following .dll files from PHP\extensions\ to:
C:\windows\system (for Windows 9x/Me)
C:\winnt\system32 (for Windows NT/2000/XP) directory, overwriting any older file
php_gettext.dll
php_imap.dll
- Copy all of the .dll files from from C:\PHP\dlls to:
C:\windows\system (for Windows 9x/Me)
C:\winnt\system32 (for Windows NT/2000/XP) directory, overwriting any older file
b. Set up PHP Configuration File
The next step is to set up a valid configuration file for PHP, php.ini. There are two ini files distributed in the zip file, php.ini-dist and php.ini-recommended. Use
php.ini-recommended, as the default settings in this file are optimised for performance and security
Copy php.ini-recommended from C:\PHP\ to a directory where PHP is able to find. By default PHP searches for php.ini in your Windows directory:
On Windows 9x/ME/XP, copy php.ini-recommended to your %WINDIR%, which is typically C:\Windows
On Windows NT/2000 copy php.ini-recommended to your %WINDIR% or %SYSTEMROOT%, which is typically C:\WINNT. Rename php.ini-recommended to
php.ini
If you're using NTFS on Windows NT, 2000 or XP, make sure that the user running the webserver has
read permissions to your php.ini (e.g. make it readable by Everyone).
c. Edit php.ini:
You need to change the 'extension_dir' setting to point to your php-install-dir, or where you have placed
your 'php4ts.dll':
extension_dir = "C:\winnt\system32" [include quotes]
Set the 'doc_root' to point to your Web Server's document_root:
doc_root = "C:\Apache2\htdocs" [include quotes]
You will need to enable two Windows extensions settings. This is done by unremarking the leading ; from the extension
you want to load. Locate Windows Extensions in your php.ini file:
Change ;extension=php_gettext.dll to extension=php_gettext.dll
Change ;extension=php_imap.dll to extension=php_imap.dll
Save your php.ini file
Test PHP
To be certain that PHP works, create a file called
test.php in your web document root directory (i.e., c:\apache\htdocs). Using Notepad or another text editor, place the following text in the file:
<?php phpinfo();?>
Save and close the document. Start Apache again. Open a browser window and go to http://127.0.0.1/test.php. If you see a
detailed, fancy webpage with lots of information about your PHP installation then PHP is working. Verify
that the
IMAP and
gettext extensions are working by finding them listed on the page.
Note: A trap for young players - Make sure that the test.php file that you created is not actually test.php.txt
Change Windows Explorer's view so that you can see all extensions
[nice to see you and I are still classed as young players ourselves then Brad -- Andy].
Squirrelmail
Download the latest stable version of Squirrelmail. The current zipped file (1.4.3.RC1) seems to be corrupted
so download squirrelmail-1.4.3.RC1.tar.gz Your can extract this file the same way that you can extract a standard
ziiped file.
If squirrelmail is the only thing the web server will be used, you can delete every other file in C:\apache\htdocs
Extract the Squirrelmail file to your htdocs directory. You can either put the files in the root of your web
documents if Squirrel is the only thing the web site will be used for or you can put them in a subdirectory
like /mail. If Squirrel is the only thing running on the server I suggest using the root since it will mean less
to type each time for the user.
Now you need to modify the Squirrelmail's config.php file to set up your site configuration. Squirrelmail's default
config_default.php file can be found in the config\ directory:
Rename
config_default.php to
config.php
Open config.php with a text editor
Locate the following line:
$smtpServerAddress = 'localhost';
Change
'localhost' to the IP address or domain name of your SMTP server
Locate the following line:
$imapServerAddress = 'localhost';
Again change
'localhost' to the IP address or domain name of your SMTP server
Save config.php
Mercury
Set up Mercury Mail and then install the
IMAP Server, if it wasn't added during installation.
Installing IMAP
Internet Message Access Protocol is gradually replacing POP as the main protocol used by email clients in communicating with email servers. Using IMAP an email client program can not only retrieve email but can also manipulate messages stored on the server, without having to actually retrieve the messages. So messages can be deleted, have their status changed, multiple mail boxes can be managed, etc. Additionally emails can be retrieved through a web browser, hence
webmail.
Inside Mercury, go to the
Configuration Menu and select
Protocol Modules:
Tick the IMAP Server option:
Click on OK. Nothing obvious happens. Changes take effect after restarting Mercury..
Testing Time
Open a browser window and go to the following link:
i.e. http://192.168.0.2/mail/index.php - Make sure that the IP address that you use is the IP address of the Web Server. Also take into account that if you installed Squirrelmail into the root of Apache's htdocs directory, the link will be:
http://192.168.0.2/index.php
With any luck, you should be looking at the login screen for Squirrelmail. Congratulations!!!
Links
SquirrelMail Website
Mercury Mail Website
Apache Website
PHP Website