【问题标题】:SMTP authentication failure while using SendGrid/Gmail使用 SendGrid/Gmail 时 SMTP 身份验证失败
【发布时间】:2013-02-06 10:15:47
【问题描述】:

我在服务器上收到 SMTP 身份验证失败,邮件仅通过服务器 SMTP 发送...

这似乎是服务器配置或相关问题,但我不确定。

这是调试细节:

250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

Failed to authenticate password. Error: 535 Incorrect authentication data

from: 250 OK

to: 250 Accepted

data: 354 Enter message, ending with "." on a line by itself

250 OK id=1U8Pjp-0002As-FB

quit: 221 ************** closing connection

Your message has been successfully sent using the following protocol: smtp

从我的本地系统进行测试时,这是可行的,并且电子邮件正在通过 sendgrid.me 发送

同样,这可能不是 SendGrid 问题,但如果您遇到类似问题,您能告诉我这里有什么问题吗?

我正在使用 CentO,并且我在服务器中有 cPanel。我相信我们正在使用 EXIM 作为邮件服务器。

【问题讨论】:

    标签: centos cpanel sendgrid exim


    【解决方案1】:

    对于将来遇到此问题并使用 cpanel/whm 的任何人,您需要在 WHM 的“SMTP 限制”下“禁用”此选项。

    【讨论】:

    • 首页 >> 安全中心 >> SMTP限制
    【解决方案2】:

    我能够解决这个问题。

    问题是我的服务器不允许使用外部 SMTP 并使用自己的 SMTP 服务器。我更改了设置,现在可以正常使用了。

    【讨论】:

    • 我可以知道您在哪里进行了更改吗?在 cPanel WHM 面板上还是在哪里?我正在处理同样的问题,我想知道你。
    【解决方案3】:

    我用的是centos 7 终于可以了!

    我遇到了这个问题(tail -f /var/log/mailog):

    to=<usmanali@example.com>, relay=smtp.sendgrid.net[169.45.113.201]:587, delay=0.3, delays=0.05/0.07/0.16/0.02, dsn=5.0.0, status=bounced (host smtp.sendgrid.net[169.45.113.201] said: 550 Unauthenticated senders not allowed (in reply to MAIL FROM command))
    

    然后我以这种方式更改了文件/etc/postfix/main.cf,将以下行添加到文件末尾

    mtpd_sasl_local_domain = $myhostname
    smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
    mailbox_size_limit = 256000000
    
    # Sendgrid Settings
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = static:apikey:SG.YOUR_SENDGRID_KEY
    smtp_sasl_security_options = noanonymous
    smtp_tls_security_level = may
    header_size_limit = 4096000
    relayhost = [smtp.sendgrid.net]:587
    

    然后使用以下方法安装 postfix 缺少的模块依赖项:

    sudo yum install cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain
    

    然后重启postfix

    sudo systemctl restart  postfix.service
    

    【讨论】:

      猜你喜欢
      • 2019-03-14
      • 2012-06-16
      • 2022-08-17
      • 2018-06-23
      • 2011-10-09
      • 2015-10-14
      • 2016-02-29
      • 1970-01-01
      • 2014-07-21
      相关资源
      最近更新 更多