title: Proper response to SMTP HELO
body: <p>The following is the beginning of an SMTP transaction example shown in the
  textbook <em>Computer Networking (6th international edition)</em>:</p>
  <pre><code>S: 220 hamburger.edu
  C: HELO crepes.fr
  S: 250 Hello crepes.fr, pleased to meet you
  </code></pre>
  <p>The <code>S:</code> prefix indicates that it is a line sent by the server, <code>C:</code> that it is
  a line sent by the client. The Wikipedia page <a href="https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol#SMTP_transport_example" rel="nofollow noreferrer">SMTP</a> has an SMTP
  example that has a similar response to <code>HELO</code>.</p>
  <p>Is the server's response to <code>HELO</code> spec compliant? <a href="https://www.rfc-editor.org/rfc/rfc5321#page-33" rel="nofollow noreferrer">RFC 5321</a>
  specifies the server's response to <code>HELO</code>/<code>EHLO</code> thus:</p>
  <pre><code>ehlo-ok-rsp    = ( &quot;250&quot; SP Domain [ SP ehlo-greet ] CRLF )
                      / ( &quot;250-&quot; Domain [ SP ehlo-greet ] CRLF
                      *( &quot;250-&quot; ehlo-line CRLF )
                      &quot;250&quot; SP ehlo-line CRLF )
  </code></pre>
  <p>As I understand the spec, the server's response in the above example should be</p>
  <pre><code>250 hamburger.edu
  </code></pre>
  <p>That is, it should respond with <code>250</code> followed by its own hostname, not the
  client's hostname, and certainly not the arbitrary greeting message shown
  in the example.</p>
  <p>What is the proper response to <code>HELO</code>?
  Is the <em>Computer Networking</em> example incorrect?</p>