dovecot_sieve
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| dovecot_sieve [2013-10-14 12:32:02] – [Dovecots User-Modell] manfred | dovecot_sieve [2016-04-12 22:50:01] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Dovecot + Sieve ====== | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | **FreeBSD: | ||
| + | portinstall -prO mail/ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | This port assumes you are familiar with Dovecot and have it installed | ||
| + | and running on the system you have installed this plugin on. | ||
| + | | ||
| + | You can enable the plugin with this directive in your dovecot.conf: | ||
| + | |||
| + | | ||
| + | # Support for dynamically loadable plugins. mail_plugins is | ||
| + | # a space separated list of plugins to load. | ||
| + | | ||
| + | } | ||
| + | |||
| + | Further information on configuration can be found at: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Verschlüsselung aktivieren ===== | ||
| + | |||
| + | |||
| + | ==== SSL-Schlüssel generieren ==== | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | RECHNERNAME=" | ||
| + | |||
| + | EMAIL=" | ||
| + | STAAT=" | ||
| + | LAND=" | ||
| + | STADT=" | ||
| + | ORGANISATION=" | ||
| + | ABTEILUNG=" | ||
| + | ZEITRAUM=" | ||
| + | BITLANG=" | ||
| + | |||
| + | |||
| + | openssl req -rand / | ||
| + | |||
| + | |||
| + | if [ -r "/ | ||
| + | echo "/ | ||
| + | fi | ||
| + | |||
| + | if [ -r "/ | ||
| + | echo "/ | ||
| + | openssl x509 -noout -subject -issuer -dates -in / | ||
| + | fi | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== / | ||
| + | |||
| + | |||
| + | === Dovecot 1.1 (Ubuntu 10.04 LTS) === | ||
| + | |||
| + | > vi / | ||
| + | < | ||
| + | ... | ||
| + | ssl = yes | ||
| + | disable_plaintext_auth = no | ||
| + | ssl_key_file = / | ||
| + | ssl_cert_file = / | ||
| + | mail_location = maildir: | ||
| + | maildir_copy_with_hardlinks = yes | ||
| + | mail_access_groups = mail | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Dovecot 1.2 (Ubuntu 12.04 LTS) === | ||
| + | |||
| + | > vi / | ||
| + | < | ||
| + | ... | ||
| + | ssl_key = </ | ||
| + | ssl_cert = </ | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | > vi / | ||
| + | < | ||
| + | ... | ||
| + | mail_location = maildir: | ||
| + | maildir_copy_with_hardlinks = yes | ||
| + | mail_access_groups = mail | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Diese Informationen finden Sie in der aktuellen Version in FreeBSD unter /// | ||
| + | |||
| + | ===== IMAP-STARTTLS-Verschlüsselung testen ===== | ||
| + | |||
| + | > telnet erde 143 | ||
| + | Trying 192.168.2.1... | ||
| + | Connected to erde.lan. | ||
| + | Escape character is ' | ||
| + | * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready. | ||
| + | a login fritz geheimespasswort | ||
| + | a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | > openssl s_client -starttls imap -connect mail.domain.de: | ||
| + | ... | ||
| + | --- | ||
| + | SSL handshake has read 2059 bytes and written 345 bytes | ||
| + | --- | ||
| + | New, TLSv1/ | ||
| + | Server public key is 2048 bit | ||
| + | Secure Renegotiation IS supported | ||
| + | Compression: | ||
| + | Expansion: NONE | ||
| + | SSL-Session: | ||
| + | Protocol | ||
| + | Cipher | ||
| + | Session-ID: 86CB36C8E92940338EAEBEE527A3F405EC59DDE3BA8EEECCEE53936125F482D2 | ||
| + | Session-ID-ctx: | ||
| + | Master-Key: E4E56A1ABB2DB18B40B8D35A4063F707FD21D3E9FB8DF4CC8F1D7BB0AB37F3906E0A0755AC2B429226D0BDB8624F06FE | ||
| + | Key-Arg | ||
| + | Start Time: 1381866348 | ||
| + | Timeout | ||
| + | Verify return code: 18 (self signed certificate) | ||
| + | --- | ||
| + | . OK Pre-login capabilities listed, post-login capabilities have more. | ||
| + | DONE | ||
| + | |||
| + | |||
| + | ===== Dovecots User-Modell ===== | ||
| + | |||
| + | Eine sehr häufige Fehlerquelle, | ||
| + | Zumindest, wenn man mit mehr als einem User arbeiten möchte. | ||
| + | Hier werden drei verschiedenen User benötigt. | ||
| + | |||
| + | - //root//: Dovecot wird als //root// gestartet. | ||
| + | - // | ||
| + | - // | ||
| + | |||
| + | |||
| + | ==== Dovecot - User ==== | ||
| + | |||
| + | //dovecot// wird für interne Aufgaben verwendet. Er sollte keinen Zugriff auf Dateien oder irgend etwas anderes haben. Dieser User sollte komplett isoliert sein. | ||
| + | Er sollte nur zu seiner **dovecot**-Gruppe gehören, zu der niemand sonst gehören sollte. Diese Gruppe sollte keinen Zugriff auf Dateien oder irgend etwas anderes haben, außer zu den internen Dingen, die Dovecot selber erstellt. | ||
| + | |||
| + | //dovecot// wird für keinerlei Mailprozess verwendet - speichere niemals die User-Mails unter dem User //dovecot// und fühge den // | ||
| + | |||
| + | |||
| + | ==== Mail - User ==== | ||
| + | |||
| + | Du kannst einen oder mehrere Systemuser für den Zugriff auf die User-Mails verwenden. | ||
| + | Die gebräuchlichen Konfigurationen können in zwei Kategorien unterteilt werden: | ||
| + | |||
| + | - [[Dovecot-System-User]] (siehe SystemUsers.txt) in diesem Fall hat jeder Dovecot-User seinen eigenen System-User in der "/ | ||
| + | - Dovecot-Virtual-User (siehe VirtualUsers.txt) in diesem Fall hat laufen alle System-User unter einem einzigen System-User, | ||
| + | |||
| + | Wie auch immer, es ist auch möglich jede Konfiguration zu fahren, die zwischen diesen beiden Kategorien liegt. Zum Beispiel ist es auch möglich für jede Domain einen eigenen System-User zu verwenden. | ||
| + | |||
| + | |||
| + | ==== UIDs ==== | ||
| + | |||
| + | Dovecot' | ||
| + | Hierüber gibt es noch einige wissenswerte Dinge: | ||
| + | |||
| + | * Obwohl man mit UID normalerweise eine nummerische ID meint (wie sie einem User in der "/ | ||
| + | * Die UID muss nicht in der "/ | ||
| + | * Zu bedenken hierbei ist, dass wenn die IMAP- oder POP3-Implementation ein Sicherheitsloch aufweist, dann kann der Angreifer alle Mails lesen, die von dem User mit der selben UID sind. Also ist der saubere Weg, das jeder User eine eigene UID bekommt. Schlimm ist es bei Betriebssystemen, | ||
| + | * Standardmäßig erlaubt Dovecot nur Usern das einloggen ab der UID 1000 aufwärts. Diese Kontrolle soll sicher stellen, dass niemand sich als Daemon oder anderer System-User einloggen kann. Verwendest Du eine UID, die kleiner als 1000 ist, dann musst Du den Wert der Variable " | ||
| + | |||
| + | |||
| + | ==== GIDs ==== | ||
| + | |||
| + | System-Gruppen (GIDs) arbeiten sehr ähnlich zu dem, wie es bei den UIDs beschrieben wurde: Du kannst Namen an Stelle von nummerischen IDs verwenden und die verwendete GID muss nicht in der "/ | ||
| + | |||
| + | System-Gruppen sind nützlich, denn wenn sich mehrere User eine Mailbox teilen wollen, dann brauchen sie nur der selben Gruppe anzugehören. Zur Zeit stellt Dovecot nichts besonderes mit den GIDs an, also kannst Du alle User in eine einzige Gruppe packen oder auch jedem seine eigene Gruppe geben | ||
| + | |||
| + | Benutzt Du viele UIDs und möchtest eine gemeinsame Mailbox erstellen (siehe SharedMailboxes.txt), | ||
| + | |||
| + | Zur Zeit unterstützt Dovecot nur das festlegen der primären Gruppe, aber wenn Deine " | ||
| + | |||
| + | |||
| + | ===== Authentifikation des Prozess-Users ===== | ||
| + | |||
| + | auth default { | ||
| + | ... | ||
| + | user = root | ||
| + | } | ||
| + | |||
| + | Der "auth user" legt den System-User fest, unter dem der Prozess " | ||
| + | |||
| + | Verwendest Du eine " | ||
| + | |||
| + | " | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== weitere Links ===== | ||
| + | |||
| + | http:// | ||
| + | |||
| + | ===== Beispiel aus Ubuntu 09.10 ===== | ||
| + | |||
| + | dovecot -n | ||
| + | |||
| + | # 1.1.11: / | ||
| + | # OS: Linux 2.6.31-14-server x86_64 Ubuntu 9.10 | ||
| + | log_timestamp: | ||
| + | protocols: imap imaps pop3 pop3s | ||
| + | login_dir: / | ||
| + | login_executable(default): | ||
| + | login_executable(imap): | ||
| + | login_executable(pop3): | ||
| + | mail_privileged_group: | ||
| + | mail_executable(default): | ||
| + | mail_executable(imap): | ||
| + | mail_executable(pop3): | ||
| + | mail_plugin_dir(default): | ||
| + | mail_plugin_dir(imap): | ||
| + | mail_plugin_dir(pop3): | ||
| + | auth default: | ||
| + | passdb: | ||
| + | driver: pam | ||
| + | userdb: | ||
| + | driver: passwd | ||
| + | |||
| + | ---- | ||
| + | |||
| + | sdiff / | ||
| + | ... | ||
| + | protocols = imap imaps pop3 pop3s | protocols = imap pop3 imaps pop3s managesieve | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | protocol imap { | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | } } | ||
| + | ... | ||
| + | protocol pop3 { | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | # | ||
| + | } } | ||
| + | ... | ||
| + | #protocol lda { | protocol lda { | ||
| + | # Address to use when sending rejection mails. | ||
| + | # | ||
| + | | ||
| + | # Hostname to use in various parts of sent mails, eg. in Me # Hostname to use in various parts of sent mails, eg. in Me | ||
| + | # Default is the system' | ||
| + | #hostname = # | ||
| + | | ||
| + | # Support for dynamically loadable plugins. mail_plugins is # Support for dynamically loadable plugins. mail_plugins is | ||
| + | # list of plugins to load. # list of plugins to load. | ||
| + | # | ||
| + | # | ||
| + | | ||
| + | # If user is over quota, return with temporary failure inst # If user is over quota, return with temporary failure inst | ||
| + | # bouncing the mail. # bouncing the mail. | ||
| + | # | ||
| + | | ||
| + | # Format to use for logging mail deliveries. You can use va # Format to use for logging mail deliveries. You can use va | ||
| + | # %$ - Delivery status message (e.g. "saved to INBOX" | ||
| + | # %m - Message-ID | ||
| + | # %s - Subject | ||
| + | # %f - From address | ||
| + | # | ||
| + | | ||
| + | # Binary to use for sending mails. | ||
| + | # | ||
| + | | ||
| + | # Subject: header to use for rejection mails. You can use t # Subject: header to use for rejection mails. You can use t | ||
| + | # as for rejection_reason below. | ||
| + | # | ||
| + | | ||
| + | # Human readable error message for rejection mails. You can # Human readable error message for rejection mails. You can | ||
| + | # %n = CRLF, %r = reason, %s = original subject, %t = reci # | ||
| + | # | ||
| + | | ||
| + | # UNIX socket path to master authentication server to find # UNIX socket path to master authentication server to find | ||
| + | # | ||
| + | #} | } | ||
| + | ... | ||
| + | # | ||
| + | ... | ||
| + | auth default { auth default { | ||
| + | ... | ||
| + | mechanisms = plain | | ||
| + | ... | ||
| + | #socket listen { | | ||
| + | #master { # | ||
| + | # Master socket provides access to userdb information. | ||
| + | # used to give Dovecot' | ||
| + | # can find mailbox locations. | ||
| + | #path = / | ||
| + | #mode = 0600 #mode = 0600 | ||
| + | # Default user/group is the one who started dovecot-aut | ||
| + | #user = #user = | ||
| + | #group = #group = | ||
| + | #} #} | ||
| + | #client { | ||
| + | # The client socket is generally safe to export to ever # The client socket is generally safe to export to ever | ||
| + | # is to export it to your SMTP server so it can do SMTP # is to export it to your SMTP server so it can do SMTP | ||
| + | # using it. # using it. | ||
| + | #path = / | ||
| + | #mode = 0660 | mode = 0660 | ||
| + | #} | user = postfix | ||
| + | #} | group = postfix | ||
| + | > } | ||
| + | > } | ||
| + | } } | ||
| + | |||
| + | |||
| + | ===== Beispiel aus Ubuntu 12.04 ===== | ||
| + | |||
| + | am Ende der Datei geben wir die gewünschten Protokolle an | ||
| + | sowie den Pfad zu den Schlüsseln: | ||
| + | > vi / | ||
| + | ... | ||
| + | protocols = imap sieve | ||
| + | ssl_key = </ | ||
| + | ssl_cert = </ | ||
| + | mail_location = maildir: | ||
| + | maildir_copy_with_hardlinks = yes | ||
| + | |||
| + | hier wird der unverschlüsselte IMAP-Port deaktiviert, | ||
| + | > vi / | ||
| + | ... | ||
| + | service imap-login { | ||
| + | inet_listener imap { | ||
| + | #port = 143 | ||
| + | port = 0 | ||
| + | } | ||
| + | inet_listener imaps { | ||
| + | port = 993 | ||
| + | ssl = yes | ||
| + | } | ||
| + | ... | ||
| + | |||
