Postfix SMTP-Mail an externe Hosts nicht möglich

Postfix SMTP-Mail an externe Hosts nicht möglich

Ich verwalte einen Server (Ubuntu 12.04 LTS), auf dem ein Webserver und ein Mailserver laufen. Der Webserver läuft einwandfrei, aber der Mailserver macht Probleme. Ich habe Dovecot installiert und richtig konfiguriert. Ich kann mich mit Thunderbird damit verbinden (mein Client ist in einem anderen Netzwerk, es ist also kein internes Netzwerk) und alle Ordner usw. sehen. Auch externe Mails werden empfangen.

Die Postfix-SMTP-Authentifizierung scheint zu funktionieren (mit STARTTLS), da ich E-Mails von Thunderbird im externen Netzwerk an localhost und die Domäne des Servers schreiben kann. Aber wenn ich versuche, eine E-Mail an eine andere Adresse zu senden, beispielsweise an Gmail, erhalte ich die folgende Fehlermeldung:

An error occurred while sending mail. The mail server responded:  5.7.1 <***@gmail.com>:
Relay access denied. Please check the message recipient ***@gmail.com and try again.

Ich verwende ein SMTP-Relay auf dem Postfix selbst. Wenn ich mich mit SSH anmelde, kann ich E-Mails schreiben. Ich denke, das Problem liegt irgendwo hier – verwenden SMTP-Verbindungen zu Postfix auch dieses konfigurierte Relay?

Hier ist meine main.cf: (Hostnamen, Domänen usw. durch fiktive Daten ersetzt)

# 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.
#myorigin = /etc/mailname

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

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

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

readme_directory = no

# 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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.com, localhost, myhostname
relayhost = smtp.myrelayhoster.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all



smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noplaintext noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password

sender_canonical_maps = hash:/etc/postfix/sender_canonical

Wie gesagt, die grundlegende SMTP-Authentifizierung scheint zu funktionieren – muss das Relay für SMTP separat konfiguriert werden?

Dies sind die wichtigen Zeilen von /var/log/mail.log:

Sep  5 09:19:21 myhostname postfix/smtpd[9086]: connect from isp-ip.net[123.456.789.123]
Sep  5 09:19:22 myhostname postfix/smtpd[9086]: NOQUEUE: reject: RCPT from isp-ip.net[123.456.789.123]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<thunderbird>
Sep  5 09:19:22 myhostname postfix/smtpd[9086]: disconnect from isp-ip.net[123.456.789.123]

Antwort1

Sep  5 09:19:22 myhostname postfix/smtpd[9086]: NOQUEUE: reject: RCPT from isp-ip.net[123.456.789.123]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<thunderbird>

Versuchen Sie, eine SMTP-Sitzung über Telnet zu emulieren und fügen Sie die Ausgabe der Frage hinzu. Sie können auch Swaks verwenden, es ist nur ein Perl-Skript

# swaks -s isp-ip.net --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

Der Host hat die Authentifizierung nicht angekündigt

es scheint, dass der Relay-Host keine Authentifizierung unterstützt. Vielleicht tut er das, aber nur über einen verschlüsselten Kanal. Versuchen Sie stattdessen beispielsweise die Ports 465/587 zu verwenden

# swaks -s isp-ip.net -tlsc -p 465 --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

# swaks -s isp-ip.net -tls -p 587 --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

verwandte Informationen