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
centos:mail_c6:mta_14 [28.03.2014 10:38. ] – [SRS-Deamon] djangocentos:mail_c6:mta_14 [21.11.2022 20:53. ] (aktuell) – [SRS - Sender Rewriting Scheme] django
Zeile 5: Zeile 5:
 Das nachfolgende Schaubild verdeutlicht, warum bei zu strenger Wahl des SPF-Records der Versand bei einer Weiterleitung (alias) fehlschlägt. Der empfangende Mailserver überprüft die Angaben **HELO** und **MAIL FROM** im **Envelop** der eMail. Hierzu frägt der Mailserver den SPF-Record des sendenden Systems ab und vergleicht die IP-Adresse/Namen des einliefernden Empfängers mit den legitimen Sendern des SMF-Records. Ist der einliefernde Mailserver berechtigt, kann mit der weiteren Annahme und Prüfung fortgefahren werden. Ist der einliefernde Mailserver aber __**nicht**__ berechtigt, quittiert das System den Zustellversuch mit einem Fehler-(code) **550**. Das nachfolgende Schaubild verdeutlicht, warum bei zu strenger Wahl des SPF-Records der Versand bei einer Weiterleitung (alias) fehlschlägt. Der empfangende Mailserver überprüft die Angaben **HELO** und **MAIL FROM** im **Envelop** der eMail. Hierzu frägt der Mailserver den SPF-Record des sendenden Systems ab und vergleicht die IP-Adresse/Namen des einliefernden Empfängers mit den legitimen Sendern des SMF-Records. Ist der einliefernde Mailserver berechtigt, kann mit der weiteren Annahme und Prüfung fortgefahren werden. Ist der einliefernde Mailserver aber __**nicht**__ berechtigt, quittiert das System den Zustellversuch mit einem Fehler-(code) **550**.
  
-<uml w=900>+<uml>
  
 title Mailversand einer eMail bei Weiterleitung (alias)\n title Mailversand einer eMail bei Weiterleitung (alias)\n
-skin BlueModern+
 participant "\n Mail-Server mx1.example.org \n 88.217.127.21 \n" as links participant "\n Mail-Server mx1.example.org \n 88.217.127.21 \n" as links
 participant "\n Mail-Server mx01.nausch.org \n 217.91.103.190 \n" as mitte participant "\n Mail-Server mx01.nausch.org \n 217.91.103.190 \n" as mitte
Zeile 170: Zeile 170:
  
 ==== Postfix ==== ==== Postfix ====
-Leider unterstützt der aus dem Base-Repository stammende Postfix in der Version 2.6.6  keine TCP Lookup Tabellen, so dass wir auf eine neuere Version ausweichen müssen. Die Firma [[http://www.imt-systems.com/|IMT-Systems GmbH]] stellt auf ihrem [[http://download.imt-systems.com/postfix/2.10/2.10.0/x86_64/|Download-Server]] aktuellere **//Postfix 2.10.0//** RPM Pakete für CentOS 6 zur Verfügung.+Leider unterstützt der aus dem Base-Repository stammende Postfix in der Version 2.6.6  keine TCP Lookup Tabellen, so dass wir auf eine neuere Version ausweichen müssen.  
 + 
 +Die Firma [[http://www.imt-systems.com/|IMT-Systems GmbH]] stellt auf ihrem [[http://download.imt-systems.com/postfix/2.10/2.10.0/x86_64/|Download-Server]] aktuellere **//Postfix 2.10.0//** RPM Pakete für CentOS 6 zur Verfügung.
  
 Wir laden uns also die entsprechenden RPM-Pakete auf unseren Server, dazu wechslen wir aber erst in unser lokales Programmarchiv. Wir laden uns also die entsprechenden RPM-Pakete auf unseren Server, dazu wechslen wir aber erst in unser lokales Programmarchiv.
Zeile 277: Zeile 279:
  
 ==== SRS-Deamon ==== ==== SRS-Deamon ====
-Auf unserem Entwicklungsrechner finden wir eine README-Datei mit weiteren Informationen. +Die Konfiguration des **postsrsd**-Daemons gestaltet sich vergleichsweise einfach und erfolgt lediglich mit Hilfe Der Datei //**/etc/sysconfig/postsrsd**//.  
-   # less /usr/local/src/postsrsd-master/README.md +Mit unserem Editor der Wahlz.Bvim bearbeiten wir diese Konfigurationsdatei.  
- +   # vim /etc/sysconfig/postsrsd 
-<file bash README.md> +<file bash /etc/sysconfig/postsrsd># Default settings for postsrsd
-About +
-===== +
-PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based  +
-lookup tables for Postfix. SRS is needed if your mail server acts +
-as forwarder.  +
- +
-Imagine your server receives a mail from alice@example.com +
-that is to be forwarded. If example.com uses the Sender Policy Framework  +
-to indicate that all legit mails originate from their server, your  +
-forwarded mail might be bounced, because you have no permission to send +
-on behalf of example.com. The solution is that you map the address to +
-your own domain, e.g.  +
-SRS0+xxxx=yy=example.com=alice@yourdomain.org (forward SRS). If the +
-mail is bounced later and a notification arrives, you can extract the +
-original address from the rewritten one (revere SRS) and return the +
-notification to the sender. You might notice that the reverse SRS can +
-be abused to turn your server into an open relay. For this reason, xxxx +
-and yy are a cryptographic signature and a time stamp. If the signature +
-does not match, the address is forged and the mail can be discarded. +
- +
-Building +
-======== +
-PostSRSd requires a POSIX compatible system and CMake to build.  +
-Optionally, help2man is used to create a manual page. +
- +
-For convenience, a Makefile fragment is provided which calls CMake with +
-the recommended command line options. Just run `make`. +
- +
-Installing +
-========== +
-Run `make install` as root to install the daemon and the configuration +
-files. +
-Configuration +
-============= +
-The configuration is located in `/etc/default/postsrsd`. You must store +
-at least one secret key in `/etc/postsrsd.secret`. The installer tries to generate +
-one from `/dev/urandom`. Be careful that no one can guess your secret, +
-because anyone who knows it can use your mail server as open relay! +
-Each line of `/etc/postsrsd.secret` is used as secretThe first secret is +
-used for signing and verification, the others for verification only. +
- +
-PostSRSd exposes its functionality via two TCP lookup tables. The +
-recommended Postfix configuration is to add the following fragment to +
-your main.cf: +
- +
-    sender_canonical_maps = tcp:127.0.0.1:10001 +
-    sender_canonical_classes = envelope_sender +
-    recipient_canonical_maps = tcp:127.0.0.1:10002 +
-    recipient_canonical_classes= envelope_recipient +
- +
-This will transparently rewrite incoming and outgoing envelope addresses. +
-Run `service postsrsd start` and `postfix reload` as root, or reboot. +
-</file> +
- +
-Wir legen uns nun im ersten Schritt für unsere Konfigurationsdatei im entsprechende Verzeichnis an+
-   # vim /etc/default/postsrsd +
- +
-<file bash /etc/default/postsrsd># Default settings for postsrsd+
  
 # Local domain name.  # Local domain name. 
Zeile 344: Zeile 288:
 # is taken from `postconf -h mydomain` and probably okay. # is taken from `postconf -h mydomain` and probably okay.
 # #
-# Django : 2014-03-17 +#SRS_DOMAIN=example.com 
-# default: #SRS_DOMAIN=example.com+# Django : 2014-03-27
 SRS_DOMAIN=nausch.org SRS_DOMAIN=nausch.org
  
Zeile 359: Zeile 303:
 # and stored in /etc/postsrsd.secret. For most installations, that's just fine. # and stored in /etc/postsrsd.secret. For most installations, that's just fine.
 # #
 +#SRS_SECRET=/etc/postsrsd.secret
 +# Django : 2014-03-27
 SRS_SECRET=/etc/postsrsd.secret SRS_SECRET=/etc/postsrsd.secret
  
Zeile 367: Zeile 313:
 # the internet. # the internet.
 # #
 +#SRS_FORWARD_PORT=10001
 +#SRS_REVERSE_PORT=10002
 +# Django : 2014-03-27
 SRS_FORWARD_PORT=10001 SRS_FORWARD_PORT=10001
 SRS_REVERSE_PORT=10002 SRS_REVERSE_PORT=10002
Zeile 375: Zeile 324:
 RUN_AS=nobody RUN_AS=nobody
 </file> </file>
- 
-Zum Signieren der umgeschriebenen Adressen benötigen wir noch einen secret-key, den wir nun anlegen. 
-   # dd if=/dev/urandom bs=18 count=1 | base64  > /etc/postsrsd.secret 
- 
-Anschließend setzen wir die Dateirechte unseres privat-keys, damit diese nicht von unpreviligierten Usern ausgelesen werden kann. Der **PostSRSd** hat damit keine Probleme, da er den Schlüssel einliest, bevor diese seine Rechte abtritt/dropped. 
-   # chmod 400 /etc/postsrsd.secret 
- 
  
 ==== Postfix ==== ==== Postfix ====
Zeile 413: Zeile 355:
    # ps aux | grep postsrsd    # ps aux | grep postsrsd
  
-  nobody    5185  0.0  0.0   6184   344 ?        S    20:46   0:00 /usr/local/sbin/postsrsd -4 -f10001 -r10002 -dnausch.org -s/etc/postsrsd.secret -unobody -p -c -X -D+  nobody    6170  0.0  0.0   6184   352 ?        S    11:20   0:00 /usr/sbin/postsrsd -4 -f10001 -r10002 -dnausch.org -s/etc/postsrsd.secret -unobody -p -c -X -D 
 +  nobody    7151  0.0  0.0   6188   316 ?        S    11:41   0:00 /usr/sbin/postsrsd -4 -f10001 -r10002 -dnausch.org -s/etc/postsrsd.secret -unobody -p -c -X -D 
 +  nobody    7300  0.0  0.0   6188   500 ?        S    11:44   0:00 /usr/sbin/postsrsd -4 -f10001 -r10002 -dnausch.org -s/etc/postsrsd.secret -unobody -p -c -X -D 
 +  nobody    7301  0.0  0.0   6188   316 ?        S    11:44   0:00 /usr/sbin/postsrsd -4 -f10001 -r10002 -dnausch.org -s/etc/postsrsd.secret -unobody -p -c -X -D
  
 Mittels **netstat** können wir überpfüfen, ob die beiden Ports **10001** und **10002** geöffnet wurden. Mittels **netstat** können wir überpfüfen, ob die beiden Ports **10001** und **10002** geöffnet wurden.
Zeile 422: Zeile 367:
  
 Läuft unser Daemon kann mit Hilfe von **lsof** sehen wir nicht nur den geöffneten port, sondern auch die Verbindungen die dort anliegen. Läuft unser Daemon kann mit Hilfe von **lsof** sehen wir nicht nur den geöffneten port, sondern auch die Verbindungen die dort anliegen.
-   # lsof -i :10002 
-<code>COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME 
-postsrsd 5185  nobody    6u  IPv4  40634      0t0  TCP localhost:documentum (LISTEN) 
-smtpd    5364 postfix   39u  IPv4  43230      0t0  TCP localhost:48910->localhost:documentum (ESTABLISHED) 
-postsrsd 5367  nobody    0u  IPv4  43231      0t0  TCP localhost:documentum->localhost:48910 (ESTABLISHED) 
-postsrsd 5367  nobody    6u  IPv4  40634      0t0  TCP localhost:documentum (LISTEN) 
-cleanup  5369 postfix   23u  IPv4  43281      0t0  TCP localhost:48917->localhost:documentum (ESTABLISHED) 
-postsrsd 5370  nobody    6u  IPv4  40634      0t0  TCP localhost:documentum (LISTEN) 
-postsrsd 5371  nobody    0u  IPv4  43282      0t0  TCP localhost:documentum->localhost:48917 (ESTABLISHED) 
-postsrsd 5371  nobody    6u  IPv4  40634      0t0  TCP localhost:documentum (LISTEN) 
-</code> 
    # lsof -i :10001    # lsof -i :10001
-<code>COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME + 
-postsrsd 5185  nobody    5u  IPv4  40632      0t0  TCP localhost:scp-config (LISTEN) +  COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME 
-postsrsd 5367  nobody    5u  IPv4  40632      0t0  TCP localhost:scp-config (LISTEN) +  postsrsd 6170  nobody    5u  IPv4 574244      0t0  TCP localhost:scp-config (LISTEN) 
-cleanup  5369 postfix   22u  IPv4  43278      0t0  TCP localhost:56006->localhost:scp-config (ESTABLISHED) +  postsrsd 7151  nobody    5u  IPv4 574244      0t0  TCP localhost:scp-config (LISTEN) 
-postsrsd 5370  nobody    0u  IPv4  43279      0t0  TCP localhost:scp-config->localhost:56006 (ESTABLISHED) +  cleanup  7299 postfix   22u  IPv4 583245      0t0  TCP localhost:43341->localhost:scp-config (ESTABLISHED) 
-postsrsd 5370  nobody    5u  IPv4  40632      0t0  TCP localhost:scp-config (LISTEN) +  postsrsd 7300  nobody    0u  IPv4 583246      0t0  TCP localhost:scp-config->localhost:43341 (ESTABLISHED) 
-postsrsd 5371  nobody    5u  IPv4  40632      0t0  TCP localhost:scp-config (LISTEN) +  postsrsd 7300  nobody    5u  IPv4 574244      0t0  TCP localhost:scp-config (LISTEN) 
-</code>+  postsrsd 7301  nobody    5u  IPv4 574244      0t0  TCP localhost:scp-config (LISTEN) 
 + 
 +   # lsof -i :10002 
 + 
 +  postsrsd 6170  nobody    6u  IPv4 574246      0t0  TCP localhost:documentum (LISTEN) 
 +  smtpd    7146 postfix   40u  IPv4 582010      0t0  TCP localhost:57592->localhost:documentum (ESTABLISHED) 
 +  postsrsd 7151  nobody    0u  IPv4 582011      0t0  TCP localhost:documentum->localhost:57592 (ESTABLISHED) 
 +  postsrsd 7151  nobody    6u  IPv4 574246      0t0  TCP localhost:documentum (LISTEN) 
 +  cleanup  7299 postfix   23u  IPv4 583248      0t0  TCP localhost:57652->localhost:documentum (ESTABLISHED) 
 +  postsrsd 7300  nobody    6u  IPv4 574246      0t0  TCP localhost:documentum (LISTEN) 
 +  postsrsd 7301  nobody    0u  IPv4 583249      0t0  TCP localhost:documentum->localhost:57652 (ESTABLISHED) 
 +  postsrsd 7301  nobody    6u  IPv4 574246      0t0  TCP localhost:documentum (LISTEN)
  
 ==== automatisches Starten des Dienste beim Systemstart  ==== ==== automatisches Starten des Dienste beim Systemstart  ====
Zeile 474: Zeile 419:
   * **[[http://dokuwiki.nausch.org/doku.php/|Zurück zur Startseite]]**   * **[[http://dokuwiki.nausch.org/doku.php/|Zurück zur Startseite]]**
  
-~~DISCUSSION~~+
  
  • centos/mail_c6/mta_14.1396003132.txt.gz
  • Zuletzt geändert: 28.03.2014 10:38.
  • von django