Dovecot » Historique » Version 30
Patrice Nadeau, 2018-04-15 14:50
1 | 30 | Patrice Nadeau | # Dovecot |
---|---|---|---|
2 | 1 | Patrice Nadeau | |
3 | 3 | Patrice Nadeau | > Issue : #17 |
4 | 1 | Patrice Nadeau | |
5 | Serveur de courriel POP/IMAP. |
||
6 | |||
7 | http://www.dovecot.org/ |
||
8 | |||
9 | 5 | Patrice Nadeau | ---- |
10 | |||
11 | {{toc}} |
||
12 | |||
13 | 17 | Patrice Nadeau | > Version 2.2.18 |
14 | |||
15 | 1 | Patrice Nadeau | Les fichiers de configuration sont : |
16 | |||
17 | 30 | Patrice Nadeau | * **/etc/dovecot/dovecot.conf** |
18 | 2 | Patrice Nadeau | |
19 | 30 | Patrice Nadeau | ## Installation |
20 | |||
21 | ```bash |
||
22 | 1 | Patrice Nadeau | sudo zypper install dovecot |
23 | 24 | Patrice Nadeau | sudo systemctl enable dovecot.service |
24 | 1 | Patrice Nadeau | sudo systemctl start dovecot.service |
25 | # Si le serveur doit être disponible sur le réseau |
||
26 | sudo yast firewall services add service=service:dovecot zone=EXT |
||
27 | 30 | Patrice Nadeau | ``` |
28 | 3 | Patrice Nadeau | |
29 | Pour utiliser un mot de passe non encrypté, ajouter/modifier dans _/etc/dovecot/conf.d/10-auth.conf_ : |
||
30 | 30 | Patrice Nadeau | |
31 | ```bash |
||
32 | 3 | Patrice Nadeau | disable_plaintext_auth = no |
33 | 30 | Patrice Nadeau | ``` |
34 | 1 | Patrice Nadeau | |
35 | 30 | Patrice Nadeau | ### Configuration |
36 | 1 | Patrice Nadeau | |
37 | > Problème vécu sur une nouvelle installation openSUSE 13.2 |
||
38 | |||
39 | Postfix inscrit les message de l'utilisateur dans _/var/mail/username_ (_username_ étant le nom de l'utilisateur) |
||
40 | |||
41 | Pour indiquer le même répertoire à Dovecot, modifier le fichier _/etc/dovecot/conf.d/10-mail.conf_ (enlever le commentaire) |
||
42 | 30 | Patrice Nadeau | |
43 | ```bash |
||
44 | 1 | Patrice Nadeau | mail_location = mbox:~/mail:INBOX=/var/mail/%u |
45 | 30 | Patrice Nadeau | ``` |
46 | 8 | Patrice Nadeau | |
47 | 30 | Patrice Nadeau | ## Sécurité |
48 | 1 | Patrice Nadeau | |
49 | 3 | Patrice Nadeau | Pour utiliser l’encryption |
50 | Dans le répertoire _/usr/share/doc/packages/dovecot_ |
||
51 | 30 | Patrice Nadeau | |
52 | * Modifier le fichier _dovecot-openssl.cnf_ |
||
53 | * Exécuter le script _mkcert.sh_ |
||
54 | |||
55 | ```bash |
||
56 | 1 | Patrice Nadeau | sudo ./mkcert.sh |
57 | 30 | Patrice Nadeau | ``` |
58 | 27 | Patrice Nadeau | |
59 | 1 | Patrice Nadeau | Modifier le fichier _/etc/dovecot/conf.d/10-ssl.conf_ (enlever les commentaires) |
60 | 30 | Patrice Nadeau | |
61 | ```bash |
||
62 | 3 | Patrice Nadeau | ssl=yes |
63 | 18 | Patrice Nadeau | ssl_cert = </etc/ssl/private/dovecot.crt |
64 | 3 | Patrice Nadeau | ssl_key = </etc/ssl/private/dovecot.pem |
65 | 30 | Patrice Nadeau | ``` |
66 | 1 | Patrice Nadeau | |
67 | Vérifier en se branchant avec _telnet_ sur le port *143*. Le serveur devrait répondre *STARTTLS*. |
||
68 | |||
69 | 16 | Patrice Nadeau | Pour activer l’authentification PAM (utilisateurs locaux), ajouter dans _/etc/pam.d/dovecot_ : |
70 | 30 | Patrice Nadeau | |
71 | ```bash |
||
72 | 3 | Patrice Nadeau | auth required pam_unix.so nullok |
73 | 1 | Patrice Nadeau | account required pam_unix.so |
74 | 30 | Patrice Nadeau | ``` |
75 | 1 | Patrice Nadeau | |
76 | 30 | Patrice Nadeau | ## Test |
77 | 1 | Patrice Nadeau | |
78 | Ces tests se font à la ligne de commande. |
||
79 | 30 | Patrice Nadeau | |
80 | 4 | Patrice Nadeau | * SMTP : telnet serveur 25 |
81 | 1 | Patrice Nadeau | * POP : telnet serveur 110 |
82 | 13 | Patrice Nadeau | * IMAP : telnet serveur 143 |
83 | 14 | Patrice Nadeau | |
84 | 1 | Patrice Nadeau | Pour créer une boite de courriel, on doit créer un compte utilisateur à ce nom sur le serveur (PAM). |
85 | 14 | Patrice Nadeau | À partir du serveur : |
86 | 30 | Patrice Nadeau | |
87 | 1 | Patrice Nadeau | > Remplacer _usager_ par le nom de l'utilisateur voulu |
88 | 30 | Patrice Nadeau | |
89 | ```bash |
||
90 | 4 | Patrice Nadeau | sudo useradd --create-home usager |
91 | 25 | Patrice Nadeau | sudo passwd usager |
92 | 30 | Patrice Nadeau | ``` |
93 | 1 | Patrice Nadeau | |
94 | 28 | Patrice Nadeau | Changer les droits sur l'emplacement de la boite |
95 | 30 | Patrice Nadeau | |
96 | 4 | Patrice Nadeau | > Ex. : avec le compte _usager_ |
97 | 30 | Patrice Nadeau | |
98 | ```bash |
||
99 | 29 | Patrice Nadeau | sudo chown toto:users /var/mail/usager |
100 | 11 | Patrice Nadeau | sudo chmod 0600 /var/mail/usager |
101 | 30 | Patrice Nadeau | ``` |
102 | 29 | Patrice Nadeau | |
103 | 30 | Patrice Nadeau | ## Copie de sécurité |
104 | 11 | Patrice Nadeau | |
105 | 21 | Patrice Nadeau | Prendre en copie : |
106 | 30 | Patrice Nadeau | |
107 | 21 | Patrice Nadeau | * Répertoire : */home/*_usager_<notextile></notextile>*/mail* |
108 | 22 | Patrice Nadeau | * Fichier : */var/mail/*_usager_ |
109 | 21 | Patrice Nadeau | |
110 | 30 | Patrice Nadeau | ## Dépannage |
111 | 5 | Patrice Nadeau | |
112 | 4 | Patrice Nadeau | Les fichiers suivant sont utilisés : |
113 | 30 | Patrice Nadeau | |
114 | 4 | Patrice Nadeau | * _/var/log/mail_ |
115 | * _/var/log/mail.info_ |
||
116 | * _/var/log/mail.warn_ |
||
117 | * _/var/log/mail.err_ |
||
118 | |||
119 | 30 | Patrice Nadeau | Vérifier le nombre de messages dans les « queues » avec `mailq`. |