Voici un tutoriel d’installation pour le groupe Postfix, Dovecot et roundcube

Installer un serveur de messagerie sur ubuntu 14.04 ( POSTFIX – DOVECOT -ROUNDCUBE)


  • Serveur : Ubuntu 14.04 LTS

Ce tutoriel explique commant creer un serveur de mail sous ubuntu 14.04

Voici les paquets que nous allons utiliser

  • Postfix ( for sending )
  • Dovecot ( for receiving )
  • ROUNDCUBE ( for webmail access )

Etape 1 – Installer le server de mail

Installer l’hôte dans /etc/hosts mail.bsymedia.com

Installer et configurer postfix

Maintenant vous pourrez afficher ces détails. Choisissez vos informations et remplacer bsymedia.com par votre nom de domaine.

Step 3
Configure postfix for SMTP-AUTH using Dovecot SASL by adding the below lines to postfix config file /etc/postfix/main.cf.

Step 4
Now generate a digital certificate for tls. Issue the commands one by one and provide details as per your domain.

Step 5
Now configure certificate path :

Step 6
Now enable submission for smtp access through 587. Open /etc/postfix/master.cf file and uncomment below lines.

Step 7
Now install Dovecot SASL by typing the below command. sudo apt-get install dovecot-common

Step 8
Make changes to the files as follows.
Open /etc/dovecot/conf.d/10-master.conf file and find # Postfix smtp-auth line ( line no:95 ) and add the below lines .

Open /etc/dovecot/conf.d/10-auth.conf file and find (line no:100) auth_mechanisms = plain and replace auth_mechanisms = plain login

Step 9
Restart postfix and dovecot services


Step 1
Install dovecot using the below command :
sudo apt-get install dovecot-imapd dovecot-pop3d

Step 2
Now configure mailbox. Open /etc/dovecot/conf.d/10-mail.conf file and find (Line no:30 ) mail_location = mbox:~/mail:INBOX=/var/mail/%u Replace with mail_location = maildir:~/Maildir

Step 3
Now change pop3uidlformat . Open /etc/dovecot/conf.d/20-pop3.conf file and find and uncomment the below line ( Line no : 50 )
pop3_uidl_format = %08Xu%08Xv

Step 4
Now enable SSL . Open /etc/dovecot/conf.d/10-ssl.conf file and find and uncomment the below line ( Line no : 6 )
ssl = yes

Step 5
Restart dovecot service.
sudo service dovecot restart


Step 1
Download RoundCube from following Link :
RoundCube Download Page

Unzip and copy the whole folder to document_root of http server.

Make sure that the following directories (and the files within) are writable by the web server user:

  • temp
  • logs

Step 2 Database Configuration
Next thing we need to do is decide what database backend we’ll use. The most common is MySQL but others are PostgreSQL and SQLite. So once you decide, create a database with any name you want and grant privileges to a separate database user. It’s recommended not to use an existing user or root.

With MySQL you can set up the database by issuing the following commands:

(of course you have to replace the database, username and password accordingly)

Step 3 Configuring RoundCube
After uploading the files point your browser to http://url-to-roundcube/installer/ to start the install wizard.

In case you see some red NOT OK messages, you need to install or enable something. Follow the links or find out more by searching your web site for your server’s operating system or http://www.php.net.

If the mail server supports SSL connection for imap and TLS for SMTP, then SMTPServer will be tls://localhost and IMAPServer will be ssl://localhost.

Step 4 Protect your installation
Access through your webserver to at least the following directories should be denied:

  • /config
  • /temp
  • /logs

Roundcube use .htaccess files to protect this directories, be sure to allow override of the Limit directives to get them taken into account.

Last but not least you have to remove the whole installer directory from the webserver. If this remains active it can expose the configuration including passwords.


Add user account

Mail forwarding

  • Using aliases file

  • Making .forward file in user home directory