wodSmtpServer ActiveX Control - Command Method
      
 

Description

Called when user issues new command.


Return Type

None  


Syntax

object.Command Owner, User, Command



The Command Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSmtpNotify.
Owner Required. A wodSmtpServer object. Reference to wodSmtpServerCom instance that called this callback method.
User Required. A SmtpUser object. Reference to user who sent a command.
Command Required. A String value. Represents command and parameters entered.

Remarks

NOTE: This method is called only if you implemented IwodSmtpNotify interface in your application, and wodSmtpServer1.Notification property has received reference to instance of your implementation.

This notification method will be called each time user issues some command, no matter what user's state is set to. For instance, after Connecting notification you will not receive any additional notifications until user sends HELO or EHLO command. 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 notification is in the middle of the chain between user's command and Smtp server's processor. This means that before Smtp server receives this command and evaluate it, you will receive the notification where *you can change Command parameter*. Changing this parameter will directly affect Smtp server's behavior. For instance, if user sends command 'HELO mail.sun.com' you can do

Command = "HELO mail.microsoft.com"

Do you have idea what will happen? Smtp server will receive HELO information as you changed it, so it will store this in email message. Later you can change any particular command this way.

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

    If Ucase$(Left$(Command, 4)) = "HELO" Then
        Command = ""
        User.Send "550 command unrecognized" & vbCrLf
    End If

This way Smtp server 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 parameter to empty string, and Send some response manually using Smtp protocol specification.