Fix for #208 - TIdSMTP - correctly handle answer, if Initial-Response is not supported #530
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #208 - If Initial-Response is not supported, the server might fail to handle the request completely or the server might ask for the username, because the server does not handle the provided username after AUTH LOGIN.
At the moment, the login is cancelled at this moment, so it does not work at all.
So I added functionality to answer the request for the username correctly and continue.
Note:
The encoded string 'Username:' is hardcoded directly in the code at the moment. A constant would be better, but I did not know where to put it correctly.
In addition I added a property CanAttemptIR to TIdSMTP, so one can switch off the try with IR in case the server cannot handle this at all. This was supported already, but the functionality was not exposed, because this parameter was always set to True.