wodImapServer ActiveX Component - 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 wodImapServer object.
User An ImapUser object. Reference to user that issued command.
Command A String value. String expression that represents command and parameters entered.

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 event.

You should understand that this event is in the middle of the chain between user's command and IMAP server's processor. This means that before IMAP server receives this command and evaluate it, you will receive an event where *you can change Command parameter*. Changing this parameter will directly affect IMAP server's behaviour. For instance, if user sends command 'LOGIN test test' you can do
 
Command = "LOGIN joe joe"
 
Do you have idea what will happen? IMAP server will receive (false!) username/password combination as you changed it, so it will try to login user joe/joe instead of test/test. Later you can change any particular command like this.

If you don't like how IMAP server reacts on specific command, you can change that too. Just use Send method to send custom data, and set Command argument to empty string - and wodImapServer will ignore this command (you already sent response, didn't you?) But - try to read IMAP specifications before you do anything like that.


More, if you want to implement new command, for instance 'HELP' command you should do: test if command is entered, set Command parameter to empty string, and Send some response manually using IMAP protocol specification.