-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending the UTF8 command to the POP3 Server #450
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,6 +587,18 @@ procedure TIdPOP3.SetSASLMechanisms(AValue: TIdSASLEntries); | |
FSASLMechanisms.Assign(AValue); | ||
end; | ||
|
||
procedure TIdPOP3.SendUTF8IfAdvertised; | ||
var | ||
Capa : string; | ||
begin | ||
for Capa in FCapabilities do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indy cannot use |
||
if TextStartsWith(Capa, 'UTF8 ') then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
begin | ||
SendCmd('UTF8',''); | ||
exit; | ||
end; | ||
end; | ||
|
||
procedure TIdPOP3.Connect; | ||
var | ||
S: String; | ||
|
@@ -619,6 +631,7 @@ procedure TIdPOP3.Connect; | |
if FAutoLogin then begin | ||
Login; | ||
end; | ||
SendUTF8IfAdvertised; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sending the So, you are going to have to move the The alternative would be to manually keep track of whether |
||
except | ||
Disconnect(False); | ||
raise; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really liking the naming of this method. If you look at other Indy components, they use more general-purpose methods for testing for available capabilties (eg,
TIdNNTP.IsExtCmdSupported()
,TIdDICT.IsCapaSupported()
,TIdFTP.IsExtSupported()
, etc). I think your method needs to look a little more likeTIdFTP.FindAuthCmd()
, for example.