wodPop3Server ActiveX Control - Command Event
    
 

Description

Fires when user issues new command.


Syntax

Private Sub object_Command(User, Command)



The Command Event syntax has these parts:

Part Description
object A wodPop3Server object.
User A Pop3User object. Reference to user sent the command.
Command A String value. Command that was executed, together with any parameters after it.

Remarks

This event will be fired each time user issues some command, no matter what user's state is set to. For instance, after Connecting event you will not receive any additional events until user sends username/password combination. However, if you're interested if he's testing your server for some other commands or vulnerabilities, you can just track down every command he sends using this property.

You should understand that this event is in the middle of the chain between user's command and wodPop3Server's processor. This means that before wodPop3Server receives this command and examine it, you will receive an event where you can change Command argument. Changing this argument will directly affect wodPop3Server's behaviour. For instance, if user sends command 'USER test' you can do

Command = "USER joe"

and then after it user sends 'PASS test' and you change it to

Command = "PASS joe"

Do you have idea what will happen? wodPop3Server will receive username/password combination as you changed it, so it will try to login user joe/joe instead of (for example) test/test. Later you can change any particular command like this.

If you don't like how wodPop3Server reacts on specific command, you can implement it yourself different way. For instance, if you want 'TOP' command NOT to work, you can just do something like this:

If Ucase$(Left$(Command, 3)) = "TOP" Then
   Command = ""
   User.Send "-ERR command unrecognized" & vbCrLf
End If

This way wodPop3Server will just ignore command because Command is set to empty string, and you already sent some reply, so no protocol violations are made.

More, if you want to implement new command, for instance 'HELP' command you should do same as above - test if command is entered, set Command argument to empty string, and Send some response manually using POP3 protocol specification.