Mailserver einrichten: Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 67: Zeile 67:
driver = mysql
driver = mysql
</pre>
</pre>
== Links ==
[https://help.ubuntu.com/community/PostfixDovecotSASL https://help.ubuntu.com/community/PostfixDovecotSASL]




Zurück zu [[Ubuntu]]
Zurück zu [[Ubuntu]]

Version vom 12. März 2016, 20:13 Uhr

Voraussetzungen

Für den Betrieb eines Mailservers ist eine Datenbank Voraussetzung - ich habe mich für MySQL entschieden.

Siehe dazu auch MySQL installieren.

Dovecot

Installation

sudo apt-get install dovecot-core
sudo apt-get install dovecot-imapd dovecot-pop3d
sudo apt-get install dovecot-mysql

Datenbank erstellen

mysql -u root -p 
mysql> create database if not exists mails;
mysql> create user 'dovecot'@'%' identified by '<password>';
mysql> grant usage on *.* to 'dovecot'@'%' identified by '<password>'; 
mysql> grant all privileges on mails.* to 'dovecot'@'%';
mysql> flush privileges; 
mysql> use mails;
mysql> CREATE TABLE users (id INT UNSIGNED AUTO_INCREMENT NOT NULL, username VARCHAR(128) NOT NULL, domain VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, UNIQUE (id), PRIMARY KEY (username, domain));
mysql> quit;

Soll nur von localhost auf die Datenbank zugegriffen werden können, dann folgenden Befehl verwenden:

mysql> create user 'dovecot'@'localhost' identified by '<password>';

Konfiguration

Datei /etc/dovecot/conf.d/10-auth.conf:

# Folgende Zeile auskommentieren:
# !include auth-system.conf.ext

# Folgende Zeile einkommentieren:
!include auth-sql.conf.ext

Datei /etc/dovecot/dovecot-sql.conf.ext:

# Database driver: mysql, pgsql, sqlite
driver = mysql

Links

https://help.ubuntu.com/community/PostfixDovecotSASL


Zurück zu Ubuntu