Um das Problem zu umgehen, möchte ich mir einen postfix relay-host aufsetzen. Hierbei habe ich diese Anleitung als Grundlage genommen.
# Basis-Image verwenden
FROM debian:bookworm-slim
ARG EMAIL
ARG EMAIL_PASSWORD
ARG MAIL_NAME
ARG SMTP_DOMAIN
ARG SMTP_PORT
RUN apt update && \
apt upgrade -y && \
apt install -y mailutils && \
apt install -y postfix
COPY main.cf /etc/postfix/main.cf
RUN sh -c 'echo "root: ${EMAIL}" >> /etc/aliases' && \
sh -c 'echo "${MAIL_NAME}" >> /etc/mailname' && \
sh -c 'echo "[${SMTP_DOMAIN}]:${SMTP_PORT} ${EMAIL}:${EMAIL_PASSWORD}" >> /etc/postfix/sasl_passwd' && \
postmap /etc/postfix/sasl_passwd && \
chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
RUN postconf maillog_file=/var/log/mail.log
CMD service postfix restart && tail -f /dev/null
Display More
EMAIL=admin@domain.de
EMAIL_PASSWORD=passwort
PORT=2525
MAIL_NAME=Tool Admin<admin@domain.de>
SMTP_DOMAIN=NODE.netcup.net
SMTP_PORT=465
# 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 (Debian)
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
# See http://www.postfix.org/COMPATIBILITY_README.html - default to 3.6 on
# fresh installs.
compatibility_level = 3.6
# 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_tls_security_level=may
smtpd_tls_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtpd_tls_ciphers=high
smtpd_tls_exclude_ciphers=aNULL,MD5
smtp_tls_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtp_tls_ciphers=high
smtp_tls_exclude_ciphers=aNULL,MD5
smtp_tls_security_level=encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#smtpd_sasl_auth_enable = yes
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.domain.de
mydomain = domain.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, /etc/mailname, localhost, localhost.localdomain, localhost, localhost.$mydomain
relayhost = [mail.domain.de]:465
mynetworks = 127.0.0.0/8 [::1]/128 172.16.0.0/12
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
# Protokollierung in eine Datei
syslog_name = postfix
maillog_file = /var/log/mail.log
#debug_peer_level = 4
# SMTPS wrappermode (TCP port 465) requires these settings
smtp_tls_wrappermode = yes
Display More
Die Fehlermeldung lautet:
Quote
host mail.domain.de[xx.xx.xx.xx] said: 554
5.7.1 <info@otherdomain.de>: Relay access denied (in reply to
RCPT TO command)
Meine Idee ist Anwendung -> Postfix (Relay-Host) -> Netcup Mailserver -> Empfänger.
Bin ich gerade blind und sehe etwas nicht, oder was muss ich hier noch beachten?