7

I have MX records setup at mail.domain.com and my domain is visible through domain.com

I am sending email via PHP PEAR Mail package.

This page claims I can change:

The value to give when sending EHLO or HELO. Default is localhost

As of right now, my email headers look like this:

Received: from domain.com ([12.34.56.78] helo=localhost

What should they look like? I assume:

helo=domain.com

???

darkAsPitch
  • 1,861
  • 4
  • 25
  • 42

2 Answers2

8

Cite from RFC 5321 4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO)

The argument field contains the fully-qualified domain name of the SMTP client if one is available.

In other words it should be the FQDN which resolves into the IP address you're sending mail from.

So, if you are sending mail from the IP address 12.34.56.78 and mail.domain.com resolves into 12.34.56.78 (and the DNS PTR for 12.34.56.78 is set to mail.domain.com) you should use mail.domain.com as the parameters for HELO (EHLO).

7heo.tk
  • 111
  • 4
AlexD
  • 8,179
  • 2
  • 28
  • 38
  • That is, the external IP. – hookenz Aug 29 '11 at 05:05
  • When I enter **hostname domain.com** I am shown: *domain.com has address 12.34.56.78 (AND newline) domain.com mail is handled by 0 domain.com* so I should be using domain.com for my HELO then, yes? – darkAsPitch Aug 29 '11 at 21:40
  • You should first check what 12.34.56.78 resolves to by issuing `host 12.34.56.78` (not `hostname` as above) and check if shown domain name resolves back to 12.34.56.78. – AlexD Aug 30 '11 at 10:11
  • Hah woops, entered "hostname" and ended up revoking my WHM/cPanel licenses :S Don't try that at home, kids! **host 12.34.56.78** resolves to domain.com, since rDNS was setup to send email from that domain name. – darkAsPitch Aug 30 '11 at 20:11
  • ... you should use mail.domain.com, is this really "**should**", or needs that word to be replaced with "**must**", or rephrase as "...you use mail.domain.com" as it looks like how it RFC 5321 is phrased? – Pro Backup Apr 27 '19 at 08:02
5

Your HELO/EHLO name should be the system's fully-qualified domain name.

In the immortal words of RFC2821 (emphasis added):

These commands are used to identify the SMTP client to the SMTP server. The argument field contains the fully-qualified domain name of the SMTP client if one is available. In situations in which the SMTP client system does not have a meaningful domain name (e.g., when its address is dynamically allocated and no reverse mapping record is available), the client SHOULD send an address literal (see section 4.1.3), optionally followed by information that will help to identify the client system. The SMTP server identifies itself to the SMTP client in the connection greeting reply and in the response to this command.

(the "address literal" is the address in brackets ([192.0.2.1]), or for v6 the address with an IPv6 prefix ([IPv6:fe80::1]))

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • I interpret "SHOULD" as "CAN", but not "MUST". E.g. if it's a NAT network, how should the client know the public IP? – TJJ Jan 24 '19 at 01:35