[Mono-list] SmtpClient sends hostname instead of FQDN in EHLO

cocowalla colin.anderson333 at gmail.com
Sun Aug 9 20:05:52 UTC 2015


According to RFC 2821, SMTP clients should send the fully qualified domain
name of the sender, rather than the hostname:

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

SmtpClient does however only send the hostname. This is actually consistent
with the .NET Framework, which also has this bug (at least up to 4.5; I
haven't checked 4.6).

The way the code is written in the .NET Framework means there are 2 ways
around this - hardcode the FQDN in app.config, which is read by SmtpClient,
or change the value of the private clientDomain field.

Mono's SmtpClient doesn't match the .NET Framework behaviour of reading a
value from app.config, so that option is out.

I'm happy to submit a pull request for a fix, but I'd like a workaround if
possible, as I need to support an old (3.4) version of mono. Any
suggestions?



--
View this message in context: http://mono.1490590.n4.nabble.com/SmtpClient-sends-hostname-instead-of-FQDN-in-EHLO-tp4666455.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list