CI - Xcode 9 Server 集成后不发送电子邮件 [英] CI - Xcode 9 Server doesn't send email after integration

查看:17
本文介绍了CI - Xcode 9 Server 集成后不发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够设置 Server &使用 Xcode 9 的机器人(

但是,不会发送或接收电子邮件.我想知道是否需要任何额外的设置.

感谢任何帮助.非常感谢!

解决方案

经过 20 个小时的搜索,我终于找到了问题所在.我将尝试描述使其工作所需的步骤:

  1. 在您的 CI 服务器上,需要配置 postfix SMTP 服务器并使其正常工作.网上有很多教程.我使用的是这个:

将允许安全性较低的应用"设置为开.我建议为此创建一个专用的 Gmail 帐户,不要在您的日常电子邮件帐户中启用此设置.

现在一切正常,我能够使用 macOS cli 命令 mail 成功发送邮件.

  1. 解决此问题所需的最后一步是正确设置 Xcode 服务器设置.(这基本上回答了 OP 的问题).因此,正确设置(在 mail cli 工作之后)是 不在 Xcode 服务器中设置任何设置.只需删除所有设置,然后 Xcode 服务器将回退到 postfix.

只需删除所有设置,就可以了.现在 Xcode CI 服务器成功发送电子邮件.

I was able to setup Server & Bots with Xcode 9 (ref). The integration can be run smoothly. However, the expected email report is never sent.

I've already setup my Mac to send emails using postfix. For example, I can run this command and then receive the email:

$ date | mail -s test1 nigong@mydomain.com

To make Xcode send email, I have done the following setups:

However, no email is sent or received. I wonder if there is any additional setup is needed.

Any help is appreciated. Many thanks!

解决方案

After 20 hours searching I finally found the problem. I will try to describe the needed steps to get this working:

  1. On your CI server the postfix SMTP server needs to be configured and working. There are multiple tutorials on the internet. The one I used was this one:

https://blog.anupamsg.me/2012/02/14/enabling-postfix-for-outbound-relay-via-gmail-on-os-x-lion-11/

However, I still was not able to sent a mail with the mail command after I configured everything like explained in the tutorial.

  1. The missing piece was the Gmail setting for "less secure apps". Gmail does not allow sending emails over their SMTP even if login and password are correct. The SMTP server needs to fulfill special requirements. (which I am not aware of...) However, it is possible to losen that restriction and allow access from any SMTP. Here:

https://support.google.com/accounts/answer/6010255

Set "Allow less secure apps" to On. I recommend creating a dedicated Gmail account just for this and not to enable this setting on your day-to-day email account.

Now everything was working and I was able to successfully send mails with the macOS cli command mail.

  1. The last step needed to solve this was to setup the Xcode server settings correctly. (and this is what basically answers OP's question). So, the correct setup (after mail cli works) was to not set any settings in Xcode server. Just remove all the settings, then Xcode server will fall back to postfix.

Just remove all settings, that's it. Now Xcode CI server sends successfully emails.

这篇关于CI - Xcode 9 Server 集成后不发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆