The value of "localhost" in HELO localhost

In SMTP, what should appear after the HELO command and what does it do?

I send emails in my application, and I wonder if I should use localhost, the domain name of the recipient ( me@example.com ), the domain name of the application server (where this email is sent from) or something else.

+4
source share
2 answers

The parameter after HELO should identify the system sending the email. Thus, you would use the DNS address name for your sending machine.

Do not use localhost because a lot of spam software does this and your email will be marked as spam.

From RFC 2821 :

4.1.1.1 Advanced HELLO (EHLO) or HELLO (HELO)

These commands are used to identify the SMTP client for the SMTP server. The argument field contains the fully qualified domain name of the SMTP client, if one is available.

I usually recommend that you use a real MTA and send your email to MTA for maximum delivery. Thus, you do not need to re-implement the implementation of the SMTP protocol, which is surprisingly easy to make a mistake.

+5
source

This should be the domain name of the application server.

  HELO <SP> <domain> <CRLF> In the HELO command the host sending the command identifies itself; the command may be interpreted as saying "Hello, I am <domain>". 

http://tools.ietf.org/html/rfc821

+1
source

Source: https://habr.com/ru/post/1343576/


All Articles