![]() |
Sending Email by idSMTP from computers with underscore in name - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Indy (https://www.atozed.com/forums/forum-8.html) +--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html) +--- Thread: Sending Email by idSMTP from computers with underscore in name (/thread-1030.html) |
Sending Email by idSMTP from computers with underscore in name - Steffen - 04-12-2019 I realized, that an underscore in the computer name effectivly prevents sending of emails with Indy's TIdSMTP, TIdMessage & TIdSSLIOHandlerSocketOpenSSL. I use Delphi XE3 with latest Indy 10.6.2. and latest SSLs (utUseExplicitTLS & port 587). TIdLogfile shows this message when the computer name contains an "_": "501 Syntactically invalid EHLO argument(s)" I tested this with Windows pro 7 and 10. Can anybody reproduce this? When I change the computer name to a string not containing an underscore, mails are sent! This observation is coherent with another user's problem, described here: https://github.com/jens-maus/yam/issues/325 Is there a workaround that enables sending IdSMTP mails also from computer names with underscore? RE: Sending Email by idSMTP from computers with underscore in name - kudzu - 04-12-2019 501 is not an Indy error. This error is coming from the server and most likely a server based problem. From the very link you posted which appears Indy is not involved there at all yet: " In a short test it seems that the SMTP server of your provider doesn't like the "_" character in your hostname. I'll see how I can change that and what the official RFC says about that. Thanks for the report and the debug log." It looks like an improperly configured server unless there is an encoding issue for which _ does not require such AFAIK. RE: Sending Email by idSMTP from computers with underscore in name - Steffen - 04-12-2019 (04-12-2019, 01:45 PM)kudzu Wrote: 501 is not an Indy error. This error is coming from the server and most likely a server based problem. From the very link you posted which appears Indy is not involved there at all yet: Even though 501 might not be an Indy error, it could well be that Indy behaviour is still effected by such non-standard hostnames, don't you agree? The link I gave just for reference that the problem exists. I am aware that it does not refer to Indy. Have you tried to reproduce? RE: Sending Email by idSMTP from computers with underscore in name - rlebeau - 04-12-2019 (04-12-2019, 09:19 AM)Steffen Wrote: TIdLogfile shows this message when the computer name contains an "_": The EHLO command accepts only a valid domain host name or an IP address. A computer name is not always a valid host name, and a '_' character is not allowed in the EHLO command in SMTP, per RFC 5321, Section 2.3.5, Domain Names: Quote:A domain name (or often just a "domain") consists of one or more components, separated by dots if more than one appears. In the case of a top-level domain used by itself in an email address, a single string is used without any dots. This makes the requirement, described in more detail below, that only fully-qualified domain names appear in SMTP transactions on the public Internet, particularly important where top-level domains are involved. These components ("labels" in DNS terminology, RFC 1035 [2]) are restricted for SMTP purposes to consist of a sequence of letters, digits, and hyphens drawn from the ASCII character set [6]. Domain names are used as names of hosts and of other entities in the domain name hierarchy. For example, a domain may refer to an alias (label of a CNAME RR) or the label of Mail eXchanger records to be used to deliver mail instead of representing a host name. See RFC 1035 [2] and Section 5 of this specification. (04-12-2019, 09:19 AM)Steffen Wrote: Is there a workaround that enables sending IdSMTP mails also from computer names with underscore? Set the TIdSMTP.HeloName property to whatever value you want, such as the result of the Win32 API GetComputerNameEx() function, which can return a (fully-qualified) domain name for the local computer, if one is available. If no HeloName is provided, Indy defaults to using the computer's current host name (via TIdStack.HostName), and if no host name is available then it uses the computer's OS name (via IndyComputerName()). RE: Sending Email by idSMTP from computers with underscore in name - Steffen - 04-13-2019 Thank you Remy!!! It appears to me as if setting TIdSMTP.HeloName to a valid domain string is extremely important for a reliable functionality of TIdSMTP. |