Implantation

Ce tutoriel développe la mise en place d'un Webmail avec SquirrelMail sous Apache2, Postfix et courier-imap. Pour un minimum de sécurité vous devez utiliser IMAPS et HTTPS.


Installation des packages

Postfix
Courier-imap


apache2-modules-2.0.53-9.2.102mdk
apache-conf-2.0.53-5mdk
apache2-mod_php-2.0.53_4.3.10-7mdk
apache2-common-2.0.53-9.2.102mdk
apache2-2.0.53-9.2.102mdk

php-pear-4.3.10-3.2.102mdk
php-ini-4.3.10-3mdk
php-imap-4.3.10-6.1.102mdk
php-ldap-4.3.10-6mdk

libmysql14-4.1.11-1.1.102mdk
MySQL-common-4.1.11-1.1.102mdk
MySQL-client-4.1.11-1.1.102mdk
MySQL-4.1.11-1.1.102mdk

squirrelmail-1.4.4-5mdk

apache2_2.0.54-4_i386.deb
apache2-common_2.0.54-4_i386.deb
apache2-mpm-prefork_2.0.54-4_i386.deb
apache2-utils_2.0.54-4_i386.deb
libapache2-mod-php4_4.3.10-15_i386.deb

php4-imap_4.3.10-15_i386.deb
php4-ldap_4.3.10-15_i386.deb
php4-mysql_4.3.10-15_i386.deb
php4-pear_4.3.10-15_i386.deb

libmysqlclient12_4.0.24-10_i386.deb
mysql-client_4.0.24-10_i386.deb
mysql-common_4.0.24-10_i386.deb
mysql-server_4.0.24-10_i386.deb

squirrelmail_1.4.4-5_all.deb
squirrelmail-locales_1.4.4-20050308-1_all.deb



Après l'installation des packages, vérifiez la présence des lignes suivantes :

srv8:~# grep imap /etc/php4/apache2/php.ini :
extension=imap.so

srv8:~# grep ldap /etc/php4/apache2/php.ini
extension=ldap.so


Si elles sont absentes, ajoutez les :

srv8:~# vi /etc/php4/apache2/php.ini :
extension=imap.so

extension=ldap.so



Configuration de MySQL

Si vous n'avez pas encore créé votre mot de passe root pour MySQL :

srv8:~# mysql -u root
mysql> SET PASSWORD FOR root@localhost=PASSWORD('mysqlpassword');
mysql> SET PASSWORD FOR root@srv8.dmz.alex.fr=PASSWORD('mysqlpassword');
mysql> quit
Bye



Création de la base squirrelmail :

srv8:~# mysqladmin -p create squirrelmail
Enter password:



Création du compte squirreluser@localhost et changement des droits sur la base squirrelmail :

srv8:~# mysql -u root -p
Enter password:

mysql> GRANT select,insert,update,delete ON squirrelmail.* TO squirreluser@localhost IDENTIFIED BY 'sqpassword';
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye



Création des tables address, userprefs et global_abook pour stocker les différentes informations des utilisateurs SquirrelMail.

Créez le fichier squirrelmail.sql :

use squirrelmail;

CREATE TABLE address (
     owner varchar(128) DEFAULT '' NOT NULL,
     nickname varchar(16) DEFAULT '' NOT NULL,
     firstname varchar(128) DEFAULT '' NOT NULL,
     lastname varchar(128) DEFAULT '' NOT NULL,
     email varchar(128) DEFAULT '' NOT NULL,
     label varchar(255),
     PRIMARY KEY (owner,nickname),
     KEY firstname (firstname,lastname)
);

CREATE TABLE userprefs (
     user varchar(128) DEFAULT '' NOT NULL,
     prefkey varchar(64) DEFAULT '' NOT NULL,
     prefval BLOB DEFAULT '' NOT NULL,
     PRIMARY KEY (user,prefkey)
);

CREATE TABLE global_abook (
     owner varchar(128) DEFAULT '' NOT NULL,
     nickname varchar(16) DEFAULT '' NOT NULL,
     firstname varchar(128) DEFAULT '' NOT NULL,
     lastname varchar(128) DEFAULT '' NOT NULL,
     email varchar(128) DEFAULT '' NOT NULL,
     label varchar(255),
     PRIMARY KEY (owner,nickname),
     KEY firstname (firstname,lastname)
);



Inserez ces tables dans MySQL :

srv8:~# mysql -u root -p < squirrelmail.sql



Configuration d'Apache2

Pour plus de sécurité, utilisez HTTPS (voir Apache2).

Editez le fichier /etc/httpd/webapps.d/73_squirrelmail.conf pour adapter l'alias :

<IfModule mod_alias.c>
Alias /squirrelmail /var/www/html/squirrelmail
</IfModule>
<Directory /var/www/html/squirrelmail>
   <IfModule mod_php4.c>
     php_admin_value session.bug_compat_42 0
# Otherwise can't send mails
     php_admin_value safe_mode 0
# Misc
     php_flag register_globals off
# Other increased PHP parameters
     php_admin_value memory_limit 64M
     php_admin_value post_max_size 17M
     php_admin_value upload_max_filesize 16M
     php_admin_value max_execution_time 120
   </IfModule>
## To force https connection
#    <IfModule mod_ssl.c>
#      SSLRequireSSL
#      SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
#    </IfModule>
</Directory>

Créez un lien symbolique pour activer l'alias :

srv8:~# ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf

srv8:~# /etc/init.d/apache2 restart























Configuration de SquirrelMail

Il suffit de d'utiliser le configurateur SquirrelMail :

[root@srv8 root]# /var/www/html/squirrelmail/config/conf.pl

srv8:~# /usr/sbin/squirrelmail-configure



SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color on
S   Save data
Q   Quit

Command >> 1

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1.  Organization Name      : SquirrelMail
2.  Organization Logo      : ../images/sm_logo.png
3.  Org. Logo Width/Height : (308/111)
4.  Organization Title     : SquirrelMail $version
5.  Signout Page           :
6.  Top Frame              : _top
7.  Provider link          : http://www.squirrelmail.org/
8.  Provider name          : SquirrelMail

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 2

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : alex.fr
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

A.  Update IMAP Settings   : imaps.alex.fr:993 (courier)
B.  Update SMTP Settings   : smtp.alex.fr:25

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> A

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain : alex.fr
2.  Invert Time : false
3.  Sendmail or SMTP : SMTP

IMAP Settings
--------------
4.  IMAP Server            : imaps.alex.fr
5.  IMAP Port              : 993
6.  Authentication type    : login
7.  Secure IMAP (TLS)      : true
8.  Server software        : courier
9.  Delimiter              : detect

B.  Update SMTP Settings   : smtp.alex.fr:25
H.  Hide IMAP Server Settings

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> B

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : alex.fr
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

SMTP Settings
-------------
4.  SMTP Server           : smtp.alex.fr
5.  SMTP Port             : 25
6.  POP before SMTP       : false
7.  SMTP Authentication   : none
8.  Secure SMTP (TLS)     : false

A.  Update IMAP Settings  : imaps.alex.fr:993 (courier)
H.  Hide SMTP Settings

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 3

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Folder Defaults
1.  Default Folder Prefix         :
2.  Show Folder Prefix Option     : false
3.  Trash Folder                  : INBOX.Trash
4.  Sent Folder                   : INBOX.Sent
5.  Drafts Folder                 : INBOX.Drafts
6.  By default, move to trash     : true
7.  By default, move to sent      : true
8.  By default, save as draft     : true
9.  List Special Folders First    : true
10. Show Special Folders Color    : true
11. Auto Expunge                  : true
12. Default Sub. of INBOX         : true
13. Show 'Contain Sub.' Option    : false
14. Default Unseen Notify         : 2
15. Default Unseen Type           : 1
16. Auto Create Special Folders   : true
17. Folder Delete Bypasses Trash  : false
18. Enable /NoSelect folder fix   : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 4

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1.  Data Directory              : (Debian) /var/lib/squirrelmail/data/
1.  Data Directory              : (Mandrivia) /var/lib/squirrelmail/prefs
2.  Attachment Directory        : /var/spool/squirrelmail/attach/
3.  Directory Hash Level        : 0
4.  Default Left Size           : 150
5.  Usernames in Lowercase      : false
6.  Allow use of priority       : true
7.  Hide SM attributions        : false
8.  Allow use of receipts       : true
9.  Allow editing of identity   : true/true
10. Allow server thread sort    : false
11. Allow server-side sorting   : false
12. Allow server charset search : true
13. Enable UID support          : true
14. PHP session name            : SQMSESSID

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 6

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Address Books
1.  Change LDAP Servers
2.  Use Javascript Address Book Searc           : false
3.  Global file address book                    :
4.  Allow writing into global file address book : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 8

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
    1. filters
    2. calendar
    3. abook_take
    4. newmail
    5. message_details

Available Plugins:
    6. translate
    7. info
    8. delete_move_next
    9. squirrelspell
    10. spamcop
    11. fortune
    12. administrator
    13. bug_report
    14. sent_subfolders
    15. mail_fetch
    16. listcommands

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 9

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Database
1.  DSN for Address Book   : mysql://squirreluser:sqpassword@localhost/squirrelmail
2.  Table for Address Book : address

3.  DSN for Preferences    : mysql://squirreluser:sqpassword@localhost/squirrelmail
4.  Table for Preferences  : userprefs
5.  Field for username     : user
6.  Field for prefs key    : prefkey
7.  Field for prefs value  : prefval

8.  DSN for Global Address Book            : mysql://squirreluser:sqpassword@localhost/squirrelmail
9.  Table for Global Address Book          : global_abook
10. Allow writing into Global Address Book : false
11. Allow listing of Global Address Book   : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> 10

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : fr_FR
2.  Default Charset        : iso-8859-1
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> R
...
Command >> S
Data saved in config.php
Press enter to continue...

Command >> Q

Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!



Connexion au Webmail

https://webmail.alex.fr/squirrelmail/







Dernière modification : 05/12/05

 

Copyright © 04/02/2004, Arnofear

Contrat Creative Commons Ce document est publié sous licence Creative Commons
Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique :
http://creativecommons.org/licenses/by-nc-sa/3.0/deed.fr