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_14 [28.03.2014 10:38. ] – [SRS-Deamon] django | centos:mail_c6:mta_14 [20.04.2018 10:43. ] – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
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:// | + | 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:// | ||
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 | + | Die Konfiguration des **postsrsd**-Daemons gestaltet sich vergleichsweise einfach und erfolgt lediglich mit Hilfe Der Datei //**/etc/sysconfig/postsrsd**//. |
- | # less /usr/local/ | + | Mit unserem Editor der Wahl, z.B. vim bearbeiten wir diese Konfigurationsdatei. |
- | + | # vim /etc/sysconfig/postsrsd | |
- | <file bash README.md> | + | <file bash /etc/sysconfig/ |
- | 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, | + | |
- | 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 `/ | + | |
- | because anyone who knows it can use your mail server as open relay! | + | |
- | Each line of `/ | + | |
- | used for signing and verification, | + | |
- | + | ||
- | 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: | + | |
- | sender_canonical_classes = envelope_sender | + | |
- | recipient_canonical_maps = tcp: | + | |
- | 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. | + | |
- | </ | + | |
- | + | ||
- | Wir legen uns nun im ersten Schritt für unsere | + | |
- | # vim /etc/default/postsrsd | + | |
- | + | ||
- | <file bash /etc/default/ | + | |
# 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 | + | # |
- | # default: # | + | # Django : 2014-03-27 |
SRS_DOMAIN=nausch.org | SRS_DOMAIN=nausch.org | ||
Zeile 359: | Zeile 303: | ||
# and stored in / | # and stored in / | ||
# | # | ||
+ | # | ||
+ | # Django : 2014-03-27 | ||
SRS_SECRET=/ | SRS_SECRET=/ | ||
Zeile 367: | Zeile 313: | ||
# the internet. | # the internet. | ||
# | # | ||
+ | # | ||
+ | # | ||
+ | # 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 | ||
</ | </ | ||
- | |||
- | Zum Signieren der umgeschriebenen Adressen benötigen wir noch einen secret-key, den wir nun anlegen. | ||
- | # dd if=/ | ||
- | |||
- | Anschließend setzen wir die Dateirechte unseres privat-keys, | ||
- | # chmod 400 / | ||
- | |||
==== Postfix ==== | ==== Postfix ==== | ||
Zeile 413: | Zeile 355: | ||
# ps aux | grep postsrsd | # ps aux | grep postsrsd | ||
- | nobody | + | nobody |
+ | nobody | ||
+ | nobody | ||
+ | nobody | ||
Mittels **netstat** können wir überpfüfen, | Mittels **netstat** können wir überpfüfen, | ||
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 | ||
- | < | ||
- | postsrsd 5185 nobody | ||
- | smtpd 5364 postfix | ||
- | postsrsd 5367 nobody | ||
- | postsrsd 5367 nobody | ||
- | cleanup | ||
- | postsrsd 5370 nobody | ||
- | postsrsd 5371 nobody | ||
- | postsrsd 5371 nobody | ||
- | </ | ||
# lsof -i :10001 | # lsof -i :10001 | ||
- | < | + | |
- | postsrsd | + | |
- | postsrsd | + | postsrsd |
- | cleanup | + | postsrsd |
- | postsrsd | + | cleanup |
- | postsrsd | + | postsrsd |
- | postsrsd | + | postsrsd |
- | </code> | + | postsrsd |
+ | |||
+ | # lsof -i :10002 | ||
+ | |||
+ | postsrsd 6170 nobody | ||
+ | smtpd 7146 postfix | ||
+ | postsrsd 7151 nobody | ||
+ | postsrsd 7151 nobody | ||
+ | cleanup | ||
+ | postsrsd 7300 nobody | ||
+ | postsrsd 7301 nobody | ||
+ | postsrsd 7301 nobody | ||
==== automatisches Starten des Dienste beim Systemstart | ==== automatisches Starten des Dienste beim Systemstart | ||
Zeile 474: | Zeile 419: | ||
* **[[http:// | * **[[http:// | ||
- | ~~DISCUSSION~~ | + | ~~AUTOTWEET:~~ |