nosa02
Goto Top

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:
  1. See /usr/share/postfix/main.cf.dist for a commented, more complete version


  1. Debian specific: Specifying a file name will cause the first
  2. line of that file to be used as the name. The Debian default
  3. is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

  1. appending .domain is the MUA's job.
append_dot_mydomain = no

  1. Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

  1. TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
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

  1. See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  2. 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
  1. SASL Auth
smtpd_sasl_auth_enable = yes
#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

  1. Amavis
content_filter=smtp-amavis:[127.0.0.1]:10024

  1. Zarafa Mailbox mapping
virtual_mailbox_domains = example.de
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:
  1. See /usr/share/postfix/main.cf.dist for a commented, more complete version


  1. Debian specific: Specifying a file name will cause the first
  2. line of that file to be used as the name. The Debian default
  3. is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

  1. appending .domain is the MUA's job.
append_dot_mydomain = no

  1. Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

  1. TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
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

  1. See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  2. 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

  1. SASL Auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
message_size_limit = 40000000
  1. Amavis
content_filter=smtp-amavis:[127.0.0.1]:10024

  1. Zarafa Mailbox mapping
virtual_mailbox_domains = anlaufstelle-sw.de
virtual_alias_maps = hash:/etc/aliases
mailbox_command = /usr/bin/zarafa-dagent "$USER"
virtual_transport = zarafa: zarafa_destination_recipient_limit = 1

Content-Key: 251333

Url: https://administrator.de/contentid/251333

Printed on: April 23, 2024 at 13:04 o'clock

Member: AndiEoh
AndiEoh Oct 09, 2014 at 08:14:06 (UTC)
Goto Top
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]
          1. Alternative form:
          2. relayhost = [mail.isp.example]:submission
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

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?
Member: Nosa02
Nosa02 Oct 09, 2014 at 14:39:43 (UTC)
Goto Top
Hallo AndiEoh,

du hattest recht, die Server waren vertauscht, werde das gleich mal ändern.

Dank die für den Hinweis: smtp ungleich smtpd !!, jetzt habe ich eine Fehlermeldung weniger. Leider kämpfe ich noch immer mit der Annahme durch den host server 1.

Wenn ich ein Erebnis habe, melde ich mich wieder.

Bis dahin
Gruß
Norbert
Member: schneerunzel
schneerunzel May 20, 2015 at 15:26:08 (UTC)
Goto Top
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
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
Member: Nosa02
Nosa02 Jun 10, 2015 at 16:14:35 (UTC)
Goto Top
Hallo Schneerunzel,
danke für den Link, habe eben kurz drüber geschaut und werde mich demnächst mal dran machen und des Ergebnis hier posten.

LG
Norbert