OpenBSD mit qmail, vpopmail und Dovecot
Dovecot unter OpenBSD installieren
Dovecot ist ein sehr sicherer und flexibler IMAP/S Server.
Dovecot ergänzt das Repertoire an sicherer und stabiler Software in
einer Emailumgebung. Er lässt sich hervorragend in ein qmail/vpopmail
System integrieren. In diesem Text gehe ich davon aus, dass die Login
Informationen der Emailnutzer in einer MySQL Datenbank vorliegen. Das ist
z.B. der Fall wenn Sie
OpenBSD mit qmail und vpopmail gefolgt sind.
Dovecot installieren
Für OpenBSD gibt es ein fertiges Packages. Da wir MySQL
Unterstützung wollen, installieren wir das folgende Paket:
pkg_add dovecot-1.1.16-mysql.tgz
dovecot-1.1.16-mysql: complete
--- dovecot-1.1.16-mysql -------------------
Files to facilitate the generation of a self-signed
certificate and key for Dovecot have been installed:
/etc/ssl/dovecot-openssl.cnf (Edit this accordingly!)
/usr/local/sbin/dovecot-mkcert.sh
If this has been or will be accomplished by other means,
use the following paths for the files:
/etc/ssl/dovecotcert.pem
/etc/ssl/private/dovecot.pem
If you wish to have Dovecot started automatically at boot time,
simply add the follow lines to /etc/rc.local:
if [ -x /usr/local/sbin/dovecot ]; then
echo -n ' dovecot'; /usr/local/sbin/dovecot
fi
|
Die Versionsnummer kann, je nach Release oder update, variieren.
Als nächstes brauchen wir eine Konfiguration. Ich biete hier
folgende kleine und funktionierende Konfiguration an.
base_dir = /var/dovecot/
protocols = imap
auth_verbose = yes
auth_debug = yes
disable_plaintext_auth = no
ssl_disable = yes
log_path = /var/log/dovecot.log
log_timestamp = "%b %d %H:%M:%S "
syslog_facility = mail
login_user = _dovecot
login_process_size = 64
login_max_processes_count = 32
login_max_connections = 64
login_greeting = Welcome to our IMAP service
mail_location = maildir:/usr/home/vpopmail/domains/%d/%n/Maildir
mail_debug = yes
mbox_write_locks = fcntl
protocol imap {
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
auth default {
mechanisms = plain login
passdb sql {
args = /etc/dovecot-sql.conf
}
userdb sql {
args = /etc/dovecot-sql.conf
}
user = nobody
}
|
Die entsprechende Konfiguration (/etc/dovecot-sql.conf) für den Zugriff
auf die MySQL Datenbank sieht dann so aus:
driver = mysql
default_pass_scheme = PLAIN
connect = host=localhost dbname=vpopmail user=VPOPMAILUSER password=PASSWORD
password_query = select concat(pw_name, '@', pw_domain) AS user,
pw_clear_passwd AS password
from vpopmail where pw_name = '%n'
and pw_domain = '%d'
user_query = SELECT pw_dir AS home,
1007 AS uid,
1002 AS gid
FROM vpopmail
WHERE pw_name = '%n'
AND pw_domain = '%d'
|
Diese Konfiguration passt auf eine standard vpopmail datenbank. Mit
entsprechenden Anpassungen lässt sich hier aber jede beliebige Datenbank
anbinden.
Zusätzlich fügen wir noch eine login class für
dovecot hinzu.
In /etc/login.conf:
dovecot:\
:openfiles-cur=1024:\
:openfiles-max=2048:\
:tc=daemon:
|
Und nicht vergessen
cap_mkdb /etc/login.conf auszuführen.
Nach diesen Handgriffen ist Ihr IMAP Syststem einsatzbereit. Für weitere
Informationen zur Konfiguration besuchen Sie bitte das
Dovecot WiKi.