I've got an SMTP relay server that I recently replaced with OS X 10.10 Yosemite running Server.app. It is running as an SMTP-only relay allowing only hosts from the LAN to relay out through it. We do this so that all mail from our subnet is correctly sent from a verified host for our domain for Sender Policy Framework (SPF) and such.
Configuring to relay out was pretty easy. Following Apple's documentation for Disabling Mail services on OS X Server, I did the following:
sudo serveradmin settings mail:global:skip_enable_service_check = yes
sudo serveradmin settings mail:imap:enable_imap = no
sudo serveradmin settings mail:imap:enable_pop = no
sudo serveradmin settings mail:imap:enable_sieve = no
sudo serveradmin stop mail
sudo serveradmin start mail
That ensured that only SMTP is running and remains the case after rebooting or restarting the Mail service. Since the SMTP relay server's hostname is subdomain in the domain it's relaying for, I also had to modify /Library/Server/Mail/Config/postfix/main.cf
to remove $myhostname
& $mydomain
from "mydestination", the resulting line is as follows:
mydestination = localhost.$mydomain, localhost
That also worked, Server.app recognized and retains the change (as verified by running sudo serveradmin settings mail:postfix
). The same holds true for tweaks to the mynetworks
line to limit which subnets relaying was accepted from.
The problem I'm experiencing is that modifications to the smtpd_pw_server_security_options
line (specifically, to remove the LOGIN
& PLAIN
authentication types) will not stick and revert to the default (which includes the unwanted plaintext auth types) upon starting the Mail service. Apple's documentation on Apple-specific postfix options in Mac OS X Server imply that skipping the LOGIN
& PLAIN
options should be valid.
I have tried:
- the aforementioned modifications to
smtpd_pw_server_security_options
in/Library/Server/Mail/Config/postfix/main.cf
- As mentioned in the Apple-specific postfix options documentation, running
sudo serveradmin settings mail:postfix:smtpd_use_pw_server = no
(mail:postfix:smtpd_use_pw_server
seems to be an empty dictionary under Yosemite) - Running
sudo serveradmin settings postfix:smtp_sasl_auth_enable = yes
(it defaults to 'no' under Yosemite, so I assume Apple just swapped this option's functionality from the abovemail:postfix:smtpd_use_pw_server
option) - Using
serveradmin
to delete thelogin
&plain
elements from themail:postfix:smtpd_pw_server_security_options
array (e.g.sudo serveradmin settings mail:postfix:smtpd_pw_server_security_options:_array_index:2 = delete
), but as Charles Edge mentions in his kyrpted blog post about Removing 'serveradmin settings' Entries in OS X Server, that functionality seems to be broken. And, no these settings aren't mirrored in/Library/Server/Mail/Config/MailServicesOther.plist
or any other .plist, so manually modifying those doesn't appear to be an option.
I have gotten plaintext auth disabled temporarily using Server.app by toggling the plaintext authentication setting from a partially selected checkbox (presumably because IMAP is disabled) to a fully deselected checkbox, but it's inconsistent and doesn't stick after restarting the Mail service.
Any suggestions or solutions would be greatly appreciated, with the exception of advising not to use Server.app on OS X. This is for an all-Apple shop which must dog food Apple's products for reasons which I cannot get into here. Naturally, leaving plaintext auth enabled is also not an option for obvious security & PCI DSS compliance reasons.