Yes, but unforunately this is one of those things that’s not always possible, especially for email clients that are behind NAT, like your standard desktop email client, and in my case, this also applies to my Nextcloud server. I mean what IP address and domain name should you include in the EHLO, if your email client is sitting behind NAT on an Internet connection with a dynamic IP address?
Also, the last section in the StackOverflow post you linked to says…
I would usually recommend that you use a real MTA, and hand off your email to the MTA for ultimate delivery. That way you don’t have to reinvent the implementation of the SMTP protocol, which is surprisingly easy to get wrong.
…which is exactley what you’re already doing, and btw the fact that your authenticating against your MTA is already proof that you’re authorized to send email through that MTA.
See here: https://www.ietf.org/rfc/rfc2821.txt
See also:
Section 4.1.4 of https://www.ietf.org/rfc/rfc2821.txt
The SMTP client MUST, if possible, ensure that the domain parameter
to the EHLO command is a valid principal host name (not a CNAME or MX
name) for its host. If this is not possible (e.g., when the client’s
address is dynamically assigned and the client does not have an
obvious name), an address literal SHOULD be substituted for the
domain name and supplemental information provided that will assist in
identifying the client.
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.
EDIT:
I could be wrong, but this seems to date back to a time when all hosts (clients and servers) had public IP addresses and emails were often sent directly from the client to the recipient’s SMTP server, which is hardly ever the case nowadays. The usual email route today is: sending email client → sending MTA → receiving MTA → receiving client.
Also, there are other mechanicsms in place nowdays to determine the authenticity of an email message, which mostly apply to the sending MTA, so no sane email provider will reject your email based on the EHLO of the client from which the message originates from. Unless the client is sending the message directly to the receiving SMTP server, in which case it will usually be rejected anyway, but most likely not based on the EHLO either.
My conclusion from this is that if the EHLO is relevant for deliverability at all, it would be the EHLO sent by the sending MTA to the receiving MTA, and not the EHLO of the client or server where the message originally was created on.