---
# System prepended metadata

title: Installation DM8
tags: [DM8, ' ARS']

---

---
title: Installation DM8
authors: jeremy.delbarre
tags: DM8, ARS
---

# Installation de postfix

apt-get install postfix

select local only
domain is INFRA.EPITAF

sudo vim etc/postfix/main.cf

change origin to EPITAF
add 192.168.3.0/24 in the networks
add line home_mailbox = Maildir

sudo systemctl restart postfix

:::info
les logs du serveur de mail sont dans /var/log/mail.log
:::

# Installation de Dovecot

apt install dovecot-imapd

sudo vim /etc/dovecot/conf.d/10-mail.conf

change mail_location to maildir:~/Maildir

add rule in iptable to allow port 143

apt install dovecot-ldap

systemctl restart dovecot

# Installation de RoundCube

download last version of roundcube

tar xvfz roundcube.tar.gz

mv roundcube /var/www/html/

## setup database
:::info
TO RESET ROOT PASSWORD

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
flush privileges;
:::

mysql -u root -p

CREATE USER IF NOT EXISTS 'roundcube'@'localhost' IDENTIFIED WITH mysql_native_password BY 'roundcube';
CREATE DATABASE roundcube CHARACTER SET utf8 COLLATE utf8_general_ci ;
GRANT ALL PRIVILEGES ON roundcube.* TO 'roundcube'@'localhost';

mysql -u roundcube -p roundcube < /var/www/roundcube/SQL/mysql.initial.sql

## setup apache

create virtual host on 10001 on path /var/www/html/roundcube

add rule for port 10001 in /etc/iptables/rule.v4

see here to complete install https://www.digitalocean.com/community/tutorials/how-to-install-your-own-webmail-client-with-roundcube-on-ubuntu-16-04

# install openldap

apt install slapd