Question

I have two questions about SMTP RFC:

  • What value should I pass as the argument for the EHLO command if I don't have my own domain name?

The domain name given in the EHLO command MUST be either a primary host name (a domain name that resolves to an address RR) or, if the host has no name, an address literal, as described in Section 4.1.3 and discussed further in the EHLO discussion of Section 4.1.4.

I don't really undesrstand Section 4.1.3. Can you give me an example or rephrase it?

  • Which headers are required to send in the DATA section?

Thanks in advance.

Was it helpful?

Solution

Argument to EHLO in the absence of a domain name

Section 4.1.3 Address Literals of RFC 2821 says:

Sometimes a host is not known to the domain name system and communication (and, in particular, communication to report and repair the error) is blocked. To bypass this barrier a special literal form of the address is allowed as an alternative to a domain name. For IPv4 addresses, this form uses four small decimal integers separated by dots and enclosed by brackets such as [123.255.37.2], which indicates an (IPv4) Internet Address in sequence-of-octets form.

so a simple EHLO [123.255.37.2] suffices (with the actual IP address of your SMTP server of course). Or it could be a properly formatted IPv6 instead.

Required headers

Section 3.6. Field definitions of RFC 2822 says:

The only required header fields are the origination date field and the originator address field(s). All other header fields are syntactically optional.

so only From: and Date: are required.

OTHER TIPS

If you don't have a domain name, you should use your IP address:

EHLO [192.168.1.1]

It's kind of a ridiculous requirement in the protocol seeing as how there's no real value in this piece of information. The server shouldn't trust it (obviously) and it is trivial for the server to get the IP address of the connecting client, anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top