3

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: enter image description here enter image description here

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

Any help is appreciated. Many thanks!

aheze
  • 24,434
  • 8
  • 68
  • 125
nigong
  • 1,727
  • 3
  • 19
  • 33
  • I have the same problem. Did you find the reason meanwhile? – Darko Jan 05 '18 at 09:57
  • @Darko Hi Darko, sorry I didn't find anything useful meanwhile. I'm pretty sure I tried everything I could find but with no luck, which makes me think this is a bug from XCode Server or MacOS... – nigong Jan 05 '18 at 20:48
  • I just filed a bug report (rdar://37764393). Having the same problem. I'm using Amazon SES, and can send mail using Mail.app but not with Xcode. – Hal Mueller Feb 21 '18 at 23:47

1 Answers1

1

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

enter image description here

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.

enter image description here

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

Darko
  • 9,655
  • 9
  • 36
  • 48