# 邮件作业在最新更新后失败，证书验证失败（无法获取本地颁发者证书）

**URL:** <https://meta.discourse.org/t/email-jobs-failing-after-latest-update-certificate-verify-failed-unable-to-get-local-issuer-certificate/227720>\
**Category:** Self-hosting\
**Created:** [2022年五月21日 18:30 UTC](https://meta.discourse.org/t/email-jobs-failing-after-latest-update-certificate-verify-failed-unable-to-get-local-issuer-certificate/227720 "2022-05-21T18:30:55Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![bwanamarko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bwanamarko/32/171450_2.png) [@bwanamarko](https://meta.discourse.org/u/bwanamarko)\
**Post date:** [2022年六月1日 01:01 UTC](https://meta.discourse.org/t/email-jobs-failing-after-latest-update-certificate-verify-failed-unable-to-get-local-issuer-certificate/227720/9 "2022-06-01T01:01:50Z")

</div>

@RGJ 感谢大家的帮助。我终于、终于解决了这个问题。用于 office365 的 [调整](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326#office-365-tweaks-13) 是使用 `DISCOURSE_SMTP_AUTHENTICATION: login`。

[office365 smtp 服务器和端口配置](https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-8361e398-8af4-4e97-b147-6c6c4ac95353) 是 `smtp.office365.com:587`，并启用了 `STARTTLS`，这无论如何都是默认设置。

用户名是组织中使用的 office365 的完整电子邮件地址，通常是 `myaccount@mycompany.onmicrosoft.com`。这可能与您的通知电子邮件相同，也可能不同。

这是我的最终配置：

```plaintext

  DISCOURSE_SMTP_ADDRESS: smtp.office365.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: myacct@mycompany.onmicrosoft.com
  DISCOURSE_SMTP_PASSWORD: mypassword
  DISCOURSE_SMTP_ENABLE_START_TLS: true
  DISCOURSE_SMTP_DOMAIN: outlook.com
  DISCOURSE_NOTIFICATION_EMAIL: myacct@mycompany.com
  DISCOURSE_SMTP_AUTHENTICATION: login

```

根据 Mail Tester 的测试，结果是 10 分满分！

---

_[View the full topic](https://meta.discourse.org/t/email-jobs-failing-after-latest-update-certificate-verify-failed-unable-to-get-local-issuer-certificate/227720)._
