AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 863208
Accepted
NoMad
NoMad
Asked: 2017-07-21 01:22:13 +0800 CST2017-07-21 01:22:13 +0800 CST 2017-07-21 01:22:13 +0800 CST

Office 365 中继访问被拒绝(响应 RCPT TO 命令)

  • 772

我已将后缀配置为开放中继,以将邮件推送到 Office 365 SMTP 连接器。连接器配置为静态 IP 地址身份验证,工作正常。

当我尝试使用 telnet 发送邮件时,Office365 退回: host smtp.office365.com[40.101.125.210] said: 550 Relay access denied (in reply to RCPT TO command)

我是否需要在 O365 中设置特殊权限才能允许从连接器发送邮件?会不会有不允许这样做的规则?我不是 O365/Exchange 方面的专家...

我还测试了同一域 (mydomain.com) 和不同 FROM 地址上的其他收件人。该域在 O365 在线交换界面的“接受域”(mydomain.com - 授权)下列出,并且远程域中只有一个条目(默认 * = 允许所有远程域)。

编辑: main.cf 现在有正确的中继地址(relayhost 选项)。问题仍然存在。

以下是来自我的 SMTP 中继的更多详细信息:

/var/log/mail.log:

Jul 20 10:31:11 smtp postfix[4704]: Postfix is running with backwards-compatible default settings
Jul 20 10:31:11 smtp postfix[4704]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jul 20 10:31:11 smtp postfix[4704]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jul 20 10:31:12 smtp postfix/master[4741]: daemon started -- version 3.1.0, configuration /etc/postfix
Jul 20 10:31:18 smtp postfix/smtpd[4745]: connect from unknown[192.168.1.25]
Jul 20 10:31:49 smtp postfix/smtpd[4745]: 04D8E2E061E: client=unknown[192.168.1.25]
Jul 20 10:32:05 smtp postfix/cleanup[4749]: 04D8E2E061E: message-id=<20170720083149.04D8E2E061E@smtp>
Jul 20 10:32:05 smtp postfix/qmgr[4743]: 04D8E2E061E: from=<[email protected]>, size=328, nrcpt=1 (queue active)
Jul 20 10:32:05 smtp postfix/smtp[4750]: 04D8E2E061E: to=<[email protected]>, relay=smtp.office365.com[40.101.125.210]:25, delay=29, delays=29/0.01/0.12/0.01, dsn=5.0.0, status=bounced (host smtp.office365.com[40.101.125.210] said: 550 Relay access denied (in reply to RCPT TO command))
Jul 20 10:32:05 smtp postfix/cleanup[4749]: 641272E0635: message-id=<20170720083205.641272E0635@smtp>
Jul 20 10:32:05 smtp postfix/qmgr[4743]: 641272E0635: from=<>, size=2145, nrcpt=1 (queue active)
Jul 20 10:32:05 smtp postfix/bounce[4751]: 04D8E2E061E: sender non-delivery notification: 641272E0635
Jul 20 10:32:05 smtp postfix/qmgr[4743]: 04D8E2E061E: removed
Jul 20 10:32:05 smtp postfix/smtp[4750]: 641272E0635: to=<[email protected]>, relay=smtp.office365.com[40.101.61.114]:25, delay=0.01, delays=0/0/0/0, dsn=5.0.0, status=bounced (host smtp.office365.com[40.101.61.114] said: 550 Relay access denied (in reply to RCPT TO command))
Jul 20 10:32:05 smtp postfix/qmgr[4743]: 641272E0635: removed
Jul 20 10:32:09 smtp postfix/smtpd[4745]: disconnect from unknown[192.168.1.25] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5

我的远程登录输入:

root@smtp:/etc/postfix# telnet 192.168.1.25 25
Trying 192.168.1.25...
Connected to 192.168.1.25.
Escape character is '^]'.
220 smtp ESMTP Postfix (Ubuntu)
EHLO localhost
250-smtp
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: [email protected]
250 2.1.0 Ok
RCPT TO: [email protected]
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: Testmail
Test

.
250 2.0.0 Ok: queued as 921452E061E
QUIT
221 2.0.0 Bye
Connection closed by foreign host.

postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
inet_interfaces = 192.168.1.25
inet_protocols = ipv4
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = www.mydomain.com, $myhostname, smtp, localhost.localdomain, localhost
myhostname = smtp
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24
myorigin = /etc/mailname    #mydomain.com
readme_directory = no
recipient_delimiter = +
relay_domains = static:ALL
relay_transport = relay
relayhost = smtp.office365.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
postfix
  • 1 1 个回答
  • 6217 Views

1 个回答

  • Voted
  1. Best Answer
    Appleoddity
    2017-07-21T01:26:24+08:002017-07-21T01:26:24+08:00

    您连接到错误的主机以尝试传递电子邮件。

    您连接的主机与您域的 MX 记录中列出的主机相同。它通常看起来像:your-domain.mail.protection.outlook.com

    以下是有关如何设置通过 Office 365 进行中继的信息:https: //support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-电子邮件使用-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4

    • 1

相关问题

  • Postfix 在特定端口上接受邮件

  • 让 Postfix 以两种方式处理垃圾邮件

  • Postfix 或 exim:自动/程序化和转发电子邮件设置

  • 后缀电子邮件地址

  • 什么是最好的开源电子邮件解决方案包

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve