Remove .local Domain from Sent Mail – How to Guide

bonjouremailNetworkserver.app

I am running OS X Server on Snow Leopard (10.6), but I believe this same issue affects newer versions as well. (If the problem can be resolved by switching to a newer version, that would be welcome information.)

My server identifies itself as xxx-com.local rather than xxx.com. For example:

This is the mail system at host xxx-com.local.

Although I have not had problems (other than the ugliness of this) in the past, I have recently had mail bounce because of this problem. For example:

Diagnostic-Code: smtp; 554 5.7.1 <xxx-com.local>: Helo command
rejected: ACCESS DENIED. Your email was rejected because the sending mail
server does not identify itself correctly (.local)

I understand that this is the Bonjour name, but Bonjour is not applicable outside of my local network. How can I force my email server to identify itself correctly?

Best Answer

The solution is to edit the main.cf file in /etc/postfix, and change the myhostname = xxx-com.local line to myhostname = xxx.com. OS X Server appears to honor this change, and not attempt to change it back. However, in my opinion, OS X Server should not have chosen such an absurd default value.