Toland Hon
Toland Hon

Reputation: 4619

How to configure email settings for Xcode Continuous Integration

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.

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.

Any guidance would be appreciated.

Upvotes: 9

Views: 5666

Answers (2)

David Bernard
David Bernard

Reputation: 306

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

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.

OS X Server on Mavericks comes with a Mail 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:".

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

Add to the file main.cf:

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

Create a file 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.

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.

Step 4: Turn on the mail server.

Step 5: Test from terminal:

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

Upvotes: 1

Toland Hon
Toland Hon

Reputation: 4619

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

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

Afterwards, the emails got sent out without any issues.

Upvotes: 6

Related Questions