Difference between revisions of "TPop3Cli.Quit"
(Created page with ' Main page -> ICS component reference -> TPop3Cli -> Quit == Definition == <syntaxhighlight lang="delphi">…') |
|||
Line 9: | Line 9: | ||
== Description == | == Description == | ||
− | Sends '''QUIT''' command to a POP3 server. The command can be issued during an '''AUTHORIZATION''' state (before you've authenticated) and during a '''TRANSACTION''' state (after you've successfully authenticated). In both cases it will log off from server but the difference is how the server will behave. | + | Sends '''QUIT''' command to a POP3 server. You should call it when you're done with POP3 session or if you want to exit after some unexpected server error (if you receive -ERR that you don't expect at a particular moment). The command can be issued during an '''AUTHORIZATION''' state (before you've authenticated) and during a '''TRANSACTION''' state (after you've successfully authenticated). In both cases it will log off from server but the difference is how the server will behave. |
If issued during AUTHORIZATION state (before valid User() and Pass() were sent) it will just make TPop3Cli component log off the server. | If issued during AUTHORIZATION state (before valid User() and Pass() were sent) it will just make TPop3Cli component log off the server. | ||
− | If issued during TRANSACTION state, the server | + | If issued during TRANSACTION state, the server may (or may not) enter '''UPDATE''' state. Whether it will depends if you issued Dele() command or not or in some cases on server-configured behavior (for example - non-standard behavior). If it does enter UPDATE state - it will check if you used '''DELE''' command to delete messages from maildrop on the server and delete them from maildrop. |
+ | |||
+ | During the TRANSACTION state the maildrop on the server is locked and Dele() won't delete anything until Quit() is sent (by all clients accessing maildrop at the given moment). It also means that any new mail cannot be added to maildrop until all POP3 clients disconnect from server. Some mail servers (Gmail being an example) may be exception to maildrop locking and Dele() may not have any effect as defined by RFC standards. | ||
+ | |||
+ | Note also that issuing Dele() during transaction state may modify behavior of other replies you get - for example if you delete message 1 and issue Uidl() - the deleted messages may not show in UIDL list anymore. | ||
== Delphi Example == | == Delphi Example == |
Revision as of 14:47, 4 July 2010
Main page -> ICS component reference -> TPop3Cli -> Quit
Definition
<syntaxhighlight lang="delphi"> procedure Quit; virtual; </syntaxhighlight>
Description
Sends QUIT command to a POP3 server. You should call it when you're done with POP3 session or if you want to exit after some unexpected server error (if you receive -ERR that you don't expect at a particular moment). The command can be issued during an AUTHORIZATION state (before you've authenticated) and during a TRANSACTION state (after you've successfully authenticated). In both cases it will log off from server but the difference is how the server will behave.
If issued during AUTHORIZATION state (before valid User() and Pass() were sent) it will just make TPop3Cli component log off the server.
If issued during TRANSACTION state, the server may (or may not) enter UPDATE state. Whether it will depends if you issued Dele() command or not or in some cases on server-configured behavior (for example - non-standard behavior). If it does enter UPDATE state - it will check if you used DELE command to delete messages from maildrop on the server and delete them from maildrop.
During the TRANSACTION state the maildrop on the server is locked and Dele() won't delete anything until Quit() is sent (by all clients accessing maildrop at the given moment). It also means that any new mail cannot be added to maildrop until all POP3 clients disconnect from server. Some mail servers (Gmail being an example) may be exception to maildrop locking and Dele() may not have any effect as defined by RFC standards.
Note also that issuing Dele() during transaction state may modify behavior of other replies you get - for example if you delete message 1 and issue Uidl() - the deleted messages may not show in UIDL list anymore.
Delphi Example
See List or Uidl for more comprehensive example when and how to use Quit.
C++ Example
See List or Uidl for more comprehensive example when and how to use Quit.