Hallo,
eventuell kann mir hier jemand helfen.
Ich stehe aktuell vor dem Problem dass ich mein Postfix so konfigurieren muss, dass ich einen SMTP Server in Abhängigkeit der Senderdomain ansprechen muss.
example.com via Office365 bla.foo via gmail
sender_dependent_realayhost_maps ist gesetzt, und greift auch. Allerdings scheitert es an der Authentifizierung bei dem Setup.
Mar 17 15:06:46 mail01 postfix/smtpd[2337]: connect from localhost[127.0.0.1] Mar 17 15:07:08 mail01 postfix/smtpd[2337]: 39C751E010F8: client=localhost[127.0.0.1] Mar 17 15:07:15 mail01 postfix/cleanup[2341]: 39C751E010F8: warning: header subject: Testmail from localhost[127.0.0.1]; from=<mail@example.com> to=<test@10minutemail.com> proto=ESMTP helo=<example.com> Mar 17 15:07:15 mail01 postfix/cleanup[2341]: 39C751E010F8: message-id=<20170317140708.39C751E010F8@mail01.local.domain> Mar 17 15:07:15 mail01 postfix/qmgr[2334]: 39C751E010F8: from=<mail@example.com>, size=369, nrcpt=1 (queue active) Mar 17 15:07:21 mail01 postfix/smtp[2342]: 39C751E010F8: to=<test@10minutemail.com>, relay=smtp.office365.com[40.101.126.114]:25, delay=23, delays=18/0.01/0.24/5, dsn=5.7.57, status=bounced (host smtp.office365.com[40.101.126.114] said: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM command)) Mar 17 15:07:21 mail01 postfix/smtp[2342]: 39C751E010F8: lost connection with smtp.office365.com[40.101.126.114] while sending RCPT TO Mar 17 15:07:21 mail01 postfix/cleanup[2341]: 083351E0110D: message-id=<20170317140721.083351E0110D@mail01.local.domain> Mar 17 15:07:21 mail01 postfix/bounce[2343]: 39C751E010F8: sender non-delivery notification: 083351E0110D Mar 17 15:07:21 mail01 postfix/qmgr[2334]: 083351E0110D: from=<>, size=2515, nrcpt=1 (queue active) Mar 17 15:07:21 mail01 postfix/qmgr[2334]: 39C751E010F8: removed Mar 17 15:07:28 mail01 postfix/smtp[2342]: 083351E0110D: to=<mail@example.com>, relay=smtp.office365.com[40.101.45.242]:587, delay=7.3, delays=0/0/2.1/5.1, dsn=5.7.60, status=bounced (host smtp.office365.com[40.101.45.242] said: 550 5.7.60 SMTP; Client does not have permissions to send as this sender (in reply to end of DATA command)) Mar 17 15:07:28 mail01 postfix/qmgr[2334]: 083351E0110D: removed Mar 17 15:07:40 mail01 postfix/master[2330]: terminating on signal 15 Mar 17 15:07:40 mail01 postfix/master[2502]: daemon started -- version 2.11.0, configuration /etc/postfix Show less
Gleiches Ergebnis bei dem gmail SMTP.
Hier noch die Configs.
main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no header_checks = regexp:/etc/postfix/header_checks readme_directory = no 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 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = mail01.local.domain alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = mail01.local.domain, localhost.local.domain, localhost smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost smtp_sasl_auth_enable = yes relayhost = [smtp.office365.com]:587 smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_tls_security_level = may smtp_sasl_security_options = noanonymous sender_canonical_classes = envelope_sender, header_sender sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps smtp_header_checks = regexp:/etc/postfix/header_check mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4
sasl_passwd
[smtp.office365.com]:587 mail@example.com:Passwort123 [smtp.gmail.com]:587 mail@bla.foo:Passwort345
sender_canonical_maps
/^(.*@)example.com/ mail@example.com /^(.*@)bla.foo/ mail@bla.foo
header_checks
/From:.*@(.*)example.com/ REPLACE From: mail@example.com /From:.* <.*@(.*)example.com>/ REPLACE From: mail@example.com /From:.*@(.*)bla.foo/ REPLACE From: mail@bla.foo /From:.* <.*@(.*)bla.foo>/ REPLACE From: mail@bla.foo
sender-relayhost
mail@example.com [smtp.office365.com] mail@bla.foo [smtp.gmail.com]
Postfix Version
# postconf -d |grep mail_version mail_version = 2.11.0 milter_macro_v = $mail_name $mail_version
Würde mich sehr freuen, falls jemand eine Idee hat, woran es noch hängen könnte.