Description
-
Fires when user's state changes
Syntax
-
Private Sub
object_StateChange(User,
NewState, OldState)
The StateChange Event syntax has these parts:
object |
A wodSmtpServer
object. |
User |
A SmtpUser object.
Reference to the user whose state has changed. |
NewState |
A SmtpUserStates
enumeration, as described in settings. Holds new
state. |
OldState |
A SmtpUserStates
enumeration, as described in settings. Holds previous
state. |
Settings
-
The settings for NewState are:
|
StateNotConnected |
0 |
User is not
connected. |
|
StateConnecting |
1 |
User is connecting. |
|
StateLoggedIn |
2 |
User connected
successfully. |
|
StateSendingMessage |
3 |
User is sending new
message. |
|
StateSendingAuth |
4 |
User is sending
authentication. |
The settings for OldState are:
|
StateNotConnected |
0 |
User is not
connected. |
|
StateConnecting |
1 |
User is connecting. |
|
StateLoggedIn |
2 |
User connected
successfully. |
|
StateSendingMessage |
3 |
User is sending new
message. |
|
StateSendingAuth |
4 |
User is sending
authentication. |
Remarks
-
StateChange event is fired each time user's state
changes. From the beginning, when user tries to connect to
server, his state will be set to StateConnecting. Once he connects successfully
and starts sending additional commands, mostly StateLoggedIn will be set. During message
posting, StateSendingMessage will
be set.
Depending on values provided by this event, you can
inspect user's behavior on your server, deny access to
it or just store it locally for debugging purposes.
|