Postfx postfixadmin dovecot roundcube centos
Un article de Casys (Canadian Sysadmins).
Sommaire
|
Setup de courriels
Installation de postfix / mysql / apache / dovecot
- Note tout les fichiers sont dans le répertoire /root/apps/ *
- Installation de toutes les applications
yum install spamassassin postfix clamav mysql-server mysql-devel spamassassin httpd php-imap dovecot mod_ssl mod_php php-mysql php-mbstring
- Récupération du fichier de postfixadmin
wget http://superb-east.dl.sourceforge.net/sourceforge/postfixadmin/postfixadmin-2.2.1.1.tar.gz
- décompression du fichier
cd /root/apps tar -zxvf postfixadmin-2.2.1.1.tar.g
Configuration de mysql
- Commit le fichier original
ci -u /etc/my.cnf co -l /etc/my.cnf
- Edition du fichier
vi /etc/my.cnf
Fichier :
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). # old_passwords=1 bind-address = 127.0.0.1 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
- Commit
ci -u /etc/my.cnf
- Configure pour qu'il demarre au démarrage du srv
chkconfig --levels 345 mysqld on
- Démarrage du service
/etc/init.d/mysqld start
Configuration dans le systeme mysql
- etablissement d'une connection dans le systeme mysql
' pour le moment l'usager root n'a pas de mot de passe '
mysql
- Mise en place d'un mot de passe pour l'usagé root
use mysql
update user set Password=PASSWORD('********') where User='root';
flush privileges
ATTENTION mot de passe non présent dans la documentation voir Philippe Archambeault pour le mot de passe
- Création de l'usagé postfix pour mysql et de la BD
create database mails;
use mysql;
insert into user (Host,User,Password) values ('127.0.0.1','postfix',PASSWORD('********'));
insert into user (Host,User,Password) values ('127.0.0.1','postfixWebadmin',PASSWORD('********'));
insert into db (Host,Db,User,Select_priv) values ('127.0.0.1','mails','postfix','Y');
insert into db (Host,Db,User,Create_priv,Select_priv,Insert_priv,Update_priv,Delete_priv,Index_priv,Alter_priv,Create_tmp_table_priv,Lock_tables_priv) values ('127.0.0.1','mails','postfixWebadmin','Y','Y','Y','Y','Y','Y','Y','Y','Y');
flush privileges;
- L'usager postfix sera utilisé par le serveur postfix , donc uniquement lecture des infos stocké dans les tables
- L'usagé postfixWebadmin sera utilisé pour l'interface de gestion web, donc création , supprésion de comptes , etc etc...
Population des données de la BD mails
- connection a mysql sous root
mysql -u root -p
- Création des tables
use mails; CREATE TABLE `alias` ( `address` varchar(255) NOT NULL default '', `goto` text NOT NULL, `domain` varchar(255) NOT NULL default '', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (address) ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Aliases'; CREATE TABLE `domain` ( `domain` varchar(255) NOT NULL default '', `description` varchar(255) NOT NULL default '', `aliases` int(10) NOT NULL default '0', `mailboxes` int(10) NOT NULL default '0', `maxquota` int(10) NOT NULL default '0', `transport` varchar(255) default NULL, `backupmx` tinyint(1) NOT NULL default '0', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (domain) ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Domains'; CREATE TABLE `mailbox` ( `username` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '', `maildir` varchar(255) NOT NULL default '', `quota` int(10) NOT NULL default '0', `domain` varchar(255) NOT NULL default '', `created` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`username`) ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Mailboxes';
Configuration de apache
Sécurisation du fichier httpd.conf
- Mise en place du fichier dans le controleur de révision
mkdir /etc/httpd/conf/RCS ci -u /etc/httpd/conf/httpd.conf co -l /etc/httpd/conf/httpd.conf
vi /etc/httpd/conf/httpd.conf
- Mise en commantaire de certain modules
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule cgi_module modules/mod_cgi.so #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule status_module modules/mod_status.so
- Définition des entrés suivantes:
ServerAdmin root@yourdomain.com
<Directory />
Options none
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options none FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerSignature Off
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
- Commit les modifications
ci -u /etc/httpd/conf/httpd.conf
- Validation de la configuration (syntaxe)
apachectl configtest
- Mise en place d'une page blanche si on utilise l'ip pour accèdé au serveur web.
vi /var/www/html/index.html
Fichier:
<html> <body> </body> </html>
Configuration du virtual host pour l'administration du serveur de courriel
- Lock du fichier de configue de apache & et édition
co -l /etc/httpd/conf/httpd.conf vi /etc/httpd/conf/httpd.conf
- Ajout à la fin
NameVirtualHost 192.168.1.20:80 NameVirtualHost 192.168.1.20:443 include conf/vhosts/*.conf
- Création du répertoire pour les vhosts & du fichier RCS
mkdir /etc/httpd/conf/vhosts/ mkdir /etc/httpd/conf/vhosts/RCS
- Création du virtual host pour postfix
vi /etc/httpd/conf/vhosts/mailadmin_yourdomain_com.conf
Fichier:
<VirtualHost 192.168.1.20:80>
servername mailadmin.yourdomain.com
serveralias mailadmin.yourseconddomaine.com
serveralias ip-192.168.1.20.static.privatedns.com
DocumentRoot /var/www/vhosts/mailadmin_yourdomain_com/html
<Directory /var/www/vhosts/mailadmin_yourdomain_com/html >
Options none
Allowoverride AuthConfig
</Directory>
customlog /var/www/vhosts/mailadmin_yourdomain_com/logs/access_log combined
errorlog /var/www/vhosts/mailadmin_yourdomain_com/logs/error_log
# Faire un REDIRECT vers 443
</VirtualHost>
<VirtualHost 192.168.1.20:443>
servername mailadmin.yourdomain.com
serveralias mailadmin.yourseconddomaine.com
serveralias ip-192.168.1.20.static.privatedns.com
DocumentRoot /var/www/vhosts/mailadmin_yourdomain_com/html
<Directory /var/www/vhosts/mailadmin_yourdomain_com/html >
Options none
Allowoverride AuthConfig
</Directory>
customlog /var/www/vhosts/mailadmin_yourdomain_com/logs/accessSSL_log combined
errorlog /var/www/vhosts/mailadmin_yourdomain_com/logs/errorSSL_log
# Faire un REDIRECT vers 443
</VirtualHost>
- Commit
ci -u /etc/httpd/conf/vhosts/mailadmin_yourdomain_com.conf
- Mise en place de la rotation des logues
vi /etc/logrotate.d/httpd
Ajout
/var/www/vhosts/*/logs/*_log {
missingok
compress
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
- Commit
ci -u /etc/logrotate.d/httpd
- Création des répertoire pour le vhosts
mkdir -p /var/www/vhosts/mailadmin_yourdomain_com/logs/ mkdir -p /var/www/vhosts/mailadmin_yourdomain_com/html/
- Test la config
apachectl configtest
- Redémarre le service
/etc/init.d/httpd restart
Configuration du virtualhost postfixAdmin
- Copie des fichiers de postfixadmin dans le vhost
cp -a /root/apps/postfixadmin-2.2.1.1/* /var/www/vhosts/mailadmin_yourdomain_com/html/
- Modification du fichier de configuration de postfixadmin
vi /var/www/vhosts/mailadmin_yourdomain_com/html/config.inc.php
Modification
// Database Config // mysql = MySQL 3.23 and 4.0 // mysqli = MySQL 4.1 // pgsql = PostgreSQL $CONF['database_type'] = 'mysqli'; $CONF['database_host'] = '127.0.0.1'; $CONF['database_user'] = 'postfixWebadmin'; $CONF['database_password'] = '*******'; $CONF['database_name'] = 'mails'; $CONF['database_prefix'] = '';
Comme toujorus le mot de passe n'est pas present
- Faire le setup sur le site web :
http://ip-192.168.1.20.static.privatedns.com/setup.php
- Définir le compte admin
- ReModifier le fichier de configuration
vi /var/www/vhosts/mailadmin_yourdomain_com/html/config.inc.php
Modifier la ligne :
$CONF['configured'] = true;
- Suppresion du fichier de setup
rm /var/www/vhosts/mailadmin_yourdomain_com/html/setup.php
Configuration de postfix (MTA)
Installation de postfix avec support mysql
- Le package de centos ne supporte pas le backend mysql il faut donc installé un autre rpm.
- Récupération de l'Application avec le support
cd /root/apps/ wget http://www.mirrorservice.org/sites/mirror.centos.org/5.2/centosplus/i386/RPMS/postfix-2.3.3-2.el5.centos.mysql_pgsql.i386.rpm
- exclue postfix pour les autre installation et update
vi /etc/yum.repos.d/CentOS-Base.repo
AJout:
#released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 exclude=posfix*
- Install le package
cd /root/apps/ rpm -Uvh --replacepkgs --nodeps --force postfix-2.3.3-2.el5.centos.mysql_pgsql.i386.rpm
- Commit le fichier original
cu -i /etc/postfix/main.cf co -l /etc/postfix/main.cf
- Edition du fichier
vi /etc/postfix/main.cf
Fichier:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
# Configuration pour mysql virtual mail
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:89
virtual_mailbox_base = /home/virtual_mail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 89
virtual_transport = virtual
virtual_uid_maps = static:89
- commit
ci -u /etc/postfix/main.cf
- Creatio des fichier de configuration mysql
vi /etc/postfix/mysql_virtual_alias_maps.cf
Fichier:
#Syntax with postfix 2.2.x: user = postfix password = ********* hosts = localhost dbname = mails query = SELECT goto FROM alias WHERE address='%s' AND active = 1
- commit
ci -u /etc/postfix/mysql_virtual_alias_maps.cf
vi /etc/postfix/mysql_virtual_domains_maps.cf
Fichier:
#Syntax with postfix 2.2.x: user = postfix password = ******** hosts = localhost dbname = mails query = SELECT domain FROM domain WHERE domain='%s' #optional query to use when relaying for backup MX #query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '0' and active = '1'
- commit
ci -u /etc/postfix/mysql_virtual_domains_maps.cf
vi /etc/postfix/mysql_virtual_mailbox_maps.cf
Fichier:
#Syntax with postfix 2.2.x: user = postfix password = D(k78m38f hosts = localhost dbname = mails query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1
- commit
ci -u /etc/postfix/mysql_virtual_mailbox_maps.cf
- Création du répertoire de stockage pour les courriels & modification des permissions
mkdir /home/virtual_mail chown postfix:mail /home/virtual_mail chmod o-rx -R /home/virtual_mail
- Redemarrage de postfix
/etc/init.d/postfix restart
test de fonctionnalité
- test d'envoie local de courriel
[root@cl-t142-420cl postfix]# telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to hd-t100cl.privatedns.com (127.0.0.1). Escape character is '^]'. 220 hostname.yourdomain.com ESMTP Postfix ehlo toto 250-hostname.yourdomain.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:myemail@gmail.com 250 2.1.0 Ok rcpt to:philippe@yourdomain.com 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> un test de courriel . 250 2.0.0 Ok: queued as 00AFD2AF019C quit 221 2.0.0 Bye Connection closed by foreign host.
- validation de la reception
ls /home/virtual_mail/philippe@yourdomain.com/new
- Vérification que le système n'Est pas openRELAY
[myemail@mailgate ~]$ telnet 192.168.1.20 25 Trying 192.168.1.20... Connected to ip-192.168.1.20.static.privatedns.com. Escape character is '^]'. 220 hostname.yourdomain.com ESMTP Postfix ehlo toto 250-hostname.yourdomain.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:myemail@gmail.com 250 2.1.0 Ok rcpt to:toto@hotmail.com 554 5.7.1 <toto@hotmail.com>: Relay access denied quit 221 2.0.0 Bye Connection closed by foreign host.
Mise en place de la vérification de l'existance de courriel
co -l /etc/postfix/main.cf
Ajout
local_recipient_maps = $virtual_mailbox_maps
- Restart postfix
/etc/init.d/postfix rtestart
Configuration de Dovecot (pop/imap)
- Installation de dovecot
yum install dovecot
- Mise en place du fichier de configuration de dovecot dans le système de RCS
ci -u /etc/dovecot.conf co -l /etc/dovecot.conf
- Edition du fichier
vi /etc/dovecot.conf
Fichier:
protocols = imap pop3
listen = *
login_process_size = 64
default_mail_env = maildir:/home/virtual_mail/%u/
namespace private {
separator = .
prefix = INBOX.
inbox = yes
}
namespace private {
separator = .
prefix =
inbox = yes
hidden = yes
}
mail_access_groups = postfix
mail_privileged_group = postfix
verbose_proctitle = yes
first_valid_uid = 89
first_valid_gid = 89
#umask = 0077
mbox_read_locks = fcntl
mbox_write_locks = fcntl
ssl_disable = yes
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter.
ssl_key_password =
protocol imap {
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
#People who use outlook are fux0red anyway...
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
postmaster_address = postmaster@yourdomain.com
sendmail_path = /usr/sbin/sendmail
}
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
auth_debug = yes
auth_verbose = yes
auth default {
passdb sql {
args = /etc/dovecot-mysql.conf
}
userdb sql {
args = /etc/dovecot-mysql.conf
}
}
- Commit
ci -u /etc/dovecot.conf
- Création des fichiers de configuration mysql.
vi /etc/dovecot-mysql.conf
Fichier
# Database driver: mysql, pgsql driver = mysql # Currently supported schemes include PLAIN, PLAIN-MD5, DIGEST-MD5, and CRYPT. default_pass_scheme = CRYPT # Database options connect = host=localhost dbname=mails user=postfix password=******** password_query = SELECT password FROM mailbox WHERE username = '%u' AND active = '1' user_query = SELECT maildir, 89 AS uid, 89 AS gid FROM mailbox WHERE username = '%u' AND active = '1' # eof
- Redemarré dovecot
/etc/init.d/dovecot restart
- Test de configuration
[root@cl-t142-420cl ~]# telnet 127.0.0.1 110 Trying 127.0.0.1... Connected to hd-t100cl.privatedns.com (127.0.0.1). Escape character is '^]'. +OK Dovecot ready. USER testing@yourdomain.com +OK PASS ********* +OK Logged in. list +OK 1 messages: 1 742 .
- Activation de dovecot au démarrage
chkconfig --levels 345 dovecot on
Configuration du RoundCube (webmail)
Important : La version de php doit être obligatoirement la version 5.2 , Centos 5.2 vient avec la version 5.1 vous devez donc mettre à jour votre version une documentation est disponible ici install php5.2 sur centos
- Téléchargement de l'application
cd /root/apps/ wget http://superb-east.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.2-beta.tar.gz
- Création d'un user dans la base de donnée Mysql
mysql -u root -p
create database roundcubeWebmail;
insert into user (Host,User,Password) values ('localhost','WebmailRoundcube',PASSWORD('*******'));
insert into db Host,Db,User,Create_priv,Select_priv,Insert_priv,Update_priv,Delete_priv,Index_priv,Alter_priv,Create_tmp_table_priv,Lock_tables_priv) values ('localhost','roundcubeWebmail','WebmailRoundcube','Y','Y','Y','Y','Y','Y','Y','Y','Y');
create database roundcubeWebmail;
quit
- Création du virtualHost
vi /etc/httpd/conf/vhosts/webmail_yourdomain_com.conf
Fichier
<VirtualHost 192.168.1.20:80>
servername webmail.yourdomain.com
serveralias webmail.yourseconddomaine.com
serveralias ip-192.168.1.20.static.privatedns.com
DocumentRoot /var/www/vhosts/webmail_yourdomain_com/html
<Directory /var/www/vhosts/webmail_yourdomain_com/html >
Options none
Allowoverride AuthConfig
</Directory>
customlog /var/www/vhosts/webmail_yourdomain_com/logs/access_log combined
errorlog /var/www/vhosts/webmail_yourdomain_com/logs/error_log
# Faire un REDIRECT vers 443
</VirtualHost>
<VirtualHost 192.168.1.20:443>
servername webmail.yourdomain.com
serveralias webmail.yourseconddomaine.com
serveralias ip-192.168.1.20.static.privatedns.com
DocumentRoot /var/www/vhosts/webmail_yourdomain_com/html
<Directory /var/www/vhosts/webmail_yourdomain_com/html >
Options none
Allowoverride AuthConfig
</Directory>
customlog /var/www/vhosts/webmail_yourdomain_com/logs/accessSSL_log combined
errorlog /var/www/vhosts/webmail_yourdomain_com/logs/errorSSL_log
# Faire un REDIRECT vers 443
</VirtualHost>
- Création des répertoires:
mkdir -p /var/www/vhosts/webmail_yourdomain_com/html/ mkdir -p /var/www/vhosts/webmail_yourdomain_com/logs/
- Test de la configuration web & redémarrage
apachectl configtest /etc/init.d/httpd restart
- Déplacement des fichiers de roundcube:
cd /root/apps/ tar -zxvf roundcubemail-0.2-beta.tar.gz cd roundcubemail-0.2-beta cp -a * /var/www/vhosts/webmail_yourdomain_com/html/
- Faire la configuration sur le site web : http://webmail.yourseconddomaine.com/installer
- Mise en place du fichier de configuration
vi /var/www/vhosts/webmail_yourdomain_com/html/config/main.inc.php
Fichier:
<?php
/*
+-----------------------------------------------------------------------+
| Main configuration file |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
*/
$rcmail_config = array();
// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
$rcmail_config['debug_level'] = 1;
// log driver: 'syslog' or 'file'.
$rcmail_config['log_driver'] = 'file';
// Syslog ident string to use, if using the 'syslog' log driver.
$rcmail_config['syslog_id'] = 'roundcube';
// Syslog facility to use, if using the 'syslog' log driver.
// For possible values see installer or http://php.net/manual/en/function.openlog.php
$rcmail_config['syslog_facility'] = LOG_USER;
// use this folder to store log files (must be writeable for apache user)
// This is used by the 'file' log driver.
$rcmail_config['log_dir'] = 'logs/';
// use this folder to store temp files (must be writeable for apache user)
$rcmail_config['temp_dir'] = 'temp/';
// enable caching of messages and mailbox data in the local database.
// this is recommended if the IMAP server does not run on the same machine
$rcmail_config['enable_caching'] = TRUE;
// lifetime of message cache
// possible units: s, m, h, d, w
$rcmail_config['message_cache_lifetime'] = '10d';
// automatically create a new RoundCube user when log-in the first time.
// a new user will be created once the IMAP login succeeds.
// set to false if only registered users can use this service
$rcmail_config['auto_create_user'] = TRUE;
// the mail host chosen to perform the log-in
// leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL connection, enter ssl://hostname:993
$rcmail_config['default_host'] = '127.0.0.1';
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
// IMAP auth type. Can be "auth" (CRAM-MD5), "plain" (PLAIN) or "check" to auto detect.
// Optional, defaults to "check"
$rcmail_config['imap_auth_type'] = null;
// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = '';
// This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['mail_domain'] = '';
// Path to a virtuser table file to resolve user names and e-mail addresses
$rcmail_config['virtuser_file'] = '';
// Query to resolve user names and e-mail addresses from the database
// %u will be replaced with the current username for login.
// The query should select the user's e-mail address as first col
$rcmail_config['virtuser_query'] = '';
// use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used
$rcmail_config['smtp_server'] = '127.0.0.1';
// SMTP port (default is 25; 465 for SSL)
$rcmail_config['smtp_port'] = 25;
// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = '';
// SMTP password (if required) if you use %p as the password RoundCube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '';
// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['smtp_auth_type'] = '';
// SMTP HELO host
// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages
// Leave this blank and you will get the server variable 'server_name' or
// localhost if that isn't defined.
$rcmail_config['smtp_helo_host'] = '';
// Log sent messages
$rcmail_config['smtp_log'] = TRUE;
// how many seconds must pass between emails sent by a user
$rcmail_config['sendmail_delay'] = 0;
// these cols are shown in the message list
// available cols are: subject, from, to, cc, replyto, date, size, encoding, flag
$rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag');
// includes should be interpreted as PHP files
$rcmail_config['skin_include_php'] = FALSE;
// session lifetime in minutes
$rcmail_config['session_lifetime'] = 10;
// check client IP in session athorization
$rcmail_config['ip_check'] = false;
// Use an additional frequently changing cookie to athenticate user sessions.
// There have been problems reported with this feature.
$rcmail_config['double_auth'] = false;
// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
$rcmail_config['des_key'] = 'nrVV&B0crdJL+Fb_jN+ao_zr';
// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$rcmail_config['language'] = null;
// use this format for short date display
$rcmail_config['date_short'] = 'D H:i';
// use this format for detailed date/time formatting
$rcmail_config['date_long'] = 'd.m.Y H:i';
// use this format for today's date display
$rcmail_config['date_today'] = 'H:i';
// add this user-agent to message headers when sending
$rcmail_config['useragent'] = 'RoundCube Webmail/0.2-beta';
// use this name to compose page titles
$rcmail_config['product_name'] = 'RoundCube Webmail';
// only list folders within this path
$rcmail_config['imap_root'] = '';
// store draft message is this mailbox
// leave blank if draft messages should not be stored
$rcmail_config['drafts_mbox'] = 'Drafts';
// store spam messages in this mailbox
$rcmail_config['junk_mbox'] = 'Junk';
// store sent message is this mailbox
// leave blank if sent messages should not be stored
$rcmail_config['sent_mbox'] = 'Sent';
// move messages to this folder when deleting them
// leave blank if they should be deleted directly
$rcmail_config['trash_mbox'] = 'Trash';
// display these folders separately in the mailbox list.
// these folders will also be displayed with localized names
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
// automatically create the above listed default folders on login
$rcmail_config['create_default_folders'] = FALSE;
// protect the default folders from renames, deletes, and subscription changes
$rcmail_config['protect_default_folders'] = TRUE;
// if in your system 0 quota means no limit set this option to TRUE
$rcmail_config['quota_zero_as_unlimited'] = FALSE;
// Set TRUE if deleted messages should not be displayed
// This will make the application run slower
$rcmail_config['skip_deleted'] = FALSE;
// Set true to Mark deleted messages as read as well as deleted
// False means that a message's read status is not affected by marking it as deleted
$rcmail_config['read_when_deleted'] = TRUE;
// When a Trash folder is not present and a message is deleted, flag
// the message for deletion rather than deleting it immediately. Setting this to
// false causes deleted messages to be permanantly removed if there is no Trash folder
$rcmail_config['flag_for_deletion'] = FALSE;
// Behavior if a received message requests a message delivery notification (read receipt)
// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
$rcmail_config['mdn_requests'] = 0;
// Use this charset as fallback for message decoding
$rcmail_config['default_charset'] = 'ISO-8859-1';
// Make use of the built-in spell checker. It is based on GoogieSpell.
// Since Google only accepts connections over https your PHP installatation
// requires to be compiled with Open SSL support
$rcmail_config['enable_spellcheck'] = TRUE;
// Set the spell checking engine. 'googie' is the default. 'pspell' is also available,
// but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here.
$rcmail_config['spellcheck_engine'] = 'googie';
// For a locally installed Nox Spell Server, please specify the URI to call it.
// Get Nox Spell Server from http://orangoo.com/labs/?page_id=72
// Leave empty to use the Google spell checking service, what means
// that the message content will be sent to Google in order to check spelling
$rcmail_config['spellcheck_uri'] = '';
// These languages can be selected for spell checking.
// Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch');
// Leave empty for default set of Google spell check languages, should be defined
// when using local Pspell extension
$rcmail_config['spellcheck_languages'] = NULL;
// path to a text file which will be added to each sent message
// paths are relative to the RoundCube root folder
$rcmail_config['generic_message_footer'] = '';
// add a received header to outgoing mails containing the creators IP and hostname
$rcmail_config['http_received_header'] = false;
// this string is used as a delimiter for message headers when sending
// leave empty for auto-detection
$rcmail_config['mail_header_delimiter'] = NULL;
// session domain: .example.org
$rcmail_config['session_domain'] = '';
// This indicates which type of address book to use. Possible choises:
// 'sql' (default) and 'ldap'.
// If set to 'ldap' then it will look at using the first writable LDAP
// address book as the primary address book and it will not display the
// SQL address book in the 'Address Book' view.
$rcmail_config['address_book_type'] = 'sql';
// In order to enable public ldap search, configure an array like the Verisign
// example further below. if you would like to test, simply uncomment the example.
//
// If you are going to use LDAP for individual address books, you will need to
// set 'user_specific' to true and use the variables to generate the appropriate DNs to access it.
//
// The recommended directory structure for LDAP is to store all the address book entries
// under the users main entry, e.g.:
//
// o=root
// ou=people
// uid=user@domain
// mail=contact@contactdomain
//
// So the base_dn would be uid=%fu,ou=people,o=root
// The bind_dn would be the same as based_dn or some super user login.
/**
* example config for Verisign directory
*
* $rcmail_config['ldap_public']['Verisign'] = array(
* 'name' => 'Verisign.com',
* 'hosts' => array('directory.verisign.com'),
* 'port' => 389,
* 'use_tls' => false,
* 'user_specific' => false, // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
* // %fu - The full username provided, assumes the username is an email
* // address, uses the username_domain value if not an email address.
* // %u - The username prior to the '@'.
* // %d - The domain name after the '@'.
* 'base_dn' => '',
* 'bind_dn' => '',
* 'bind_pass' => '',
* 'writable' => false, // Indicates if we can write to the LDAP directory or not.
* // If writable is true then these fields need to be populated:
* // LDAP_Object_Classes, required_fields, LDAP_rdn
* 'LDAP_Object_Classes' => array("top", "inetOrgPerson"), // To create a new contact these are the object classes to specify (or any other classes you wish to use).
* 'required_fields' => array("cn", "sn", "mail"), // The required fields needed to build a new contact as required by the object classes (can include additional fields not required by the object classes).
* 'LDAP_rdn' => 'mail', // The RDN field that is used for new entries, this field needs to be one of the search_fields, the base of base_dn is appended to the RDN to insert into the LDAP directory.
* 'ldap_version' => 3, // using LDAPv3
* 'search_fields' => array('mail', 'cn'), // fields to search in
* 'name_field' => 'cn', // this field represents the contact's name
* 'email_field' => 'mail', // this field represents the contact's e-mail
* 'surname_field' => 'sn', // this field represents the contact's last name
* 'firstname_field' => 'gn', // this field represents the contact's first name
* 'sort' => 'cn', // The field to sort the listing by.
* 'scope' => 'sub', // search mode: sub|base|list
* 'filter' => '', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
* 'global_search' => true, // perform a global search for address auto-completion on compose
* 'fuzzy_search' => true); // server allows wildcard search
*/
// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'] = array();
// allow users to add and delete sender identities
$rcmail_config['multiple_identities'] = true;
// try to load host-specific configuration
// see http://trac.roundcube.net/wiki/Howto_Config for more details
$rcmail_config['include_host_config'] = false;
// don't let users set pagesize to more than this value if set
$rcmail_config['max_pagesize'] = 200;
// mime magic database
$rcmail_config['mime_magic'] = '/usr/share/misc/magic';
// default sort col
$rcmail_config['message_sort_col'] = 'date';
// default sort order
$rcmail_config['message_sort_order'] = 'DESC';
// THIS OPTION WILL ALLOW THE INSTALLER TO RUN AND CAN EXPOSE SENSITIVE CONFIG DATA.
// ONLY ENABLE IT IF YOU'RE REALLY SURE WHAT YOU'RE DOING!
$rcmail_config['enable_installer'] = false;
// Log successful logins
$rcmail_config['log_logins'] = false;
/**
* 'Delete always'
* This setting reflects if mail should be always marked as deleted,
* even if moving to "Trash" fails. This is necessary in some setups
* because a) people may not have a Trash folder or b) they are over
* quota (and Trash is included in the quota).
*
* This is a failover setting for iil_C_Move when a message is moved
* to the Trash, and not the same as "delete_right_away".
*/
$rcmail_config['delete_always'] = false;
/***** these settings can be overwritten by user's preferences *****/
// skin name: folder from skins/
$rcmail_config['skin'] = 'default';
// show up to X items in list view
$rcmail_config['pagesize'] = 40;
// use this timezone to display date/time
$rcmail_config['timezone'] = 'auto';
// is daylight saving On?
$rcmail_config['dst_active'] = (bool)date('I');
// prefer displaying HTML messages
$rcmail_config['prefer_html'] = TRUE;
// display images in mail from known senders
$rcmail_config['addrbook_show_images'] = FALSE;
// compose html formatted messages by default
$rcmail_config['htmleditor'] = FALSE;
// show pretty dates as standard
$rcmail_config['prettydate'] = TRUE;
// save compose message every 300 seconds (5min)
$rcmail_config['draft_autosave'] = 300;
// default setting if preview pane is enabled
$rcmail_config['preview_pane'] = FALSE;
// Clear Trash on logout
$rcmail_config['logout_purge'] = FALSE;
// Compact INBOX on logout
$rcmail_config['logout_expunge'] = FALSE;
// Display attached images below the message body
$rcmail_config['inline_images'] = TRUE;
// end of config file
?>
vi /var/www/vhosts/webmail_yourdomain_com/html/config/db.inc.php
Fichier:
<?php /* +-----------------------------------------------------------------------+ | Configuration file for database access | | | | This file is part of the RoundCube Webmail client | | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | | Licensed under the GNU GPL | | | +-----------------------------------------------------------------------+ */ $rcmail_config = array(); // PEAR database DSN for read/write operations // format is db_provider://user:password@host/database // currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql $rcmail_config['db_dsnw'] = 'mysql://WebmailRoundcube:*******@localhost/roundcubeWebmail'; // postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail'; // sqlite example: 'sqlite://./sqlite.db?mode=0646'; // PEAR database DSN for read only operations (if empty write database will be used) // useful for database replication $rcmail_config['db_dsnr'] = ''; // maximum length of a query in bytes $rcmail_config['db_max_length'] = 512000; // 500K // use persistent db-connections // beware this will not "always" work as expected // see: http://www.php.net/manual/en/features.persistent-connections.php $rcmail_config['db_persistent'] = FALSE; // you can define specific table names used to store webmail data $rcmail_config['db_table_users'] = 'users'; $rcmail_config['db_table_identities'] = 'identities'; $rcmail_config['db_table_contacts'] = 'contacts'; $rcmail_config['db_table_session'] = 'session'; $rcmail_config['db_table_cache'] = 'cache'; $rcmail_config['db_table_messages'] = 'messages'; // you can define specific sequence names used in PostgreSQL $rcmail_config['db_sequence_users'] = 'user_ids'; $rcmail_config['db_sequence_identities'] = 'identity_ids'; $rcmail_config['db_sequence_contacts'] = 'contact_ids'; $rcmail_config['db_sequence_cache'] = 'cache_ids'; $rcmail_config['db_sequence_messages'] = 'message_ids'; // end db config file ?>
- Change permission pour les répertoires temp et logs
chown apache:apache /var/www/vhosts/webmail_yourdomain_com/html/temp/ /var/www/vhosts/webmail_yourdomain_com/html/logs/ chmod g+w l/var/www/vhosts/webmail_yourdomain_com/html/ogs/ chmod g+w /var/www/vhosts/webmail_yourdomain_com/html/temp
- Suppression de l'installeur
rm -rf /var/www/vhosts/webmail_yourdomain_com/html/installer/
