Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Lightweight configuration to send email

I've installed Server on a computer in my home network. I'd like to support programmatic mailing from PHP code (my particular use case is a MediaWiki installation in my Web space), shell scripts, and similar APIs. I am not interested in receiving mail, nor in sending mail on behalf of clients.


What is the simplest/best practice way to accomplish this? Possibilities:

  • Turn on Mail (postfix), limit access to Private Networks. Possibly overkill, but it mostly works. I had some success in tests, but messages sent to some addresses did not arrive -- I worry about other servers rejecting the messages because this isn't a first-class mail server (for example, it doesn't have a registered domain name)
  • Turn on Mail as above, add the ISP relay option pointing to my usual ISP SMTP server (where I point my mail client). My initial attempts to do this didn't work (authentication issues), but I could experiment more... Don't know if this makes other servers more likely to trust me.
  • Add some settings in /Library/Server/Web/Config/php/php.ini. Of course, that only addresses the PHP use case, and duplicating the settings in a handful of different places is not ideal. Not sure if I need to use authentication here, and it seems like PHP's mail() function doesn't support it. Also, some docs indicate that these SMTP customization features are Windows only?


Appreciate any suggestions.

Mac mini, OS X Yosemite (10.10.1)

Posted on May 27, 2015 12:08 PM

Reply
2 replies

May 27, 2015 4:45 PM in response to Daniel L. Smith

Some additional details from testing the "Relay outgoing mail through ISP" option:


- If I just type in the server name, it connects on port 25 and the log records this response: "550-Reason: This system will not accept messages from servers/devices with no reverse DNS."


- If I add my credentials login, there's an error: "SASL authentication failed; cannot authenticate to server" and "no mechanism available"


- If I add ":587" to the server name and use no authentication, there's an error: "553 sorry, authentication required but not provided"


- If I add ":587" to the server name and provide login credentials, I get the same error as above: "SASL authentication failed; cannot authenticate to server" "no mechanism available"


FWIW, my Mail.app client settings are: port 587, use SSL, no TLS certificate, password authentication

May 28, 2015 9:05 AM in response to Daniel L. Smith

Solution for the "SASL authentication failed; cannot authenticate to server" error: add these lines to the top of /Library/Server/Mail/Config/postfix/main.cf:


smtp_sasl_security_options = noanonymous, noplaintext

smtp_sasl_tls_security_options = noanonymous


Now I can send to the relay server's port 587 with my username/password (and the password is safely encrypted -- plain text sent within a TLS connection).


(Seems like Server should do this automatically? I'm not sure there's anything atypical about my setup...)


Anyway, this means my second bullet in the original post is viable. Still curious about whether this is the best approach.

Lightweight configuration to send email

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.