Macbook air mail: how to configure HELO sent to smtp server

emailsmtp

Hello I am trying to set up a mail account on a new macbook air (Lion 10.7.5 Build 11G63B). I have gone through all the steps but it will not connect to the smtp server. I am using straight SMTP (not SSL) with a username and password that I have verified are correct.

The connection doctor shows that the connection is being rejected due to the HELO that is sent to it:

HELO mymac.mydomain\.co\.uk
501 HELO requires valid address

I have reproduced the above error with a telnet to the SMTP server. With mymac.mydomain\.co\.uk I get the above error. With mymac.mydomain.co.uk it authenticates correctly.

How do I stop the macbook sending a garlbed HELO ?


Further detail on the SMTP setup. I have set the following:

  • Description
  • Server Name = the fqdn of the smtp server (definately correct)
  • Use custom Port 25 (only while trying to get it to work – I expect the 'use default ports' option would be ok)
  • Use SSL is unchecked (don't use SSL)
  • Username set to known correct username
  • Password set to known correct password

There are no other settings available. The smtp bit of this site: http://www.plus.net/support/email/setup/mail-107-smtp.shtml reflects what I was doing.

Best Answer

(I apologize in advance for the wishy-washiness of this answer, but while I hope I'm on the right track, I do have some gaps in my knowledge.)

The SMTP HELO message, while something of a relic, is supposed to allow the client to identify itself to a server. It is still required for the protocol and is generally expected to at least be a syntactically valid hostname (which yours is not.) Your SMTP server appears to be complaining because it is indeed invalid.

Mail uses the name of your Mac, or the hostname assigned by the DHCP server on your network. DHCP servers don't always assign a hostname. OS X prefers a DHCP assigned hostname over using the computer's name as the hostname.

Based on this, the first place I'd look is my network configuration. I wonder, if you opened a terminal and typed hostname -f, what would you get? Possibly

$ hostname -f
mymac.mydomain\.co\.uk

If you do get this, the next step is to identify where it's coming from. A likely source could be a misconfigured DHCP server. You can try

$ sudo hostname mymac.mydomain.co.uk

to temporarily change the hostname for testing, or

$ sudo scutil --set HostName mymac.mydomain.co.uk

to set it permanently.

Related Question