Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste ÜberarbeitungBeide Seiten der Revision | ||
centos:mail_c6:mta_9 [26.03.2014 16:33. ] – [Überprüfung der DKIM-Signaturen] django | centos:mail_c6:mta_9 [28.03.2014 15:06. ] – #DKIM: "Besonderheit - DMARC" Querverweis zu #OpenDMARC gesetzt. #DMARC #Postfix #CentOS #AMaViS django | ||
---|---|---|---|
Zeile 759: | Zeile 759: | ||
===== Besonderheit - DMARC ===== | ===== Besonderheit - DMARC ===== | ||
+ | Möchten wir DMARC bei der Bewertung der anzunehmenden Nachrichten mit berücksichtigen, | ||
+ | Die Installation und Konfiguration von OpenDMARC ist im Kapitel [[centos: | ||
+ | ==== Installation von OpenDKIM ==== | ||
+ | Die Installation gestaltet sich sehr einfach, da wir das EPEL-Paket direkt mit **yum** installieren können. | ||
+ | # yum install opendkim | ||
+ | |||
+ | Was bei der Installation alles an Dateien und Verzeichnisse neu im System hinzugefügt worden sind, überprüfen wir mit Hilfe von **rpm -qil < | ||
+ | # rpm -qil opendkim | ||
+ | < | ||
+ | Version | ||
+ | Release | ||
+ | Install Date: Tue 25 Mar 2014 06:04:24 PM CET Build Host: lisse.hasselt.wieers.com | ||
+ | Group : System Environment/ | ||
+ | Size : 593359 | ||
+ | Signature | ||
+ | Packager | ||
+ | URL : http:// | ||
+ | Summary | ||
+ | Description : | ||
+ | OpenDKIM allows signing and/or verification of email through an open source | ||
+ | library that implements the DKIM service, plus a milter-based filter | ||
+ | application that can plug in to any milter-aware MTA, including sendmail, | ||
+ | Postfix, or any other MTA that supports the milter protocol. | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==== Konfiguration ==== | ||
+ | Die Konfiguration von OpenDKIM ist nicht sehr aufwändig, da wir lediglich das Modul **verify** benötigen. Das Signieren der eMails überlassen wir AMaViS. Die Konfiguration hierzu findet sich im Abschnitt [[centos: | ||
+ | # vim / | ||
+ | <file bash / | ||
+ | ## See opendkim.conf(5) or / | ||
+ | |||
+ | ## BEFORE running OpenDKIM you must: | ||
+ | |||
+ | ## - make your MTA (Postfix, Sendmail, etc.) aware of OpenDKIM | ||
+ | ## - generate keys for your domain (if signing) | ||
+ | ## - edit your DNS records to publish your public keys (if signing) | ||
+ | |||
+ | ## See / | ||
+ | |||
+ | ## CONFIGURATION OPTIONS | ||
+ | |||
+ | # Specifies the path to the process ID file. | ||
+ | PidFile / | ||
+ | |||
+ | # Selects operating modes. Valid modes are s (signer) and v (verifier). Default is v. | ||
+ | Mode v | ||
+ | |||
+ | # Log activity to the system log. | ||
+ | Syslog yes | ||
+ | |||
+ | # Log additional entries indicating successful signing or verification of messages. | ||
+ | SyslogSuccess yes | ||
+ | |||
+ | # If logging is enabled, include detailed logging about why or why not a message was | ||
+ | # signed or verified. This causes an increase in the amount of log data generated | ||
+ | # for each message, so set this to No (or comment it out) if it gets too noisy. | ||
+ | LogWhy yes | ||
+ | |||
+ | # Attempt to become the specified user before starting operations. | ||
+ | UserID opendkim: | ||
+ | |||
+ | # Create a socket through which your MTA can communicate. | ||
+ | # Django: 2014-03-25 | ||
+ | # default: Socket inet: | ||
+ | Socket inet: | ||
+ | |||
+ | # Required to use local socket with MTAs that access the socket as a non- | ||
+ | # privileged user (e.g. Postfix) | ||
+ | Umask 002 | ||
+ | |||
+ | # This specifies a text file in which to store DKIM transaction statistics. | ||
+ | # | ||
+ | |||
+ | ## SIGNING OPTIONS | ||
+ | |||
+ | # Selects the canonicalization method(s) to be used when signing messages. | ||
+ | Canonicalization relaxed/ | ||
+ | |||
+ | # Domain(s) whose mail should be signed by this filter. Mail from other domains will | ||
+ | # be verified rather than being signed. Uncomment and use your domain name. | ||
+ | # This parameter is not required if a SigningTable is in use. | ||
+ | # | ||
+ | |||
+ | # Defines the name of the selector to be used when signing messages. | ||
+ | # | ||
+ | |||
+ | # Gives the location of a private key to be used for signing ALL messages. | ||
+ | # | ||
+ | |||
+ | # Gives the location of a file mapping key names to signing keys. In simple terms, | ||
+ | # this tells OpenDKIM where to find your keys. If present, overrides any KeyFile | ||
+ | # setting in the configuration file. | ||
+ | # | ||
+ | |||
+ | # Defines a table used to select one or more signatures to apply to a message based | ||
+ | # on the address found in the From: header field. In simple terms, this tells | ||
+ | # OpenDKIM how to use your keys. | ||
+ | # | ||
+ | |||
+ | # Identifies a set of " | ||
+ | # of the signing domains without credentials as such. | ||
+ | # | ||
+ | # Django : 2014-03-25 | ||
+ | ExternalIgnoreList | ||
+ | |||
+ | # Identifies a set internal hosts whose mail should be signed rather than verified. | ||
+ | # | ||
+ | </ | ||
+ | # vim / | ||
+ | Wie schon auch bei der [[centos: | ||
+ | |||
+ | In der Konfigurationsdatei **main.cf** unseres Postfix-Mailserver tragen wir nun noch am Ende nachfolgende Zeilen ein. | ||
+ | # vim / | ||
+ | <file bash / | ||
+ | |||
+ | # Django : 2014-03-16 | ||
+ | # SPF-Check und DKIM-Signaturüberprüfung via SMF-SPF- und DKIM-Milter einbinden. | ||
+ | smtpd_milters = | ||
+ | # SMF-SPF-Milter: | ||
+ | | ||
+ | # DKIM-Milter | ||
+ | | ||
+ | ... | ||
+ | </ | ||
+ | ==== Programmstart ==== | ||
+ | === erster manueller Start === | ||
+ | Nun können wir das erste mal den Daemon anstarten. | ||
+ | # service opendkim start | ||
+ | |||
+ | Starting OpenDKIM Milter: | ||
+ | |||
+ | In der Prozessliste finden wir nun unseren Prozess opendkim, der mit den Rechten des Users opendkim läuft: | ||
+ | # ps auxw | grep opendkim | ||
+ | |||
+ | opendkim | ||
+ | |||
+ | Mittels lsof können wir nun noch überprüfen, | ||
+ | # lsof -i :10011 | ||
+ | |||
+ | COMMAND | ||
+ | opendkim 7535 opendkim | ||
+ | |||
+ | === automatisches Starten des Dienste beim Systemstart | ||
+ | Damit der OpenDKIM-Milter-Daemon automatisch bei jedem Systemstart startet, denn ohne laufenden **opendkim-daemon** verweigert nun unser **postfix** die Annahme der Nachrichten, | ||
+ | # chkconfig opendkim on | ||
+ | |||
+ | Die Überprüfungung ob der Dienst (Daemon) smf-spfwirklich bei jedem Systemstart automatisch mit gestartet wird, kann durch folgenden Befehle erreicht werden: | ||
+ | # chkconfig --list | grep opendkim | ||
+ | |||
+ | opendkim | ||
+ | |||
+ | Wichtig sind jeweils die Schalter **on** bei den Runleveln - **2 3 4 5**. | ||
+ | |||
+ | Anschließend starten wir unseren Postfix-Mailserver einmal durch, damit unsere zuvor eingetragene Konfigurationsänderung aktiv werden kann. | ||
+ | # service postfix condrestart | ||
+ | |||
+ | Shutting down postfix: | ||
+ | Starting postfix: | ||
+ | |||
+ | ==== Tests und Logging ==== | ||
+ | |||
+ | Wurde die Nachricht unterwegs verändert, | ||
+ | Mar 26 12:52:15 vml000080 opendkim[10943]: | ||
+ | |||
+ | Hingegen wird bei positivem Ergebnis der DKIM-Validierung im maillog vermerkt. | ||
+ | Mar 26 18:02:48 vml000080 opendkim[7535]: | ||
+ | Mar 26 18:02:48 vml000080 opendkim[7535]: | ||
+ | |||
+ | Im Mailheader einer angenommenen eMail finden sich dann entsprechend auch Hinweise zur DKIM-Signaturüberprüfung. | ||
+ | Authentication-Results: | ||
+ | header.d=piratenpartei-bayern.de header.i=@piratenpartei-bayern.de | ||
+ | header.b=WFipEQPn; | ||
+ | |||
+ | Bei negativem Ergebnis wird entsprechend vermerkt. | ||
+ | Authentication-Results: | ||
+ | reason=" | ||
+ | header.d=kitterman.com header.i=@kitterman.com header.b=g01pGD3l; | ||
+ | dkim-adsp=none | ||
====== Links ====== | ====== Links ====== | ||
* **[[centos: | * **[[centos: | ||
Zeile 767: | Zeile 992: | ||
~~DISCUSSION~~ | ~~DISCUSSION~~ | ||
- | + | ~~AUTOTWEET: |