【问题标题】:Sendgrid on Compute Engine not workingCompute Engine 上的 Sendgrid 无法正常工作
【发布时间】:2019-03-20 08:29:52
【问题描述】:

我像这里的指南一样使用 sendgrid 设置 Postfix:https://developers.google.com/compute/docs/sending-mail?hl=en#postfixsendgrid

但它不起作用。当我运行测试命令时:

printf 'Subject: test\r\n\r\npassed' | /usr/sbin/sendmail myemail@gmail.com

我在日志中收到此错误:

Sep  1 11:58:12 instance-1 postfix/qmgr[23412]: 8205A1E38: from=<*******@instance-1.c.mindful-vial-682.internal>, size=301, nrcpt=1 (queue active)
Sep  1 11:58:12 instance-1 postfix/smtp[23422]: warning: SASL authentication failure: No worthy mechs found
Sep  1 11:58:12 instance-1 postfix/smtp[23422]: 8205A1E38: SASL authentication failed; cannot authenticate to server smtp.sendgrid.net[208.43.76.147]: no mechanism available
Sep  1 11:58:13 instance-1 postfix/smtp[23422]: warning: SASL authentication failure: No worthy mechs found
Sep  1 11:58:13 instance-1 postfix/smtp[23422]: 8205A1E38: to=<myemail@gmail.com>, relay=smtp.sendgrid.net[208.43.76.146]:2525, delay=0.62, delays=0.01/0.02/0.59/0, dsn=4.7.0, status=deferred (SASL
 authentication failed; cannot authenticate to server smtp.sendgrid.net[208.43.76.146]: no mechanism available)

【问题讨论】:

    标签: postfix-mta google-compute-engine sendgrid


    【解决方案1】:

    如果您使用的是 debian,则还需要安装 libsasl2-modules

    apt-get install libsasl2-modules
    

    这解决了我的问题。

    【讨论】:

    • 谢谢!花了 2 个小时浏览网页和配置文件,但没有任何成功。这终于解决了!
    • 这对我也有用(使用 Ubuntu 14/Postfix/Sendgrid)。
    【解决方案2】:

    或使用 yum(即 RedHat、Fedora、CentOS):

    yum install cyrus-sasl-plain
    

    sendgrid docs找到了这个解决方案

    【讨论】:

      【解决方案3】:

      尝试阅读 [1] 中记录的“未找到有价值的机甲”错误的解决方案。

      亲切的问候 保罗

      [1] - http://www.postfix.org/SASL_README.html#client_sasl_policy

      【讨论】:

        【解决方案4】:

        能够在 Google Compute Engine 上解决此问题的唯一方法是在 postfix 配置文件中静态链接我的 sendgrid 凭据:

        # Sendgrid Settings
        smtp_sasl_auth_enable = yes
        smtp_sasl_password_maps = static:SENDGRID_ACCOUNT_EMAIL_HERE:PASSWORD_HERE
        smtp_sasl_security_options = noanonymous
        smtp_tls_security_level = may
        header_size_limit = 4096000
        relayhost = [smtp.sendgrid.net]:587
        

        我在this answer找到了这个解决方案

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2015-10-16
          • 1970-01-01
          • 2014-08-30
          • 1970-01-01
          • 2016-12-01
          • 2017-08-11
          • 2021-05-20
          相关资源
          最近更新 更多