如何为 Xcode 持续集成配置电子邮件设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20436003/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:23:49  来源:igfitidea点击:

How to configure email settings for Xcode Continuous Integration

xcode

提问by Toland Hon

I've set up Mavericks and OSX Server and have gotten Xcode bots up and running. There's a notification setting on each bot that allows you to email all committers on success or on failure. I've enabled that option and added an additional email address to test.

我已经设置了 Mavericks 和 OSX Server,并且已经启动并运行了 Xcode 机器人。每个机器人上都有一个通知设置,允许您在成功或失败时通过电子邮件向所有提交者发送电子邮件。我已启用该选项并添加了一个额外的电子邮件地址进行测试。

I can't seem to figure where to configure the email settings (i.e. smtp server, login, password). I've tried enabling Mail on OSX Server and set it to relay outgoing email through ISP, but that didn't seem to help.

我似乎无法弄清楚在哪里配置电子邮件设置(即 smtp 服务器、登录名、密码)。我尝试在 OSX Server 上启用邮件并将其设置为通过 ISP 中继外发电子邮件,但这似乎没有帮助。

Any guidance would be appreciated.

任何指导将不胜感激。

采纳答案by Toland Hon

In order for emails to be sent out, all you have to do is set up postfix on your OSX machine.

为了发送电子邮件,您所要做的就是在您的 OSX 机器上设置 postfix。

Here's 2 guides I used when setting it up:

这是我在设置时使用的 2 个指南:

Afterwards, the emails got sent out without any issues.

之后,电子邮件被发送出去,没有任何问题。

回答by David Bernard

These instructions are specific to the use case of a Xcode server running on a host not previously set up as a server.

这些说明特定于在先前未设置为服务器的主机上运行的 Xcode 服务器的用例。

Xcode Server runs as a system user and does not have access to user email settings. When it generates emails, it uses the hostname and domain of the system and queues the email for delivery. Typically, unless the system has been set up as a server, the email goes nowhere from an email address unacceptable to ISPs and other mail providers.

Xcode Server 以系统用户身份运行,无权访问用户电子邮件设置。当它生成电子邮件时,它使用系统的主机名和域并将电子邮件排队以进行传送。通常,除非系统已设置为服务器,否则电子邮件不会从 ISP 和其他邮件提供商无法接受的电子邮件地址发送出去。

OS X Server on Mavericks comes with a Mail server.

Mavericks 上的 OS X Server 带有邮件服务器。

The following step set up the Mail server to relay all system mail to a mail service provider modifying the "From" address to a fixed name.

以下步骤设置邮件服务器将所有系统邮件中继到邮件服务提供商,将“发件人”地址修改为固定名称。

Step 1: Use the "Server" application and examine the server configuration by clicking on your computer in the server section. Record the "Host Name:".

步骤 1:使用“服务器”应用程序并通过在服务器部分单击您的计算机来检查服务器配置。记录“主机名:”。

Step 2: In /Library/Server/Mail/Config/postfix

第 2 步:在 /Library/Server/Mail/Config/postfix

Add to the file main.cf:

添加到文件 main.cf:

smtp_generic_map = hash:/Library/Server/Mail/Config/generic

Create a file generic:

创建一个文件generic

@<host name> <user name>@<domain name>

Where <host name>is the host name recorded above and <user name>@<domain name>is the email address you want as the source of all emails from this host.

<host name>上面记录的主机名在哪里,是<user name>@<domain name>您想要作为来自该主机的所有电子邮件的来源的电子邮件地址。

Step 3: Using the "Server" application, set the email relay in Services>Mail. Check Relay outgoing mail through ISP. Click edit to set the parameters.

第 3 步:使用“服务器”应用程序,在“服务”>“邮件”中设置电子邮件中继。检查通过 ISP 中继外发邮件。单击编辑以设置参数。

Step 4: Turn on the mail server.

第 4 步:打开邮件服务器。

Step 5: Test from terminal:

第 5 步:从终端测试:

bash$ mail xxxx@xxxxx
Subject: Test
Test
.
bash$