Мне нужно настроить postfix для отправки через сервер ретрансляции, но с другим пользователем в зависимости от домена отправителя. Например:
domain1.com
userA
passwordA
domain2.com
userB
passwordB
Мне нужно отправить хотя relay.server.com
Вот файлы, которые я изменил неудачно:
/ и т. д. / постфикс / транспорт
.domain1.com smtp:[relay.server.com] .domain2.com smtp:[relay.server.com]
/ и т.д. / постфикс / sasl_passwd
@domain1.com userA:passwordA @domain2.com userB:passwordB
/ и т.д. / постфикс / relayhost_map
domain1.com smtp:[relay.server.com] domain2.com smtp:[relay.server.com]
/etc/postfix/main.cf
mydomain = domain3.com myhostname = host.domain3.com myorigin = $mydomain relay_domains = relay.server.com, domain1.com, domain2.com relayhost = [relay.server.com] sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_map smtp_pix_workarounds = delay_dotcrlf smtp_sasl_auth_enable = yes smtp_sasl_mechanism_filter = !gssapi, !external, static:all smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous, noplaintext smtp_sasl_tls_security_options = $smtp_sasl_security_options smtp_sasl_type = cyrus smtp_sender_dependent_authentication = yes smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt smtp_use_tls = yes smtpd_sasl_path = smtpd smtpd_sasl_type = cyrus soft_bounce = no transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual
Ошибка, которую я получил:
Feb 13 19:04:43 postfixserver postfix/smtp[2718]: 95EE11607CC: to=<noreply@domain1.com>, relay=relay.server.com[X.X.X.X]:25, delay=0.28, delays=0/0.04/0.14/0.11, dsn=5.7.0, status=bounced (host relay.server.com[X.X.X.X] said: 530 5.7.0 authentication required in "MAIL FROM:<> SIZE=2263 BODY=8BITMIME" (in reply to MAIL FROM command))
кажется, что сопоставление sasl_passwd определено неправильно. заранее спасибо
Я решил внести некоторые изменения в эти файлы:
Я добавил "@" перед доменом и удалил тег "smtp:" перед сервером:
/etc/postfix/relayhost_map
@domain1.com [relay.server.com]
@domain2.com [relay.server.com]
Я также изменил relayhost в файле main.cf, чтобы отслеживать, работает ли конфигурация.