From 616edabf0ecf3a6f9ac2d5ee1f6db79e6f81ba69 Mon Sep 17 00:00:00 2001 From: wpanda Date: Thu, 19 Feb 2026 15:02:49 +0100 Subject: [PATCH] . --- Conf/aps.local/postfix_main.cf.sh | 38 +++++++++++++++++++++ Doc/Aps/Neue User für SMTP Relay.md | 3 ++ GEMINI_smtp_user.md | 52 +++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 Conf/aps.local/postfix_main.cf.sh create mode 100644 Doc/Aps/Neue User für SMTP Relay.md create mode 100644 GEMINI_smtp_user.md diff --git a/Conf/aps.local/postfix_main.cf.sh b/Conf/aps.local/postfix_main.cf.sh new file mode 100644 index 0000000..d8d98b6 --- /dev/null +++ b/Conf/aps.local/postfix_main.cf.sh @@ -0,0 +1,38 @@ +alias_database = hash:/etc/aliases +alias_maps = hash:/etc/aliases +broken_sasl_auth_clients = yes +command_directory = /usr/bin +compatibility_level = 3.10 +daemon_directory = /usr/libexec/postfix +data_directory = /var/lib/postfix +debug_peer_level = 2 +debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 +html_directory = no +inet_interfaces = all +inet_protocols = all +mail_owner = postfix +mailq_path = /usr/bin/mailq.postfix +manpage_directory = /usr/share/man +meta_directory = /etc/postfix +mydestination = $myhostname, localhost.$mydomain, localhost +myhostname = antares-apo.local +mynetworks = 127.0.0.0/8, 10.102.9.0/24, 10.101.0.0/16, 10.102.1.0/24 +newaliases_path = /usr/bin/newaliases.postfix +queue_directory = /var/spool/postfix +readme_directory = /usr/share/doc/postfix/README_FILES +relayhost = [aps-exch01.aps.local]:25 +sample_directory = /usr/share/doc/postfix/samples +sendmail_path = /usr/bin/sendmail.postfix +setgid_group = postdrop +shlib_directory = /usr/lib64/postfix +smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt +smtp_tls_CApath = /etc/pki/tls/certs +smtp_tls_security_level = may +smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination +smtpd_sasl_auth_enable = yes +smtpd_sasl_local_domain = $myhostname +smtpd_sasl_security_options = noanonymous +smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem +smtpd_tls_key_file = /etc/pki/tls/private/postfix.key +smtpd_tls_security_level = may +unknown_local_recipient_reject_code = 550 \ No newline at end of file diff --git a/Doc/Aps/Neue User für SMTP Relay.md b/Doc/Aps/Neue User für SMTP Relay.md new file mode 100644 index 0000000..8ce5e31 --- /dev/null +++ b/Doc/Aps/Neue User für SMTP Relay.md @@ -0,0 +1,3 @@ +# Neue User für SMTP Relay +sudo useradd -M -s /sbin/nologin printeruser +sudo passwd printeruser diff --git a/GEMINI_smtp_user.md b/GEMINI_smtp_user.md new file mode 100644 index 0000000..3b660ed --- /dev/null +++ b/GEMINI_smtp_user.md @@ -0,0 +1,52 @@ +# Postfix SMTP Hitelesítés Beállítása (Fedora 43) + +Ez a dokumentum összefoglalja a lépéseket, amelyekkel lokális felhasználói hitelesítést (SASL) állítottunk be egy meglévő Postfix SMTP relay szerveren. + +## 1. Szükséges csomagok telepítése +A SASL hitelesítéshez a Cyrus SASL könyvtárakra van szükség. +```bash +sudo dnf install cyrus-sasl cyrus-sasl-plain +``` + +## 2. SASL konfigurálása +Létrehoztuk a `/etc/sasl2/smtpd.conf` fájlt, amely meghatározza, hogyan ellenőrizze a Postfix a jelszavakat. +```conf +# /etc/sasl2/smtpd.conf +pwcheck_method: saslauthd +mech_list: plain login +``` + +## 3. Postfix konfiguráció módosítása +Beállítottuk a Postfix-et, hogy használja a SASL hitelesítést és engedélyezze a hitelesített kliensek számára a levélküldést. +```bash +sudo postconf -e 'smtpd_sasl_auth_enable = yes' +sudo postconf -e 'smtpd_sasl_security_options = noanonymous' +sudo postconf -e 'smtpd_sasl_local_domain = $myhostname' +sudo postconf -e 'broken_sasl_auth_clients = yes' +sudo postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination' +``` + +## 4. Lokális felhasználó létrehozása +Létrehoztunk egy rendszerszintű felhasználót, aki csak hitelesítésre szolgál (nincs shell hozzáférése). +```bash +sudo useradd -M -s /sbin/nologin mdmuser +sudo passwd mdmuser +``` + +## 5. Szolgáltatások indítása és engedélyezése +Elindítottuk a hitelesítésért felelős démont és újraindítottuk a Postfix-et. +```bash +sudo systemctl enable --now saslauthd +sudo systemctl restart postfix +``` + +## 6. Ellenőrzés és Tesztelés +A hitelesítés meglétét `telnet`-tel ellenőriztük: +```bash +telnet localhost 25 +# EHLO teszt.local parancs után látni kell: +# 250-AUTH PLAIN LOGIN +``` + +A sikeres küldést a logokban az alábbi bejegyzés igazolja: +`sasl_method=PLAIN, sasl_username=mdmuser@antares-apo.local, status=sent`