Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

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] djangocentos: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, setzen wir auf das Paket **opendmarc** aus den Repository [[centos:epel6|EPEL]] ein. Dies hat gegenüber der Signaturprüfung den entscheidenden Vorteil, dass die einzelnen Milter (SPF, DKIM und DMARC) nahtlos ineinander greifen, und so die neu hinzugefügten Haeder bei der Berwertung mit Betrachtet werden können.
  
 +Die Installation und Konfiguration von OpenDMARC ist im Kapitel [[centos:mail_c6:mta_13|DMARC - Domain-based Message Authentication, Reporting & Conformance]] beschrieben.
 +==== 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 <paketname>**.
 +   # rpm -qil opendkim
 +<code>Name        : opendkim                     Relocations: (not relocatable)
 +Version     : 2.6.7                             Vendor: Dag Apt Repository, http://dag.wieers.com/apt/
 +Release     : 1.el6.rf                      Build Date: Wed 20 Mar 2013 03:16:45 PM CET
 +Install Date: Tue 25 Mar 2014 06:04:24 PM CET      Build Host: lisse.hasselt.wieers.com
 +Group       : System Environment/Daemons    Source RPM: opendkim-2.6.7-1.el6.rf.src.rpm
 +Size        : 593359                           License: BSD and Sendmail
 +Signature   : DSA/SHA1, Wed 20 Mar 2013 04:59:26 PM CET, Key ID a20e52146b8d79e6
 +Packager    : Dag Wieers <dag@wieers.com>
 +URL         : http://opendkim.org/
 +Summary     : A DomainKeys Identified Mail (DKIM) milter to sign and/or verify mail
 +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.
 +/etc/opendkim
 +/etc/opendkim.conf
 +/etc/opendkim/KeyTable
 +/etc/opendkim/SigningTable
 +/etc/opendkim/TrustedHosts
 +/etc/opendkim/keys
 +/etc/rc.d/init.d/opendkim
 +/etc/sysconfig/opendkim
 +/etc/tmpfiles.d/opendkim.conf
 +/usr/bin/opendkim-genkey
 +/usr/bin/opendkim-genzone
 +/usr/bin/opendkim-reportstats
 +/usr/bin/opendkim-spam
 +/usr/bin/opendkim-stats
 +/usr/bin/opendkim-testadsp
 +/usr/bin/opendkim-testkey
 +/usr/bin/opendkim-testmsg
 +/usr/sbin/opendkim
 +/usr/share/doc/opendkim-2.6.7
 +/usr/share/doc/opendkim-2.6.7/FEATURES
 +/usr/share/doc/opendkim-2.6.7/INSTALL
 +/usr/share/doc/opendkim-2.6.7/KNOWNBUGS
 +/usr/share/doc/opendkim-2.6.7/LICENSE
 +/usr/share/doc/opendkim-2.6.7/LICENSE.Sendmail
 +/usr/share/doc/opendkim-2.6.7/README
 +/usr/share/doc/opendkim-2.6.7/README.opendkim-reportstats
 +/usr/share/doc/opendkim-2.6.7/RELEASE_NOTES
 +/usr/share/doc/opendkim-2.6.7/RELEASE_NOTES.Sendmail
 +/usr/share/doc/opendkim-2.6.7/authheaders-check-setup-hook.lua
 +/usr/share/doc/opendkim-2.6.7/convert_keylist.sh
 +/usr/share/doc/opendkim-2.6.7/final.lua.sample
 +/usr/share/doc/opendkim-2.6.7/opendkim.conf.sample
 +/usr/share/doc/opendkim-2.6.7/opendkim.conf.simple
 +/usr/share/doc/opendkim-2.6.7/opendkim.conf.simple-verify
 +/usr/share/doc/opendkim-2.6.7/screen.lua.sample
 +/usr/share/doc/opendkim-2.6.7/setup.lua.sample
 +/usr/share/man/man1/opendkim-spam.1.gz
 +/usr/share/man/man5/opendkim.conf.5.gz
 +/usr/share/man/man8/opendkim-genkey.8.gz
 +/usr/share/man/man8/opendkim-genzone.8.gz
 +/usr/share/man/man8/opendkim-stats.8.gz
 +/usr/share/man/man8/opendkim-testadsp.8.gz
 +/usr/share/man/man8/opendkim-testkey.8.gz
 +/usr/share/man/man8/opendkim-testmsg.8.gz
 +/usr/share/man/man8/opendkim.8.gz
 +/var/run/opendkim
 +/var/spool/opendkim
 +</code>
 +
 +==== 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:mail_c6:mta_9#generierung_von_dkim-signaturen|Generierung von DKIM-Signaturen]].
 +   # vim /etc/opendkim.conf
 +<file bash /etc/opendkim.conf>## BASIC OPENDKIM CONFIGURATION FILE
 +## See opendkim.conf(5) or /usr/share/doc/opendkim-2.6.7/opendkim.conf.sample for more
 +
 +## 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 /usr/share/doc/opendkim-2.6.7/INSTALL for detailed instructions.
 +
 +## CONFIGURATION OPTIONS
 +
 +# Specifies the path to the process ID file.
 +PidFile /var/run/opendkim/opendkim.pid
 +
 +# 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:opendkim
 +
 +# Create a socket through which your MTA can communicate.
 +# Django: 2014-03-25
 +# default: Socket inet:8891@localhost
 +Socket inet:10011@127.0.0.1
 +
 +# 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.
 +#Statistics /var/spool/opendkim/stats.dat
 +
 +## SIGNING OPTIONS
 +
 +# Selects the canonicalization method(s) to be used when signing messages.
 +Canonicalization relaxed/simple
 +
 +# 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.
 +#Domain example.com
 +
 +# Defines the name of the selector to be used when signing messages.
 +#Selector default
 +
 +# Gives the location of a private key to be used for signing ALL messages.
 +#KeyFile /etc/opendkim/keys/dkim2k.private
 +
 +# 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. 
 +#KeyTable /etc/opendkim/KeyTable
 +
 +# 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.  
 +#SigningTable /etc/opendkim/SigningTable
 +
 +# Identifies a set of "external" hosts that may send mail through the server as one
 +# of the signing domains without credentials as such.
 +#ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
 +# Django : 2014-03-25
 +ExternalIgnoreList     refile:/etc/opendkim/TrustedHosts
 +
 +# Identifies a set internal hosts whose mail should be signed rather than verified.
 +#InternalHosts refile:/etc/opendkim/TrustedHosts
 +</file>
 +# vim /etc/opendkim.conf
 +Wie schon auch bei der [[centos:mail_c6:mta_10?&#konfiguration|Konfiguration vom SPF-Milter]] definieren wir hier einen Port, an dem der Postfix-Daemon später den DKIM-Milter erreichen wird.
 +
 +In der Konfigurationsdatei **main.cf** unseres Postfix-Mailserver tragen wir nun noch am Ende nachfolgende Zeilen ein.
 +   # vim /etc/postfix/main.cf
 +<file bash /etc/postfix/main.cf>...
 +
 +# Django : 2014-03-16
 +# SPF-Check und DKIM-Signaturüberprüfung via SMF-SPF- und DKIM-Milter einbinden.
 +smtpd_milters = 
 +# SMF-SPF-Milter: 
 +   inet:127.0.0.1:10010,
 +# DKIM-Milter   : 
 +   inet:127.0.0.1:10011
 +...
 +</file>
 +==== Programmstart ====
 +=== erster manueller Start ===
 +Nun können wir das erste mal den Daemon anstarten.
 +   # service opendkim start
 +
 +  Starting OpenDKIM Milter:                                  [  OK  ]
 +
 +In der Prozessliste finden wir nun unseren Prozess opendkim, der mit den Rechten des Users opendkim läuft:
 +   # ps auxw | grep opendkim
 +
 +  opendkim  7535  0.0  0.2 213712  2068 ?        Ssl  18:00   0:00 /usr/sbin/opendkim -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid
 +
 +Mittels lsof können wir nun noch überprüfen, welcher Port von Daemon verwendet wird.
 +   # lsof -i :10011
 +
 +  COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
 +  opendkim 7535 opendkim    3u  IPv4 2687914      0t0  TCP localhost:10011 (LISTEN)
 +
 +=== 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, kann die Einrichtung des Start-Scripte über folgenden Befehle erreicht werden:
 +   # 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        0:off 1:off 2:on 3:on 4:on 5:on 6:off
 +
 +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:                                      OK  ]
 +  Starting postfix:                                          [  OK  ]
 +
 +==== Tests und Logging ====
 +
 +Wurde die Nachricht unterwegs verändert,so fällt dies bei der Überprüfung der DKIM-Signatur auf und wird entsprechend im maillog vermerkt.
 +  Mar 26 12:52:15 vml000080 opendkim[10943]: D2B6281: s=20120113 d=gmail.com SSL error:04091068:rsa routines:INT_RSA_VERIFY:bad signature
 +
 +Hingegen wird bei positivem Ergebnis der DKIM-Validierung im maillog vermerkt.
 +  Mar 26 18:02:48 vml000080 opendkim[7535]: CECDB81: message has signatures from googlegroups.com, gmail.com
 +  Mar 26 18:02:48 vml000080 opendkim[7535]: CECDB81: DKIM verification successful
 +
 +Im Mailheader einer angenommenen eMail finden sich dann entsprechend auch Hinweise zur DKIM-Signaturüberprüfung.
 +  Authentication-Results: mx01.nausch.org; dkim=pass reason="1024-bit key"
 + header.d=piratenpartei-bayern.de header.i=@piratenpartei-bayern.de
 + header.b=WFipEQPn; dkim-adsp=pass
 +
 +Bei negativem Ergebnis wird entsprechend vermerkt.
 +  Authentication-Results: mx01.nausch.org; dkim=fail
 + reason="verification failed"
 + header.d=kitterman.com header.i=@kitterman.com header.b=g01pGD3l;
 + dkim-adsp=none
 ====== Links ====== ====== Links ======
   * **[[centos:mail_c6:start|Zurück zum Kapitel >>Mailserverinstallation unter CentOS 6<<]]**   * **[[centos:mail_c6:start|Zurück zum Kapitel >>Mailserverinstallation unter CentOS 6<<]]**
Zeile 767: Zeile 992:
 ~~DISCUSSION~~ ~~DISCUSSION~~
  
- +~~AUTOTWEET:~~
  • centos/mail_c6/mta_9.txt
  • Zuletzt geändert: 22.07.2019 15:06.
  • von 127.0.0.1