Difference between revisions of "Unit POP3"

From Ultibo.org
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo POP3 interface unit'''
+
'''Ultibo POP3 Interface unit'''
 
+
''To be documented''
+
  
 
=== Constants ===
 
=== Constants ===
Line 252: Line 250:
  
  
'''POP3 buffer'''
+
'''POP3 helper classes'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
<code>TPOP3Buffer = class(TObject)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
| [[TPOP3Buffer|<code>TPOP3Buffer = class(TObject)</code>]]
|-
+
| <code>constructor Create(ASize:LongWord);</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FLock:TCriticalSectionHandle;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FData:Pointer;</code>
+
| &nbsp;
+
|-
+
| <code>FSize:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FCount:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FStart:LongWord;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AcquireLock:Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function ReleaseLock:Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetCount:LongWord;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Count:LongWord read GetCount;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function ReadData:Char;</code>
+
| &nbsp;
+
|-
+
| <code>function WriteData(AChar:Char):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function WriteLock(var ASize:LongWord):Pointer;</code>
+
| &nbsp;
+
|-
+
| <code>function WriteUnlock(ACount:LongWord):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
 
  
'''POP3 client'''
+
'''POP3 client classes'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
<code>TPOP3Client = class(TWinsock2TCPClient)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
| [[TPOP3Client|<code>TPOP3Client = class(TWinsock2TCPClient)</code>]]
|-
+
| <code>constructor Create;</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FOnRequest:TPOP3ClientNotifyEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnReply:TPOP3ClientNotifyEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FOnRequestStart:TNotifyEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnRequestEnd:TNotifyEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FBuffer:TPOP3Buffer;</code>
+
| Buffer for received data
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
+
|-
+
| <code>function GetReply(var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function SendRequest(const ARequest:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property OnRequest:TPOP3ClientNotifyEvent read FOnRequest write FOnRequest;</code>
+
| &nbsp;
+
|-
+
| <code>property OnReply:TPOP3ClientNotifyEvent read FOnReply write FOnReply;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property OnRequestStart:TNotifyEvent read FOnRequestStart write FOnRequestStart;</code>
+
| &nbsp;
+
|-
+
| <code>property OnRequestEnd:TNotifyEvent read FOnRequestEnd write FOnRequestEnd;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property Buffer:TPOP3Buffer read FBuffer;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoConn(const AHost,APort:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoStat(var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoList(const AMessage:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoRetr(const AMessage:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoDele(const AMessage:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoNoop(var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoRset(var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoQuit(var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoTop(const AMessage,ACount:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoUidl(const AMessage:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoUser(const AUsername:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoPass(const APassword:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function DoApop(const AUsername,ADigest:String; var AReply:String):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
 
  
'''POP3 connection'''
+
'''POP3 server classes'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
<code>TPOP3Connection = class(TListObject)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
| [[TPOP3Connection|<code>TPOP3Connection = class(TListObject)</code>]]
|-
+
| <code>constructor Create;</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FLock:TCriticalSectionHandle;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FHandle:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FRxByteCount:Int64;</code>
+
| Bytes Recv Count from Connection
+
|-
+
| <code>FTxByteCount:Int64;</code>
+
| Bytes Sent Count to Connection
+
|-
+
| <code>FRequestCount:Int64;</code>
+
| Requests Recv Count from Connection
+
|-
+
| <code>FReplyCount:Int64;</code>
+
| Replies Sent Count to Connection
+
|-
+
| <code>FRequestTime:TDateTime;</code>
+
| Last Request Time
+
|-
+
| <code>FReplyTime:TDateTime;</code>
+
| Last Reply Time
+
|-
+
| <code>FRemoteAddress:String;</code>
+
| Address of Remote Client
+
|-
+
| <code>FStatus:LongWord;</code>
+
| None,Conn,User,Data etc
+
|-
+
| <code>FUsername:String;</code>
+
| Current Username
+
|-
+
| <code>FPassword:String;</code>
+
| Current Password
+
|-
+
| <code>FTimestamp:String;</code>
+
| Timestamp for APOP authentication
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FThread:TThread;</code>
+
| TWinsock2TCPServerThread
+
|-
+
| <code>FBuffer:TPOP3Buffer;</code>
+
| Buffer for received data
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AcquireLock:Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function ReleaseLock:Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetHandle(AHandle:LongWord);</code>
+
| &nbsp;
+
|-
+
| <code>function GetRxByteCount:Int64;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetRxByteCount(const ARxByteCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>function GetTxByteCount:Int64;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetTxByteCount(const ATxByteCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>function GetRequestCount:Int64;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetRequestCount(const ARequestCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>function GetReplyCount:Int64;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetReplyCount(const AReplyCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>function GetRequestTime:TDateTime;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetRequestTime(const ARequestTime:TDateTime);</code>
+
| &nbsp;
+
|-
+
| <code>function GetReplyTime:TDateTime;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetReplyTime(const AReplyTime:TDateTime);</code>
+
| &nbsp;
+
|-
+
| <code>function GetRemoteAddress:String;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetRemoteAddress(const ARemoteAddress:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetStatus(AStatus:LongWord);</code>
+
| &nbsp;
+
|-
+
| <code>function GetUsername:String;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetUsername(const AUsername:String);</code>
+
| &nbsp;
+
|-
+
| <code>function GetPassword:String;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetPassword(const APassword:String);</code>
+
| &nbsp;
+
|-
+
| <code>function GetTimestamp:String;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetTimestamp(const ATimestamp:String);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetThread(AThread:TThread);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Handle:LongWord read FHandle write SetHandle;</code>
+
| &nbsp;
+
|-
+
| <code>property RxByteCount:Int64 read GetRxByteCount write SetRxByteCount;</code>
+
| &nbsp;
+
|-
+
| <code>property TxByteCount:Int64 read GetTxByteCount write SetTxByteCount;</code>
+
| &nbsp;
+
|-
+
| <code>property RequestCount:Int64 read GetRequestCount write SetRequestCount;</code>
+
| &nbsp;
+
|-
+
| <code>property ReplyCount:Int64 read GetReplyCount write SetReplyCount;</code>
+
| &nbsp;
+
|-
+
| <code>property RequestTime:TDateTime read GetRequestTime write SetRequestTime;</code>
+
| &nbsp;
+
|-
+
| <code>property ReplyTime:TDateTime read GetReplyTime write SetReplyTime;</code>
+
| &nbsp;
+
|-
+
| <code>property RemoteAddress:String read GetRemoteAddress write SetRemoteAddress;</code>
+
| &nbsp;
+
|-
+
| <code>property Status:LongWord read FStatus write SetStatus;</code>
+
| &nbsp;
+
|-
+
| <code>property Username:String read GetUsername write SetUsername;</code>
+
| &nbsp;
+
|-
+
| <code>property Password:String read GetPassword write SetPassword;</code>
+
| &nbsp;
+
|-
+
| <code>property Timestamp:String read GetTimestamp write SetTimestamp;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property Thread:TThread read FThread  write SetThread;</code>
+
| &nbsp;
+
|-
+
| <code>property Buffer:TPOP3Buffer read FBuffer;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure IncrementRxByteCount(const ARxByteCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>procedure IncrementTxByteCount(const ATxByteCount:Int64);</code>
+
| &nbsp;
+
|-
+
| <code>procedure IncrementRequestCount;</code>
+
| &nbsp;
+
|-
+
| <code>procedure IncrementReplyCount;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div> 
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
+
'''POP3 listener'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TPOP3Listener = class(TWinsock2TCPListener)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
| [[TPOP3Listener|<code>TPOP3Listener = class(TWinsock2TCPListener)</code>]]
|-
+
| <code>constructor Create;</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FOnConnected:TPOP3ConnectionEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnDisconnected:TPOP3ConnectionEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FOnCheckHost:TPOP3HostEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnCheckCount:TPOP3CountEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FOnRequest:TPOP3NotifyEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnReply:TPOP3NotifyEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FOnConn:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnStat:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnList:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnRetr:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnDele:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnNoop:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnRset:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnQuit:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FOnTop:TPOP3RequestExEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnUidl:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnUser:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnPass:TPOP3RequestEvent;</code>
+
| &nbsp;
+
|-
+
| <code>FOnApop:TPOP3RequestExEvent;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
+
|-
+
| <code>procedure DoConnect(AThread:TWinsock2TCPServerThread); override;</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoDisconnect(AThread:TWinsock2TCPServerThread); override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoCheckHost(AThread:TWinsock2TCPServerThread):Boolean; virtual;</code>
+
| &nbsp;
+
|-
+
| <code>function DoCheckCount(AThread:TWinsock2TCPServerThread):Boolean; virtual;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoExecute(AThread:TWinsock2TCPServerThread):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure DoConn(AThread:TWinsock2TCPServerThread);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoStat(AThread:TWinsock2TCPServerThread);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoList(AThread:TWinsock2TCPServerThread; const AMessage:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoRetr(AThread:TWinsock2TCPServerThread; const AMessage:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoDele(AThread:TWinsock2TCPServerThread; const AMessage:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoNoop(AThread:TWinsock2TCPServerThread);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoRset(AThread:TWinsock2TCPServerThread);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoQuit(AThread:TWinsock2TCPServerThread);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure DoTop(AThread:TWinsock2TCPServerThread; const AMessage,ACount:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoUidl(AThread:TWinsock2TCPServerThread; const AMessage:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoUser(AThread:TWinsock2TCPServerThread; const AUsername:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoPass(AThread:TWinsock2TCPServerThread; const APassword:String);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DoApop(AThread:TWinsock2TCPServerThread; const AUsername,ADigest:String);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetRequest(AThread:TWinsock2TCPServerThread; var ARequest:String):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function SendReply(AThread:TWinsock2TCPServerThread; const AReply:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property OnConnected:TPOP3ConnectionEvent read FOnConnected write FOnConnected;</code>
+
| &nbsp;
+
|-
+
| <code>property OnDisconnected:TPOP3ConnectionEvent read FOnDisconnected write FOnDisconnected;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property OnCheckHost:TPOP3HostEvent read FOnCheckHost write FOnCheckHost;</code>
+
| &nbsp;
+
|-
+
| <code>property OnCheckCount:TPOP3CountEvent read FOnCheckCount write FOnCheckCount;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property OnRequest:TPOP3NotifyEvent read FOnRequest write FOnRequest;</code>
+
| &nbsp;
+
|-
+
| <code>property OnReply:TPOP3NotifyEvent read FOnReply write FOnReply;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property OnConn:TPOP3RequestEvent read FOnConn write FOnConn;</code>
+
| &nbsp;
+
|-
+
| <code>property OnStat:TPOP3RequestEvent read FOnStat write FOnStat;</code>
+
| &nbsp;
+
|-
+
| <code>property OnList:TPOP3RequestEvent read FOnList write FOnList;</code>
+
| &nbsp;
+
|-
+
| <code>property OnRetr:TPOP3RequestEvent read FOnRetr write FOnRetr;</code>
+
| &nbsp;
+
|-
+
| <code>property OnDele:TPOP3RequestEvent read FOnDele write FOnDele;</code>
+
| &nbsp;
+
|-
+
| <code>property OnNoop:TPOP3RequestEvent read FOnNoop write FOnNoop;</code>
+
| &nbsp;
+
|-
+
| <code>property OnRset:TPOP3RequestEvent read FOnRset write FOnRset;</code>
+
| &nbsp;
+
|-
+
| <code>property OnQuit:TPOP3RequestEvent read FOnQuit write FOnQuit;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property OnTop:TPOP3RequestExEvent read FOnTop write FOnTop;</code>
+
| &nbsp;
+
|-
+
| <code>property OnUidl:TPOP3RequestEvent read FOnUidl write FOnUidl;</code>
+
| &nbsp;
+
|-
+
| <code>property OnUser:TPOP3RequestEvent read FOnUser write FOnUser;</code>
+
| &nbsp;
+
|-
+
| <code>property OnPass:TPOP3RequestEvent read FOnPass write FOnPass;</code>
+
| &nbsp;
+
|-
+
| <code>property OnApop:TPOP3RequestExEvent read FOnApop write FOnApop;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div> 
 
 
<br />
 
<br />
  
Line 902: Line 312:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 917: Line 327:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 929: Line 339:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 941: Line 351:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 953: Line 363:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 965: Line 375:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 05:28, 31 August 2021

Return to Unit Reference


Description


Ultibo POP3 Interface unit

Constants



POP3 specific constants POP3_*
POP3_LINE_END = Chr(13) + Chr(10); CR LF
 
POP3_BUFFER_SIZE = SIZE_4K;  


POP3 status POP3_STATUS_*
POP3_STATUS_NONE = 0;  
POP3_STATUS_CONN = 1;  
POP3_STATUS_USER = 2;  
POP3_STATUS_PASS = 3;  
POP3_STATUS_APOP = 4;  
POP3_STATUS_DATA = 5;  
POP3_STATUS_QUIT = 6;  
 
POP3_MAX_STATUS = 6;  


POP3 command POP3_COMMAND_*
POP3_COMMAND_STAT = 'STAT';  
POP3_COMMAND_LIST = 'LIST';  
POP3_COMMAND_RETR = 'RETR';  
POP3_COMMAND_DELE = 'DELE';  
POP3_COMMAND_NOOP = 'NOOP';  
POP3_COMMAND_RSET = 'RSET';  
POP3_COMMAND_QUIT = 'QUIT';  
 
POP3_COMMAND_TOP = 'TOP';  
POP3_COMMAND_UIDL = 'UIDL';  
POP3_COMMAND_USER = 'USER';  
POP3_COMMAND_PASS = 'PASS';  
POP3_COMMAND_APOP = 'APOP';  


POP3 string POP3_STRING_*
POP3_STRING_SUCCESS = '+OK ';  
POP3_STRING_FAILURE = '-ERR ';  
POP3_STRING_COMPLETE = '.';  
 
POP3_STRING_SIGNON = 'Ultibo POP3 server (version ' + ULTIBO_RELEASE_VERSION + ')';  
POP3_STRING_SIGNOFF = 'Ultibo POP3 server closing connection';  
POP3_STRING_EMPTY_STAT = '0 0';  
POP3_STRING_EMPTY_LIST = '0 messages (0 octets)';  
POP3_STRING_BAD_COMMAND = 'Bad command';  
POP3_STRING_BAD_MESSAGE = 'No such message';  
POP3_STRING_BAD_USERNAME = 'Invalid username or password';  
POP3_STRING_BAD_PASSWORD = 'Invalid username or password';  
POP3_STRING_NO_PERMISSION = 'Permission denied';  


POP3 logging POP3_LOG_*
POP3_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG; POP3 debugging messages
POP3_LOG_LEVEL_INFO = LOG_LEVEL_INFO; POP3 informational messages
POP3_LOG_LEVEL_WARN = LOG_LEVEL_WARN; POP3 warning messages
POP3_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR; POP3 error messages
POP3_LOG_LEVEL_NONE = LOG_LEVEL_NONE; No POP3 messages


Type definitions



POP3 client notify event

TPOP3ClientNotifyEvent = procedure(const ARequest:String) of Object;

POP3 host event

TPOP3HostEvent = function(AConnection:TPOP3Connection):Boolean of Object;

POP3 count event

TPOP3CountEvent = function(AConnection:TPOP3Connection):Boolean of Object;

POP3 notify event

TPOP3NotifyEvent = procedure(AConnection:TPOP3Connection; const ARequest:String) of Object;

POP3 request event

TPOP3RequestEvent = function(AConnection:TPOP3Connection; const ARequest:String; var AReply:String):Boolean of Object;

POP3 request extended event

TPOP3RequestExEvent = function(AConnection:TPOP3Connection; const ARequest,AData:String; var AReply:String):Boolean of Object;

POP3 connection event

TPOP3ConnectionEvent = procedure(AConnection:TPOP3Connection) of Object;


Class definitions



POP3 helper classes

TPOP3Buffer = class(TObject)

POP3 client classes

TPOP3Client = class(TWinsock2TCPClient)

POP3 server classes

TPOP3Connection = class(TListObject)
TPOP3Listener = class(TWinsock2TCPListener)


Public variables



POP3 logging

POP3_DEFAULT_LOG_LEVEL:LongWord = POP3_LOG_LEVEL_DEBUG; Minimum level for POP3 messages. Only messages with level greater than or equal to this will be printed.
POP3_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

procedure POP3Init;
Description: To be documented
Note None documented


POP3 helper functions

procedure POP3Log(Level:LongWord; const AText:String);
Description: To be documented
Note None documented


procedure POP3LogInfo(const AText:String); inline;
Description: To be documented
Note None documented


procedure POP3LogWarn(const AText:String); inline;
Description: To be documented
Note None documented


procedure POP3LogError(const AText:String); inline;
Description: To be documented
Note None documented


procedure POP3LogDebug(const AText:String); inline;
Description: To be documented
Note None documented


Return to Unit Reference