But many mailers will accept unresolvable names in EHLO. And
Section 4.1.4 says
An SMTP server MAY verify that the domain name parameter in the
EHLO command actually corresponds to the IP address of the client.
However, the server MUST NOT refuse to accept a message for this
reason if the verification fails: the information about
verification failure is for logging and tracing only.
So you're not supposed to validate the EHLO field.
Further, Section 4.1.1.1 allows for something *other* than primary
domain names or address literals:
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
Ok, that's a SHOULD, not a MUST. So if there's no primary domain
name, and the client doesn't want to send an address literal, what
does it send?
And what address literal does it send? [127.0.0.1] seems to be OK.
Many spammers send an address literal of the IP of the recipients MTA.