Dovecot
Erscheinungsbild
Dovecot ist ein IMAP und POP3 Email-Server.
Installation und Konfiguration
Spezielle Konfiguration
- configure ohne Parameter
- PAM in /etc/pam.d/dovecot (statt pam_unix.so):
auth required pam_unix2.so account required pam_unix2.so
- dovecot.conf ("dovecot -n"):
disable_plaintext_auth: no
login_dir: /usr/local/var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
last_valid_uid: 3000
last_valid_gid: 10000
mail_location: maildir:~/Maildir
namespace:
type: private
separator: /
location: maildir:~/Maildir
inbox: yes
auth default:
passdb:
driver: pam
userdb:
driver: passwd
- SSL-Test-Zertifikat & Key erstellen für TLS (port 143), Dateien /etc/ssl/private/dovecot.pem und /etc/ssl/certs/dovecot.pem
sh /opt/pkg/dovecot/dovecot-1.0.0/doc/mkcert.sh
LDA
Konfiguration inkl. Plugin
protocol lda {
postmaster_address = aaa@bbb.de
hostname = bbb.de
mail_plugins = cmusieve
mail_plugin_dir = /usr/local/lib/dovecot/lda
log_path =
info_log_path =
}
LDA Integration in Postfix
Siehe [3]. main.cf:
mailbox_command = /usr/local/libexec/dovecot/deliver
Sieve-Filter als LDA-Plugin
Siehe [4]. Filter-Code in Datei $HOME/.dovecot.sieve. Beispiel:
require "fileinto";
if address :is "to" "aaa@bbb.de" {
fileinto "Test";
} elsif address :is "to" "ccc@ddd.de" {
fileinto "Test2";
} elsif exists "X-Spam-Flag" {
fileinto "SPAM";
} else {
# The rest goes into INBOX
# default is "implicit keep", we do it explicitly here
keep;
}
Achtung: Fall das Sieve-Plugin nicht gefunden wird, verbleibt die Email in der Queue des MTA.
Tipps & Tricks
- Konfiguration ausgeben für nicht-default Werte:
dovecot -n