Назад | Перейти на главную страницу

G Suite SMTP Relay отклоняет правильный IP-адрес

Я пытаюсь настроить ретрансляцию почты с веб-сервера (запущенного в домене example.com) в мой домен G Suite example.com.

Я настроил службы ретрансляции SMTP в консоли администратора G Suite следующим образом:

Это IP-адрес моего веб-сервера. На этом веб-сервере я настроил Postfix следующим образом:

# 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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# Force EHLO
smtp_always_send_ehlo = yes
smtp_helo_name = example.com

# 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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost = smtp-relay.gmail.com:587
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 = all

Вот, /etc/mailname содержит домен example.com.

При отправке тестового письма:

echo "Test Email message body" | mail -a "From: noreply@example.com" -s "Email test subject" myuser@example.com

В журнале Postfix я вижу следующие ошибки:

Oct  3 12:34:01 example postfix/pickup[3152]: 0EEC94078D: uid=0 from=<noreply@example.com>
Oct  3 12:34:01 example postfix/cleanup[3159]: 0EEC94078D: message-id=<20191003103401.0EEC94078D@example.com>
Oct  3 12:34:01 example postfix/qmgr[3154]: 0EEC94078D: from=<noreply@example.com>, size=351, nrcpt=1 (queue active)
Oct  3 12:34:01 example postfix/smtp[3165]: 0EEC94078D: to=<myuser@example.com>, relay=smtp-relay.gmail.com[173.194.76.28]:587, delay=0.14, delays=0.05/0.02/0.04/0.02, dsn=5.7.1, status=bounced (host smtp-relay.gmail.com[173.194.76.28] said: 550-5.7.1 Invalid credentials for relay [xx.xx.xx.xx]. The IP address you've 550-5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of 550-5.7.1 the account this email is being sent from. If you are trying to relay 550-5.7.1 mail from a domain that isn't registered under your G Suite account 550-5.7.1 or has empty envelope-from, you must configure your mail server 550-5.7.1 either to use SMTP AUTH to identify the sending domain or to present 550-5.7.1 one of your domain names in the HELO or EHLO command. For more 550-5.7.1 information, please visit 550 5.7.1  https://support.google.com/a/answer/6140680#invalidcred r20sm35107wrg.39 - gsmtp (in reply to MAIL FROM command))
Oct  3 12:34:01 example postfix/smtp[3165]: 0EEC94078D: lost connection with smtp-relay.gmail.com[173.194.76.28] while sending RCPT TO
Oct  3 12:34:01 example postfix/cleanup[3159]: 2EA054078E: message-id=<20191003103401.2EA054078E@example.com>
Oct  3 12:34:01 example postfix/qmgr[3154]: 2EA054078E: from=<>, size=3673, nrcpt=1 (queue active)
Oct  3 12:34:01 example postfix/bounce[3166]: 0EEC94078D: sender non-delivery notification: 2EA054078E
Oct  3 12:34:01 example postfix/qmgr[3154]: 0EEC94078D: removed
Oct  3 12:34:01 example postfix/smtp[3165]: 2EA054078E: to=<noreply@example.com>, relay=smtp-relay.gmail.com[173.194.76.28]:587, delay=0.14, delays=0.01/0/0.09/0.04, dsn=5.1.1, status=bounced (host smtp-relay.gmail.com[173.194.76.28] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1  https://support.google.com/mail/?p=NoSuchUser n2sm5452eja.13 - gsmtp (in reply to RCPT TO command))
Oct  3 12:34:01 example postfix/qmgr[3154]: 2EA054078E: removed

В частности ошибка:

Недействительные учетные данные для реле [xx.xx.xx.xx]. IP-адрес, который вы зарегистрировали в своей службе SMTP Relay G Suite, не соответствует домену учетной записи, с которой отправляется это электронное письмо. Если вы пытаетесь ретранслировать почту из домена, который не зарегистрирован под вашей учетной записью G Suite или имеет пустой конверт, вы должны настроить свой почтовый сервер на использование SMTP AUTH для идентификации отправляющего домена или для представления одного из ваших доменов. имена в команде HELO или EHLO. Для получения дополнительной информации, пожалуйста, посетите https://support.google.com/a/answer/6140680#invalidcred r20sm35107wrg.39 - gsmtp (в ответ на команду MAIL FROM))

Я проверил журналы отладки и EHLO сообщение отправлено с доменом example.com.

Я не знаю, что еще попробовать. я прочел эта почта и вот этот но мои настройки, похоже, им соответствуют. Я не хочу аутентификации SMTP; просто отправка с соответствующего IP должна работать.

Я также заметил, что иногда в сообщении об ошибке указывается мой IPv6-адрес, который я также добавил в список действительных IP-адресов / диапазонов, но он все равно отклоняет его.

У меня запущено другое приложение, использующее аутентификацию SMTP, и оно отлично работает ...

Что я могу сделать?