Postfix als Relay nutzen
Liebe Gemeinde, ich habe 2 Linuxserver mit Postfix an unterschiedlichen externen Standorten stehen.
Server 1 hat feste IP und Mailversand und Empfang funktionieren tadellos.
Server 2 hat dynamische IP und ist per MX aus dem Netz erreichbar hat als Relayhost Server 1 eingetragen. sasl_Password.db ist vorhanden und eingetragen.
Die Einträge in der sasl_Password.db stimmen
Beim Senden von Mails werden diese vom Relayhost also Server 1 abgelehnt.
Relay access denied; from=<xxxxx@echtdomain.de> to=<xxxxxt@nochmalecht.de> proto=ESMTP helo=<xxxx.selfhost.eu>
Oct 8 16:19:36 aschenputtel postfix/smtpd[12331]: warning: restriction `reject_unauth_destination' after `check_relay_domains' is ignored
Frage: muss an Server 2 irgendwo expliziet Server 1 eingetragen werden oder an was kann es noch liegen? vl. hat jemand eine Idee!
Inhalt der man.cf von Server 2:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
readme_directory = no
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = xxxx.selfhost.eu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = xxxx.selfhost.eu, xxxxx.de, remus.fritz.box, localhost.fritz.box, localhost
relayhost = server2.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#smtpd_sasl_auth_options = noanonymous
smtpd_sasl_password_maps = hash:/etc/postfix/sasl_password.db
smtp_always_send_ehlo = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
virtual_alias_maps = hash:/etc/aliases
mailbox_command = /usr/bin/zarafa-dagent "$USER"
virtual_transport = zarafa: zarafa_destination_recipient_limit = 1
Inhalt der main.cf von Server 1:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
readme_directory = no
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = Aschenputtel.fritz.box
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = anlaufstelle-sw.de, anlaufstelle-sexuelle-gewalt-sw.de, Aschenputtel.fritz.box, localhost.fritz.box, localhost
#relayhost = smtp.localdomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
message_size_limit = 40000000
virtual_alias_maps = hash:/etc/aliases
mailbox_command = /usr/bin/zarafa-dagent "$USER"
virtual_transport = zarafa: zarafa_destination_recipient_limit = 1
Server 1 hat feste IP und Mailversand und Empfang funktionieren tadellos.
Server 2 hat dynamische IP und ist per MX aus dem Netz erreichbar hat als Relayhost Server 1 eingetragen. sasl_Password.db ist vorhanden und eingetragen.
Die Einträge in der sasl_Password.db stimmen
Beim Senden von Mails werden diese vom Relayhost also Server 1 abgelehnt.
Relay access denied; from=<xxxxx@echtdomain.de> to=<xxxxxt@nochmalecht.de> proto=ESMTP helo=<xxxx.selfhost.eu>
Oct 8 16:19:36 aschenputtel postfix/smtpd[12331]: warning: restriction `reject_unauth_destination' after `check_relay_domains' is ignored
Frage: muss an Server 2 irgendwo expliziet Server 1 eingetragen werden oder an was kann es noch liegen? vl. hat jemand eine Idee!
Inhalt der man.cf von Server 2:
- See /usr/share/postfix/main.cf.dist for a commented, more complete version
- Debian specific: Specifying a file name will cause the first
- line of that file to be used as the name. The Debian default
- is /etc/mailname.
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
- appending .domain is the MUA's job.
- Uncomment the next line to generate "delayed mail" warnings
readme_directory = no
- TLS parameters
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
- See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
- information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = xxxx.selfhost.eu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = xxxx.selfhost.eu, xxxxx.de, remus.fritz.box, localhost.fritz.box, localhost
relayhost = server2.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
- SASL Auth
#smtpd_sasl_auth_options = noanonymous
smtpd_sasl_password_maps = hash:/etc/postfix/sasl_password.db
smtp_always_send_ehlo = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
- Amavis
- Zarafa Mailbox mapping
virtual_alias_maps = hash:/etc/aliases
mailbox_command = /usr/bin/zarafa-dagent "$USER"
virtual_transport = zarafa: zarafa_destination_recipient_limit = 1
Inhalt der main.cf von Server 1:
- See /usr/share/postfix/main.cf.dist for a commented, more complete version
- Debian specific: Specifying a file name will cause the first
- line of that file to be used as the name. The Debian default
- is /etc/mailname.
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
- appending .domain is the MUA's job.
- Uncomment the next line to generate "delayed mail" warnings
readme_directory = no
- TLS parameters
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
- See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
- information on enabling SSL in the smtp client.
myhostname = Aschenputtel.fritz.box
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = anlaufstelle-sw.de, anlaufstelle-sexuelle-gewalt-sw.de, Aschenputtel.fritz.box, localhost.fritz.box, localhost
#relayhost = smtp.localdomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
- SASL Auth
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
message_size_limit = 40000000
- Amavis
- Zarafa Mailbox mapping
virtual_alias_maps = hash:/etc/aliases
mailbox_command = /usr/bin/zarafa-dagent "$USER"
virtual_transport = zarafa: zarafa_destination_recipient_limit = 1
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 251333
Url: https://administrator.de/forum/postfix-als-relay-nutzen-251333.html
Ausgedruckt am: 08.04.2025 um 20:04 Uhr
4 Kommentare
Neuester Kommentar
Hallo,
http://www.postfix.org/SASL_README.html -> Enabling SASL authentication in the Postfix SMTP/LMTP client
/etc/postfix/main.cf:
smtp_sasl_auth_enable = yes
relayhost = [mail.isp.example]
smtp ungleich smtpd !!
Aber irgendwie hab ich das Gefühl das du die beiden vertauscht hast?
Server1 hat feste IP und sollte deshalb der "Master" also das relay sein? Dann muss bei Server2 (Client) der Master als Ausgangs-Relay gesetzt werden. Außerdem ist mir nicht klar ob du alles oder nur alles nicht-lokale zum Relay schicken willst?
http://www.postfix.org/SASL_README.html -> Enabling SASL authentication in the Postfix SMTP/LMTP client
/etc/postfix/main.cf:
smtp_sasl_auth_enable = yes
relayhost = [mail.isp.example]
- Alternative form:
- relayhost = [mail.isp.example]:submission
smtp ungleich smtpd !!
Aber irgendwie hab ich das Gefühl das du die beiden vertauscht hast?
Server1 hat feste IP und sollte deshalb der "Master" also das relay sein? Dann muss bei Server2 (Client) der Master als Ausgangs-Relay gesetzt werden. Außerdem ist mir nicht klar ob du alles oder nur alles nicht-lokale zum Relay schicken willst?
Hallo Norbert,
ich bin ein klein wenig verwirrt von deiner Frage...
(Nur als Kleiner Tipp am Raden, wenn man Konfig Datein Postet bietet sich < code > und < / code > an (ohne die Leerzeichen)sieht dann so aus
)
Ich habe selber das gleiche Problem und würde dir gerne einmal den Link zu meiner Frage geben, evt Helfen dir die Antworten ja schon mal ein Stück weiter.... Bei mir hapert das noch ein einer anderen Stelle ;)
Postfix als Smarthost bzw SMTP Relay
ich bin ein klein wenig verwirrt von deiner Frage...
(Nur als Kleiner Tipp am Raden, wenn man Konfig Datein Postet bietet sich < code > und < / code > an (ohne die Leerzeichen)sieht dann so aus
Hallo
HuHu
)
Ich habe selber das gleiche Problem und würde dir gerne einmal den Link zu meiner Frage geben, evt Helfen dir die Antworten ja schon mal ein Stück weiter.... Bei mir hapert das noch ein einer anderen Stelle ;)
Postfix als Smarthost bzw SMTP Relay