Reputation: 20756
I have two questions about SMTP RFC:
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?
Thanks in advance.
Upvotes: 0
Views: 111
Reputation: 32923
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.
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.
Upvotes: 1
Reputation: 38593
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.
Upvotes: 1